|
| 1 | +Metrics Changelog |
| 2 | +================= |
| 3 | + |
| 4 | +This file tracks Prometheus metric additions, changes, and removals in |
| 5 | +java-tron. For the full set of metrics emitted today, see the references at |
| 6 | +the bottom. |
| 7 | + |
| 8 | +**4.8.2** |
| 9 | + |
| 10 | +### New Metrics |
| 11 | + |
| 12 | +#### Core |
| 13 | + |
| 14 | +- `tron:block_transaction_count` (Histogram, label `miner_address`) — |
| 15 | + per-block transaction count, sampled at the entry of `Manager#pushBlock` |
| 16 | + before any early return so duplicate, stale, and fork-switched pushes are |
| 17 | + observed alongside applied blocks. Primary use cases: empty-block detection |
| 18 | + per super representative, and per-SR throughput observation. Default |
| 19 | + buckets: `[0, 1, 10, 50, 100, 200, 500, 1000, 2000, 5000]`. |
| 20 | + ([#6624](https://github.com/tronprotocol/java-tron/pull/6624)) |
| 21 | + |
| 22 | +#### Consensus |
| 23 | + |
| 24 | +- `tron:sr_set_change` (Counter, labels `witness`, `event`) — incremented |
| 25 | + once per witness whenever the active SR set rotates at a maintenance |
| 26 | + boundary. `event` is one of `added` / `removed`. Cardinality grows with |
| 27 | + the number of distinct witnesses that have ever entered or left the active |
| 28 | + set, not with the active set size at any given moment. |
| 29 | + ([#6624](https://github.com/tronprotocol/java-tron/pull/6624)) |
| 30 | + |
| 31 | +**Pre-4.8.2 Baseline** |
| 32 | + |
| 33 | +Snapshot of metrics emitted prior to this changelog. Per-version provenance |
| 34 | +is not tracked here; consult `git log` on |
| 35 | +[`common/src/main/java/org/tron/common/prometheus/`](common/src/main/java/org/tron/common/prometheus/) |
| 36 | +for exact origin of each metric. |
| 37 | + |
| 38 | +### Existing Metrics |
| 39 | + |
| 40 | +#### Core (block / transaction processing) |
| 41 | + |
| 42 | +- `tron:header_height` (Gauge) — latest block height on this node. |
| 43 | +- `tron:header_time` (Gauge) — latest block timestamp on this node. |
| 44 | +- `tron:block_push_latency_seconds` (Histogram) — `Manager#pushBlock` latency. |
| 45 | +- `tron:block_process_latency_seconds` (Histogram, label `sync`) — |
| 46 | + `TronNetDelegate#processBlock` latency. |
| 47 | +- `tron:block_generate_latency_seconds` (Histogram, label `address`) — |
| 48 | + block generation latency per producer. |
| 49 | +- `tron:block_fetch_latency_seconds` (Histogram) — block fetch latency. |
| 50 | +- `tron:block_receive_delay_seconds` (Histogram) — `receiveTime - blockTime`. |
| 51 | +- `tron:block_fork` (Counter, label `type`) — fork events by type. |
| 52 | +- `tron:lock_acquire_latency_seconds` (Histogram, label `type`) — DB / chain |
| 53 | + lock acquisition latency. |
| 54 | +- `tron:miner` (Counter, labels `miner`, `type`) — blocks produced by an SR. |
| 55 | +- `tron:miner_latency_seconds` (Histogram, label `miner`) — block mining |
| 56 | + latency per producer. |
| 57 | +- `tron:miner_delay_seconds` (Histogram, label `miner`) — `actualTime - |
| 58 | + planTime` for block production. |
| 59 | +- `tron:txs` (Counter, labels `type`, `detail`) — transaction counts. |
| 60 | +- `tron:process_transaction_latency_seconds` (Histogram, labels `type`, |
| 61 | + `contract`) — transaction processing latency. |
| 62 | +- `tron:verify_sign_latency_seconds` (Histogram, label `type`) — |
| 63 | + signature verification latency for transactions and blocks. |
| 64 | +- `tron:tx_cache` (Gauge, label `type`) — transaction cache stats. |
| 65 | +- `tron:manager_queue_size` (Gauge, label `type`) — `Manager` queue sizes |
| 66 | + (pending / popped / queued / repush). |
| 67 | + |
| 68 | +#### Net (P2P) |
| 69 | + |
| 70 | +- `tron:peers` (Gauge, label `type`) — peer counts. |
| 71 | +- `tron:p2p_error` (Counter, label `type`) — P2P error events. |
| 72 | +- `tron:p2p_disconnect` (Counter, label `type`) — P2P disconnect events. |
| 73 | +- `tron:ping_pong_latency_seconds` (Histogram) — peer ping-pong RTT. |
| 74 | +- `tron:message_process_latency_seconds` (Histogram, label `type`) — peer |
| 75 | + message processing latency. |
| 76 | +- `tron:tcp_bytes` (Histogram, label `type`) — TCP traffic. |
| 77 | +- `tron:udp_bytes` (Histogram, label `type`) — UDP traffic. |
| 78 | + |
| 79 | +#### API |
| 80 | + |
| 81 | +- `tron:http_service_latency_seconds` (Histogram, label `url`) — HTTP |
| 82 | + endpoint latency. |
| 83 | +- `tron:http_bytes` (Histogram, labels `url`, `status`) — HTTP traffic. |
| 84 | +- `tron:grpc_service_latency_seconds` (Histogram, label `endpoint`) — gRPC |
| 85 | + endpoint latency. |
| 86 | +- `tron:jsonrpc_service_latency_seconds` (Histogram, label `method`) — |
| 87 | + JSON-RPC method latency. |
| 88 | +- `tron:internal_service_latency_seconds` (Histogram, labels `class`, |
| 89 | + `method`) — internal service-call latency. |
| 90 | +- `tron:internal_service_fail` (Counter, labels `class`, `method`) — |
| 91 | + internal service-call failure count. |
| 92 | + |
| 93 | +#### DB |
| 94 | + |
| 95 | +- `tron:db_size_bytes` (Gauge, labels `type`, `db`, `level`) — LevelDB |
| 96 | + storage size. |
| 97 | +- `tron:db_sst_level` (Gauge, labels `type`, `db`, `level`) — LevelDB SST |
| 98 | + files per compaction level. |
| 99 | +- `tron:guava_cache_hit_rate`, `tron:guava_cache_request`, |
| 100 | + `tron:guava_cache_eviction_count` — Guava cache stats, registered via |
| 101 | + `GuavaCacheExports` for caches that opt in. |
| 102 | + |
| 103 | +#### System |
| 104 | + |
| 105 | +Emitted by `OperatingSystemExports` (no labels): |
| 106 | + |
| 107 | +- `system_available_cpus`, `system_cpu_load`, `system_load_average`, |
| 108 | + `system_total_physical_memory_bytes`, `system_free_physical_memory_bytes`, |
| 109 | + `system_total_swap_spaces_bytes`, `system_free_swap_spaces_bytes`. |
| 110 | + |
| 111 | +#### JVM / process |
| 112 | + |
| 113 | +Auto-emitted by the Prometheus client library via `DefaultExports.initialize()` |
| 114 | +(`simpleclient_hotspot`). The full list is owned by the upstream library and |
| 115 | +not enumerated here; see the |
| 116 | +[client_java](https://github.com/prometheus/client_java) docs. Common ones: |
| 117 | +`jvm_memory_bytes_*`, `jvm_gc_collection_seconds_*`, `jvm_threads_*`, |
| 118 | +`process_cpu_seconds_total`, `process_open_fds`, `process_resident_memory_bytes`. |
| 119 | + |
| 120 | +--- |
| 121 | + |
| 122 | +**References** |
| 123 | + |
| 124 | +- [Official metrics documentation](https://tronprotocol.github.io/documentation-en/using_javatron/metrics/) |
| 125 | + — descriptions, configuration, and example queries. |
| 126 | +- [tron-docker `metric_monitor/README.md`](https://github.com/tronprotocol/tron-docker/blob/main/metric_monitor/README.md) |
| 127 | + — operator-oriented overview with deployment guidance. |
| 128 | +- [java-tron-server (Grafana dashboard 16567)](https://grafana.com/grafana/dashboards/16567-java-tron-server/) |
| 129 | + — reference dashboard template. |
0 commit comments