metrics

The metrics method returns a snapshot of the current Komodo DeFi Framework API metrics used in Prometheus and Grafana. For more information check out the Komodo DeFi Framework metrics guide

Request Parameters

The metrics method does not take any additional parameters, and does not require authentication with your rpc_password.

Response Parameters

ParameterTypeDescription
metricslist of objectsThere are a variety of metrics returned, with each metrics object havine a type, key, label, and some values which vary by type.

Metrics object

ParameterTypeDescription
typestringA metric type which indicates how it should be displayed in visualisation.
keystringA descriptive name assigned to the metric.
labelsobjectLabels can be used to group similar metrics together or provide additional context.
valuefloatReturned if type is gauge. A numeric value which indicates the magnitude of the metric being measured.
countfloatReturned if type is histogram. How many values were measured.
minfloatReturned if type is histogram. The smallest value measured.
maxfloatReturned if type is histogram. The highest value measured.

📌 Example(s)

Command

POST metrics
{
  "method": "metrics",
  "userpass": "RPC_UserP@SSW0RD"
}
Show Response

Response

{
  "metrics": [
    {
      "type": "counter",
      "key": "tx.history.response.count",
      "labels": {
        "coin": "MARTY",
        "method": "tx_detail_by_hash"
      },
      "value": 25
    },
    {
      "type": "counter",
      "key": "rpc_client.request.count",
      "labels": {
        "client": "electrum",
        "coin": "DOC"
      },
      "value": 1224
    },
    {
      "type": "counter",
      "key": "tx.history.response.count",
      "labels": {
        "method": "tx_detail_by_hash",
        "coin": "DOC"
      },
      "value": 27
    },
    {
      "type": "counter",
      "key": "tx.history.request.count",
      "labels": {
        "coin": "DOC",
        "method": "tx_detail_by_hash"
      },
      "value": 27
    },
    {
      "type": "counter",
      "key": "rpc_client.traffic.in",
      "labels": {
        "client": "electrum",
        "coin": "DOC"
      },
      "value": 823841
    },
    {
      "type": "counter",
      "key": "rpc_client.traffic.out",
      "labels": {
        "coin": "MARTY",
        "client": "electrum"
      },
      "value": 139396
    },
    {
      "type": "counter",
      "key": "tx.history.response.total_length",
      "labels": {
        "client": "electrum",
        "coin": "MARTY",
        "method": "blockchain.scripthash.get_history"
      },
      "value": 1041
    },
    {
      "type": "counter",
      "key": "tx.history.response.count",
      "labels": {
        "client": "electrum",
        "coin": "MARTY",
        "method": "blockchain.scripthash.get_history"
      },
      "value": 11
    },
    {
      "type": "counter",
      "key": "tx.history.response.count",
      "labels": {
        "method": "blockchain.scripthash.get_history",
        "client": "electrum",
        "coin": "DOC"
      },
      "value": 6
    },
    {
      "type": "counter",
      "key": "tx.history.request.count",
      "labels": {
        "coin": "MARTY",
        "method": "tx_detail_by_hash"
      },
      "value": 25
    },
    {
      "type": "counter",
      "key": "rpc_client.response.count",
      "labels": {
        "coin": "DOC",
        "client": "electrum"
      },
      "value": 1351
    },
    {
      "type": "counter",
      "key": "rpc_client.request.count",
      "labels": {
        "client": "electrum",
        "coin": "MARTY"
      },
      "value": 1237
    },
    {
      "type": "counter",
      "key": "rpc_client.traffic.in",
      "labels": {
        "client": "electrum",
        "coin": "MARTY"
      },
      "value": 772964
    },
    {
      "type": "counter",
      "key": "tx.history.response.total_length",
      "labels": {
        "coin": "DOC",
        "client": "electrum",
        "method": "blockchain.scripthash.get_history"
      },
      "value": 767
    },
    {
      "type": "counter",
      "key": "tx.history.request.count",
      "labels": {
        "coin": "DOC",
        "client": "electrum",
        "method": "blockchain.scripthash.get_history"
      },
      "value": 6
    },
    {
      "type": "counter",
      "key": "rpc_client.traffic.out",
      "labels": {
        "coin": "DOC",
        "client": "electrum"
      },
      "value": 136368
    },
    {
      "type": "counter",
      "key": "tx.history.request.count",
      "labels": {
        "coin": "MARTY",
        "client": "electrum",
        "method": "blockchain.scripthash.get_history"
      },
      "value": 11
    },
    {
      "type": "counter",
      "key": "rpc_client.response.count",
      "labels": {
        "client": "electrum",
        "coin": "MARTY"
      },
      "value": 1361
    },
    {
      "type": "gauge",
      "key": "p2p.connected_peers.count",
      "labels": {},
      "value": 8.0
    },
    {
      "type": "gauge",
      "key": "p2p.received_messages.count",
      "labels": {},
      "value": 24.0
    },
    {
      "type": "gauge",
      "key": "p2p.connected_relays.len",
      "labels": {},
      "value": 8.0
    },
    {
      "type": "gauge",
      "key": "p2p.relay_mesh.len",
      "labels": {},
      "value": 2.0
    },
    {
      "type": "gauge",
      "key": "orderbook.memory_db",
      "labels": {},
      "value": 297800390224.0
    },
    {
      "type": "gauge",
      "key": "orderbook.len",
      "labels": {},
      "value": 15.0
    },
    {
      "type": "gauge",
      "key": "p2p.received_messages.period_in_secs",
      "labels": {},
      "value": 60.0
    },
    {
      "type": "histogram",
      "key": "peer.outgoing_request.timing",
      "labels": {
        "peer": "12D3KooWJDoV9vJdy6PnzwVETZ3fWGMhV41VhSbocR1h2geFqq9Y"
      },
      "count": 2.0,
      "max": 0.801318629,
      "min": 0.699428848
    }
  ]
}