#influx-db #metrics #ckb #data-source #networking #analyzer #dashboard

app ckb-analyzer

ckb-analyzer analyzes kinds of data sources and upload the results into InfluxDB

2 unstable releases

0.39.2 Jan 25, 2021
0.37.0 Nov 21, 2020

#54 in #influx-db

MIT license

86KB
1.5K SLoC

ckb-analyzer

ckb-analyzer is an agent for collecting metrics from ckb, then writing the processed metrics info InfluxDB. We can visualize these metrics on Grafana or other visualization tools.

ckb-analyzer is still working in progress rapidly.

Install

Download from releases or

cargo install ckb-analyzer

Usage

ckb-analyzer reads several environment variables:

  • CKB_ANALYZER_CONFIG specify the configuration file path
  • CKB_RPC_USERNAME specify the authorization username to ckb rpc service, default is ""
  • CKB_RPC_PASSWORD specify the authorization password to ckb rpc service, default is ""
  • INFLUXDB_USERNAME specify the influxdb username, default is ""
  • INFLUXDB_PASSWORD specify the influxdb password, default is ""

Command example:

CKB_ANALYZER_CONFIG=config/test.toml ckb-analyzer

Topics and measurements

  • canonical chain

    • block committed transactions and proposed transactions
    • transactions per seconds
    • block time interval
    • epoch uncles count and uncles rate
    • epoch duration and length
    • epoch adjustment
  • network distribution

    • tip distribution accross the network
    • version distribution accross the network
  • canonical chain reorganization

    • traffic
    • scale
  • node's canonical chain growth

  • node's uncle blocks (some may not be included in canonical chain uncles)

    • traffic
  • miner

    • the miner node of a specified block (ip or lock args)
  • transaction transition (mainly focus the transaction traffic and state transition latency)

    • pending
    • pending too long
    • propose
    • propose too long
    • commit
    • remove (with reason, reject, conflict, and so forth)
    • reorganize
  • node's tx-pool state

    • pending/proposed pool size/cycles
  • processed cost (via ckb internal metrics service)

    • verify block
    • verify transaction
  • transaction and block propagation across the network

    • the number of connected peers
    • propagation elapsed
    • high latency propagation
  • logged events

    • error and warning events
    • sufficient events, recognize via regex patterning; better structure these logs

Debug suites

  • persist recent transactions (debug suite)

  • reproduce context

Monitoring alerts

  • datasource issues

    • no update for a long time
  • network fork, there are nodes with different block hash on the same block number

  • miner issues

    • chain does not grow up for too long
    • node receives too many uncle blocks
  • chain growth issues

    • block time interval is shorter/longer then threshold
    • a big epoch adjustment
  • transaction transition issues

    • too many transactions at a certain state
  • logged issues

Dashboards

Please reference our Grafana dashboard files at dashboards

FAQ

  • ckb itself exposes metrics. Then why create ckb-analyzer?

    Some metrics are not convenient to expose from ckb, like historical chain metrics and complex analyzing tasks. With ckb-analyzer, we can display historical chain information by extracting the historical blocks and do some complexity tasks outside ckb, which prevent adding too much complexity into ckb.

  • Why use InfluxDB?

    Pushing metrics actively via HTTP to InfluxDB is much useful!

License: MIT

Dependencies

~91MB
~1.5M SLoC