Skip to content

Commit 7416f46

Browse files
committed
docs(metrics): introduce METRICS_CHANGELOG.md
Add a single discovery point for Prometheus metric additions, changes, and removals so node operators and dashboard maintainers do not need to scan individual pull requests. Sectioning mirrors java-tron GitHub Releases (Notice / New Features / ... grouped by module) for consistency with the rest of the repository. The 4.8.2 section records the two metrics introduced in tronprotocol#6624 (`tron:block_transaction_count`, `tron:sr_set_change`) and a Pre-4.8.2 baseline snapshot of all metrics emitted prior to this file, so the document doubles as a quick reference catalog. Per-version provenance for baseline entries is not tracked; the file points at git log on common/src/main/java/org/tron/common/prometheus/ for that.
1 parent 22e0aa3 commit 7416f46

1 file changed

Lines changed: 85 additions & 0 deletions

File tree

METRICS_CHANGELOG.md

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

0 commit comments

Comments
 (0)