Contact Sales

Metrics and Labels

Every time series is uniquely identified by its metric name and optional key-value pairs called labels. The metric name specifies the general feature of a system that is measured. Labels enable Prometheus's dimensional data model: any given combination of labels for the same metric name identifies a particular dimensional instantiation of that metric. The query language allows filtering and aggregation based on these dimensions.

The structure of the metric and label(s) is as follows: metric{label_1, …, label_N}.

hashboard_temperature{hashboard="6"} 69.95671081542969 1672171054814

Where

  • hashboard_temperature represents metric
  • hashboard represents label
  • 69.95671081542969 represent measured value
  • 1672171054814 stands for record time in unix timestamp

Braiins OS metrics are exposed by each individual miner on [miner-ip-address]:8081/metrics. Stock FW metrics are prepared by metrics exporter and exposed on [localhost]:8081/metrics. Where it was possible to Braiins OS and Stock FW metrics are identical (e.g. metric temperature), but when the data from both OSs differ there are metrics specific to the OS (e.g. Braiins OS has a metric fan_speed_control while Stock FW not).

Overview

Metrics Exporter Data

Metrics exporter is an application which performs device discovery on the farm's network and prepares mining data for devices running on a firmware, which is not publishing metrics. Those data are exposed on the port 8081.

There are two types of metrics - Local and Remote.

  • Local metrics are related to the metrics exporter itself - info about device discovery, scraping and errors.
  • Remote metrics are displaying mining data of the miners running on Stock FW.

Labels

Each Braiins OS or Stock FW metric besides specific labels these general label:

  • label
    • label representing IP range from the ./monitoring/metrics_exporter/metrics-exporter.toml
  • job
    • label representing scrape process (which is a different job for Braiins OS and Stock FW)
    • values: braiinsos-data, metrics-exporter
  • instance
    • IP address of the miner
    • values: IP address in the IPv4 format
  • host_id
    • label representing fourth octet of the miner's IP address
    • values: integer
  • site_id
    • label representing second octet of the miner's IP address
    • values: integer
  • subnet_id
    • label representing third octet of the miner's IP address
    • values: integer

Other specific labels are shown below within metrics specification.

Local

Local metrics are providing information about device discovery and data scraping of the Stock FW:

  • metrics_exporter_scrape_cycles_total

    • total number of performed scrapes of the miners with the Stock FW. One cycle represents one loop of the scrapes of all detected miners with the Stock FW.
    • type: counter
    • labels: no labels
  • metrics_exporter_scrape_cycle_seconds

    • duration of the last scraping cycle in seconds (only Stock FW)
    • type: gauge
    • label: no label
  • metrics_exporter_ip_addresses

    • number of IP addresses to be discovered based on the IP ranges defined in the ./monitoring/metrics_exporter/metrics-exporter.toml (IP addresses of the all miners no matter what firmware it runs)
    • type: gauge
    • labels: no label
  • metrics_exporter_scrape_errors

    • number of errors returned in the last scrape cycle (only Stock FW)
    • type: gauge
    • labels: no label
  • metrics_exporter_discovered_devices{fw: stock | bos}

    • number of discovered devices which are online
    • type: gauge
    • labels:
      • fw: firmware type, either bos or stock

Remote

Remote metrics represent all available metrics for the miners running on Stock FW where it was possible to obtain data from CGMiner API. Then the metrics-exporter transforms them into metrics to be digested by Prometheus. CGMiner API is very limited in comparison to Braiins OS metrics, so the amount of available information is limited.

Remote metrics are:

  • up

    • gauge representing successful (1) and unsuccessful (0) scrape of the instance
    • type: gauge
  • miner_metadata{model, os_version}

    • basic information about the miner
    • type: gauge
    • labels:
      • model: model of the miner
      • os_version: version of the firmware
  • hashboard_nominal_hashrate_ghs{hashboard}

    • nominal hashrate for each hashboard in Gh/s
    • type: gauge
    • labels:
      • hashboard: rank of the hashboard
  • average_hashrate_last_5_sec_ghs{}

    • average hashrate in the last 5 seconds in Gh/s
    • type: gauge
    • labels: no labels
  • average_hashrate_last_30_min_ghs{}

    • average hashrate in the last 30 minutes in Gh/s
    • type: gauge
    • labels: no labels
  • average_hashrate_since_restart_ghs{}

    • average hashrate since the restart of the mining component (either BOSminer or CGMiner)
    • type: gauge
    • labels: no labels
  • temperature{chip_addr, chip_in_domain, voltage_domain, hashboard, location: chip | pcb}

    • every available temperature sensor provides the data. There might be sensors at different locations (pcb or chip)
    • type: gauge
    • labels:
      • chip_addr
      • chip_in_domain
      • voltage_domain
      • hashboard: rank of the hashboard
      • location: chip | pcb
  • fan_rpm_feedback{idx}

    • RPM of individual fans
    • type: gauge
    • labels:
      • idx: ID of the fan
  • client_status{connection_type, host, protocol, user, worker}

    • status of the client:
      • 1: alive pool with the highest priority (pool rank no 1)
      • 0: alive pool with not the highest priority (pool rank > 1)
      • -1: dead pool
    • type: gauge
    • labels:
      • connection_type: type of the connection, which could be either user or dev-fee
      • host: URL of the host, usually URL of the pool or proxy
      • protocol mining protocol
      • user: usually mining pool username of the client
      • worker: name of the worker
  • stratum_accepted_submits_counter{host, user, worker, protocol, connection_type}

    • total number of submits accepted by target. For one instance, there are typically more targets, represented by the host label.
    • type: gauge
    • labels:
      • connection_type: type of the connection, which could be either user or dev-fee
      • host: URL of the host, usually URL of the pool or proxy
      • protocol: mining protocol
      • user: usually mining pool username of the client
      • worker: name of the worker
  • stratum_rejected_submits_counter{host, user, worker, protocol, connection_type}

    • total number of submits rejected by target
    • type: gauge
    • labels:
      • connection_type: type of the connection, which could be either user or dev-fee
      • host: URL of the host, usually URL of the pool or proxy
      • protocol: mining protocol
      • user: usually mining pool username of the client
      • worker: name of the worker

Braiins OS Metrics

Starting with Braiins OS 22.02.2, each miner is producing statistics on <miner-ip-address>:8081/metrics in a form that can be easily digested by Prometheus. Braiins OS exposes significantly more statistics than Stock FW. List of the exposed metrics is as follows:

  • up

    • gauge representing successful (1) and unsuccessful (0) scrape of the instance
    • type: gauge
  • application_version_details{version_full, toolchain}

    • version of the application which is producing time series
    • type: gauge
    • labels:
      • version_full: version of the application
      • toolchain
  • client_status{connection_type, host, protocol, user, worker}

    • status of the client: (stopped = 0, running = 1 , failed = -1)
    • type: gauge
    • labels:
      • connection_type: type of the connection, which could be either user or dev-fee
      • host: URL of the host, usually URL of the pool or proxy
      • protocol: mining protocol
      • user: usually mining pool username of the client
      • worker: name of the worker
  • fan_speed_control

    • speed of the fans (0 minimum, 100 maximum)
    • type: gauge
    • labels: no labels
  • fan_rpm_feedback{idx}

    • RPM of individual fans
    • type: gauge
    • labels:
      • idx: ID of the fan
  • hashboard_nominal_hashrate_ghs{ihashboard}

    • nominal hashrate for each hashboard in Gh/s.
    • type: gauge
    • labels:
      • hashboard: rank of the hashboard
  • hashboard_shares{hashboard, type: valid | invalid | duplicate}

    • number of valid shares produced by hashboards. Hashboard shares can be used to calculate real hashrate for hashboard, miner, or other groups. This metric does not provide information whether shares were accepted by target - stratum_accepted_shares_counter should be used for this.
    • type: counter
    • labels:
      • hashboard: rank of the hashboard
      • type: type of the shares with respect to its validity, valid - valid shares, invalid - invalid shares, duplicate - duplicated shares
  • miner_metadata{device_id, model, os_version}

    • basic information about the miner
    • type: gauge
    • labels:
      • device_id: BOS ID of the device
      • model: model of the miner
      • os_version: version of the firmware
  • miner_power {type: wall | estimate | limit, socket}

    • information about power
    • type: gauge
    • labels:
      • type: 3 types, estimate - estimated power, limit - power limit, wall - measured power)
      • socket
  • miner_power_target_w{active, type: configured | current}

    • metric which represents configured and current power target
    • type: gauge
    • labels:
      • active: 1 - active, 0 - inactive
      • type: configured - configured power target, current - estimated power consumption
  • temperature {chip_addr, chip_in_domain, voltage_domain, hashboard, location: chip | pcb}

    • every available temperature sensor provides the data. There might be sensors at different locations (pcb or chip)
    • type: gauge
    • labels:
      • chip_addr
      • chip_in_domain
      • voltage_domain
      • hashboard: rank of the hashboard
      • location: chip | pcb
  • stratum_accepted_shares_counter {host, user, worker, protocol, connection_type}

    • total number of shares accepted by target. For one instance, there are typically more targets, represented by the host label.
    • type: gauge
    • labels:
      • connection_type: type of the connection, which could be either user or dev-fee
      • host: URL of the host, usually URL of the pool or proxy
      • protocol: mining protocol
      • user: usually mining pool username of the client
      • worker: name of the worker
  • stratum_rejected_shares_counter {host, user, worker, protocol, connection_type}

    • total number of shares rejected by target
    • type: gauge
    • labels:
      • connection_type: type of the connection, which could be either user or dev-fee
      • host: URL of the host, usually URL of the pool or proxy
      • protocol: mining protocol
      • user: usually mining pool username of the client
      • worker: name of the worker
  • stratum_accepted_submits_counter {host, user, worker, protocol, connection_type}

    • total number of submits accepted by target. For one instance, there are typically more targets, represented by the host label.
    • type: gauge
    • labels:
      • connection_type: type of the connection, which could be either user or dev-fee
      • host: URL of the host, usually URL of the pool or proxy
      • protocol: mining protocol
      • user: usually mining pool username of the client
      • worker: name of the worker
  • stratum_rejected_submits_counter {host, user, worker, protocol, connection_type}

    • total number of submits rejected by target
    • type: gauge
    • labels:
      • connection_type: type of the connection, which could be either user or dev-fee
      • host: URL of the host, usually URL of the pool or proxy
      • protocol: mining protocol
      • user: usually mining pool username of the client
      • worker: name of the worker
  • tuner_stage {hashboard}

    • information: if the tuner is tuning (values 2 or 3) or if it is in the stable phase (other values)
    • type: gauge
    • labels:
      • hashboard: rank of the hashboard

Was this helpful?