apiVersion: v1
data:
  astra-metrics-exporter.yaml: |-
    # Astra Exporter configuration
    # The astra exporter takes metrics from various FireTap sources and makes them available
    # on a prometheus scrapable endpoint.
    #
    #
    # For each metric defined here, name, help and type define how the metric is presented to prometheus.
    #  properties define the source of the data to get to expose this metric.
    # To get metrics which are the aggregated of other metrics, please keep these things in mind.
    #   Currently you can only do "sum" or "perc" of the metrics.
    #   Sum - Summation
    #   perc - Percentage
    #
    # The typical format is "sum               (volume)           (statistics.iops.other, statistics.iops.read)"
    #                          ^^                   ^^                             ^^
    #                       Operation to perform  Resource type of    The actual path in the REST response.
    #                                              metrics
    #
    # NOTE: Currently only cluster object type will aggregate over all instances/uuid of the said resource type.
    #
    #- name:    the name of the metric as exposed to prometheus i.e. astrads_volume_total_ops
    #  help:    description of the metric
    #  type:    prometheus metric type i.e. counter or gauge
    #  properties:
    #    source: source of the metric. i.e. firetap_rest API
    #    object: object in the source i.e. cluster, disk, volume
    #    path:   the path in the REST response to the metric
    #    unit:   what units the metric is in in the REST response, count, bytes, MiB, Mb, ms, microsec
    #
    name: ads-exporter
    port: 9341
    endpoint: /metrics
    timeout: 60
    metrics:
    - name: astrads_volume_total_ops
      help: Total number of operations for a volume
      type: counter
      properties:
        source: firetap_rest
        object: volume
        path: sum(volume)(statistics.iopsRaw.other,statistics.iopsRaw.read,statistics.iopsRaw.write)
        unit: count
    - name: astrads_volume_other_ops
      help: Total number of operations for a volume that are neither read or write
      type: counter
      properties:
        source: firetap_rest
        object: volume
        path: statistics.iopsRaw.other
        unit: count
    - name: astrads_volume_write_ops
      help: Total number of write operations for a volume
      type: counter
      properties:
        source: firetap_rest
        object: volume
        path: statistics.iopsRaw.write
        unit: count
    - name: astrads_volume_read_ops
      help: Total number of read operations for a volume
      type: counter
      properties:
        source: firetap_rest
        object: volume
        path: statistics.iopsRaw.read
        unit: count
    - name: astrads_volume_total_latency
      help: Total accumulated latency in seconds for all operations on a volume. Divide by astrads_volume_total_ops to get the average latency per operation
      type: counter
      properties:
        source: firetap_rest
        object: volume
        path: sum(volume)(statistics.latencyRaw.other,statistics.latencyRaw.read,statistics.latencyRaw.write)
        unit: microsec
    - name: astrads_volume_other_latency
      help: Total accumulated latency in seconds for operations on a volume that are neither read or write. Divide by astrads_volume_other_ops to get the average latency per other operation
      type: counter
      properties:
        source: firetap_rest
        object: volume
        path: statistics.latencyRaw.other
        unit: microsec
    - name: astrads_volume_write_latency
      help: Total accumulated write latency in seconds for volume. Divide by astrads_volume_write_ops to get the average latency per write operation
      type: counter
      properties:
        source: firetap_rest
        object: volume
        path: statistics.latencyRaw.write
        unit: microsec
    - name: astrads_volume_read_latency
      help: Total accumulated read latency in seconds for a volume. Divide by astrads_volume_read_ops to get the average latency per read operation
      type: counter
      properties:
        source: firetap_rest
        object: volume
        path: statistics.latencyRaw.read
        unit: microsec
    - name: astrads_volume_total_throughput
      help: Total thoughput for a volume in bytes
      type: counter
      properties:
        source: firetap_rest
        object: volume
        path: sum(volume)(statistics.throughputRaw.read,statistics.throughputRaw.write)
        unit: count
    - name: astrads_volume_write_throughput
      help: Total write thoughput for a volume in bytes
      type: counter
      properties:
        source: firetap_rest
        object: volume
        path: statistics.throughputRaw.write
        unit: count
    - name: astrads_volume_read_throughput
      help: Total read throughput for a volume in bytes
      type: counter
      properties:
        source: firetap_rest
        object: volume
        path: statistics.throughputRaw.read
        unit: count
    - name: astrads_volume_capacity_percent
      help: Percentage of volume capacity available (0-100). (capacity available / provisioned) * 100
      type: gauge
      properties:
        source: firetap_rest
        object: volume
        path: perc(volume)(space.available, space.provisioned)
        unit: count
    - name: astrads_volume_capacity_size
      help: Total capacity of a volume in bytes
      type: gauge
      properties:
        source: firetap_rest
        object: volume
        path: size
        unit: bytes
    - name: astrads_volume_capacity_provisioned
      help: Provisioned capacity of a volume in bytes after setting aside the snapshot reserve. (size - snapshot reserve = provisioned)
      type: gauge
      properties:
        source: firetap_rest
        object: volume
        path: space.provisioned
        unit: bytes
    - name: astrads_volume_capacity_used
      help: Used capacity of a volume in bytes. This is bytes in the active filesystem unless snapshots are consuming more than the snapshot reserve. (bytes in the active file system + MAX(0, snapshot_used-(snapshot_reserve_percent/100*size))
      type: gauge
      properties:
        source: firetap_rest
        object: volume
        path: space.used
        unit: bytes
    - name: astrads_volume_capacity_available
      help: The minimum of the available capacity of a volume and the available capacity of the cluster in bytes
      type: gauge
      properties:
        source: firetap_rest
        object: volume
        path: space.available
        unit: bytes
    - name: astrads_volume_capacity_available_logical
      help: Logical available capacity of a volume in bytes
      type: gauge
      properties:
        source: firetap_rest
        object: volume
        path: space.logical.available
        unit: bytes
    - name: astrads_volume_capacity_snapshot_used
      help: The amount of volume snapshot data that is not in the active file system in bytes
      type: gauge
      properties:
        source: firetap_rest
        object: volume
        path: space.snapshot.used
        unit: bytes
    - name: astrads_volume_capacity_snapshot_reserve_percent
      help: Snapshot reserve percentage of a volume (0-100)
      type: gauge
      properties:
        source: firetap_rest
        object: volume
        path: space.snapshot.reservePercent
        unit: count
    - name: astrads_cluster_capacity_max_logical
      help: Max Logical capacity of the cluster in bytes
      type: gauge
      properties:
        source: firetap_rest
        object: cluster
        path: space.max.logical
        unit: bytes
    - name: astrads_cluster_capacity_max_physical
      help: The sum of the space in the cluster in bytes for storing data after provisioning efficiencies, data reduction algorithms and replication schemes are applied
      type: gauge
      properties:
        source: firetap_rest
        object: cluster
        path: space.max.physical
        unit: bytes
    - name: astrads_cluster_capacity_used_logical
      help: The sum of the bytes of data in all volumes in the cluster before provisioning efficiencies, data reduction algorithms and replication schemes are applied
      type: gauge
      properties:
        source: firetap_rest
        object: cluster
        path: space.used.logical
        unit: bytes
    - name: astrads_cluster_storage_efficiency
      help: Efficacy of data reduction technologies. (logical used / physical used)
      type: gauge
      properties:
        source: firetap_rest
        object: cluster
        path: space.dataReductionFactor
        unit: bytes
    - name: astrads_cluster_capacity_used_physical
      help: Used Physical capacity of a cluster in bytes
      type: gauge
      properties:
        source: firetap_rest
        object: cluster
        path: space.used.physical
        unit: bytes
    - name: astrads_cluster_capacity_ops
      help: The IO operations capacity of the cluster
      type: gauge
      properties:
        source: firetap_rest
        object: cluster
        path: iops.max
        unit: count
    - name: astrads_cluster_utilization_factor
      help: The ratio of the current cluster IO operations based on recent IO sizes to the cluster iops capacity. (0.0 - 1.0)
      type: gauge
      properties:
        source: firetap_rest
        object: cluster
        path: iops.utilizationFactor
        unit: count
    - name: astrads_cluster_total_ops
      help: The sum of the IO operations of all the volumes in a cluster
      type: counter
      properties:
        source: firetap_rest
        object: cluster
        path: sum(volume)(statistics.iopsRaw.other,statistics.iopsRaw.read,statistics.iopsRaw.write)
        unit: count
    - name: astrads_cluster_read_ops
      help: The sum of the read IO operations of all the volumes in a cluster
      type: counter
      properties:
        source: firetap_rest
        object: cluster
        path: sum(volume)(statistics.iopsRaw.read)
        unit: count
    - name: astrads_cluster_write_ops
      help: The sum of the write IO operations of all the volumes in a cluster
      type: counter
      properties:
        source: firetap_rest
        object: cluster
        path: sum(volume)(statistics.iopsRaw.write)
        unit: count
    - name: astrads_cluster_other_ops
      help: The sum of the other IO operations of all the volumes in a cluster
      type: counter
      properties:
        source: firetap_rest
        object: cluster
        path: sum(volume)(statistics.iopsRaw.other)
        unit: count
    - name: astrads_cluster_total_throughput
      help: The sum of the read and write throughput of all the volumes in a cluster in bytes
      type: counter
      properties:
        source: firetap_rest
        object: cluster
        path: sum(volume)(statistics.throughputRaw.read,statistics.throughputRaw.write)
        unit: count
    - name: astrads_cluster_read_throughput
      help: The sum of the read throughput of all the volumes in a cluster in bytes
      type: counter
      properties:
        source: firetap_rest
        object: cluster
        path: sum(volume)(statistics.throughputRaw.read)
        unit: count
    - name: astrads_cluster_write_throughput
      help: The sum of the write throughput of all the volumes in a cluster in bytes
      type: counter
      properties:
        source: firetap_rest
        object: cluster
        path: sum(volume)(statistics.throughputRaw.write)
        unit: count
    - name: astrads_cluster_total_latency
      help: The sum of the accumulated latency in seconds of all IO operations of all the volumes in a cluster. Divide by astrads_cluster_total_ops to get average latency per operation
      type: counter
      properties:
        source: firetap_rest
        object: cluster
        path: sum(volume)(statistics.latencyRaw.other,statistics.latencyRaw.read,statistics.latencyRaw.write)
        unit: microsec
    - name: astrads_cluster_read_latency
      help: The sum of the accumulated latency in seconds of read IO operations of all the volumes in a cluster. Divide by astrads_cluster_read_ops to get the average latency per read operation
      type: counter
      properties:
        source: firetap_rest
        object: cluster
        path: sum(volume)(statistics.latencyRaw.read)
        unit: microsec
    - name: astrads_cluster_write_latency
      help: The sum of the accumulated latency in seconds of write IO operations of all the volumes in a cluster. Divide by astrads_cluster_write_ops to get the average latency per write operation
      type: counter
      properties:
        source: firetap_rest
        object: cluster
        path: sum(volume)(statistics.latencyRaw.write)
        unit: microsec
    - name: astrads_cluster_other_latency
      help: The sum of the accumulated latency in seconds for other IO operations of all the volumes in a cluster. Divide by astrads_cluster_other_ops to get the average latency per other operation
      type: counter
      properties:
        source: firetap_rest
        object: cluster
        path: sum(volume)(statistics.latencyRaw.other)
        unit: microsec
    - name: astrads_cluster_volume_used
      help: The sum of used capacity of all the volumes in a cluster in bytes
      type: gauge
      properties:
        source: firetap_rest
        object: cluster
        path: sum(volume)(space.used)
        unit: count
    - name: astrads_cluster_capacity_physical_percent
      help: The percentage of cluster physical capacity that is used (0-100)
      type: gauge
      properties:
        source: firetap_rest
        object: cluster
        path: perc(cluster)(space.used.physical, space.max.physical)
        unit: count
    - name: astrads_cluster_capacity_logical_percent
      help: Percentage cluster logical capacity that is used (0-100)
      type: gauge
      properties:
        source: firetap_rest
        object: cluster
        path: perc(cluster)(space.used.logical,space.max.logical)
        unit: count
    - name: astrads_disk_capacity
      help: Raw Capacity of a disk in bytes
      type: gauge
      properties:
        source: firetap_rest
        object: drive
        path: detail.capacity
        unit: bytes
    - name: astrads_disk_write_ops
      help: Total number of write operations for a disk
      type: counter
      properties:
        source: firetap_rest
        object: drive
        path: detail.statistics.iopsRaw.write
        unit: count
    - name: astrads_disk_read_ops
      help: Total number of read operations for a disk
      type: counter
      properties:
        source: firetap_rest
        object: drive
        path: detail.statistics.iopsRaw.read
        unit: count
    - name: astrads_disk_write_throughput
      help: Total bytes written to a disk
      type: counter
      properties:
        source: firetap_rest
        object: drive
        path: detail.statistics.throughputRaw.write
        unit: count
    - name: astrads_disk_read_throughput
      help: Total bytes read from a disk
      type: counter
      properties:
        source: firetap_rest
        object: drive
        path: detail.statistics.throughputRaw.read
        unit: count
    - name: astrads_disk_write_latency
      help: Total accumulated latency in seconds for disk writes. Divide by astrads_disk_write_ops to get the average latency per write operation
      type: counter
      properties:
        source: firetap_rest
        object: drive
        path: detail.statistics.latencyRaw.write
        unit: microsec
    - name: astrads_disk_read_latency
      help: Total accumulated latency in seconds for disk reads. Divide by astrads_disk_read_ops to get the average latency per read operation
      type: counter
      properties:
        source: firetap_rest
        object: drive
        path: detail.statistics.latencyRaw.read
        unit: microsec
    - name: astrads_disk_base_seconds
      help: Base for busy, pending and queued. Seconds since collection began
      type: counter
      properties:
        source: firetap_rest
        object: drive
        path: detail.statistics.baseRaw
        unit: ms
    - name: astrads_disk_busy
      help: Seconds the disk was busy. 100 * (astrads_disk_busy / astrads_disk_base_seconds) = percent busy (0-100)
      type: counter
      properties:
        source: firetap_rest
        object: drive
        path: detail.statistics.busyRaw
        unit: ms
    - name: astrads_disk_io_pending
      help: Summation of the count of pending io operations for a disk times time. Divide by astrads_disk_base_seconds to get the average pending operation count
      type: counter
      properties:
        source: firetap_rest
        object: drive
        path: detail.statistics.ioPendingRaw
        unit: ms
    - name: astrads_disk_io_queued
      help: Summation of the count of queued io operations for a disk times time. Divide by astrads_disk_base_seconds to get the average queued operations count
      type: counter
      properties:
        source: firetap_rest
        object: drive
        path: detail.statistics.ioQueuedRaw
        unit: ms
    - name: astrads_disk_wear_percentage
      help: Wear Percentage of SSD in ADS cluster
      type: gauge
      properties:
        source: firetap_rest
        object: drive
        path: detail.wearPercent
        unit: count
    - name: astrads_disk_read_total
      help: Summation of all bytes read by disks.
      type: counter
      properties:
        source: firetap_rest
        object: drive
        path: detail.statistics.totalBytes.read
        unit: count
    - name: astrads_disk_write_total
      help: Summation of all bytes written to disk.
      type: counter
      properties:
        source: firetap_rest
        object: drive
        path: detail.statistics.totalBytes.write
        unit: count
    - name: astrads_cluster_capacity_licensed_percent
      help: The percentage of licensed usable physical capacity currently consumed
      type: gauge
      properties:
        source: firetap_rest
        object: cluster
        path: perc(cluster)(space.used.physical, space.licensedCapacity)
        unit: count
    - name: astrads_cluster_capacity_licensed
      help: The limit on used physical capacity based on the license
      type: gauge
      properties:
        source: firetap_rest
        object: cluster
        path: space.licensedCapacity
        unit: count
kind: ConfigMap
metadata:
  labels:
    product: astrads
  name: astrads-metrics-cm
