Skip to content

feat(dashboard): add block transaction count and SR set change panels#118

Open
warku123 wants to merge 4 commits into
tronprotocol:developfrom
warku123:feat/dashboard-new-metrics
Open

feat(dashboard): add block transaction count and SR set change panels#118
warku123 wants to merge 4 commits into
tronprotocol:developfrom
warku123:feat/dashboard-new-metrics

Conversation

@warku123
Copy link
Copy Markdown

What does this PR do?

Add two new panel sections to the java-tron-server Grafana dashboard template to visualize the metrics introduced in tronprotocol/java-tron#6624:

  1. Block Metrics row (4 panels):

    • Empty Block Rate — ratio of empty blocks over total blocks (timeseries)
    • Per-SR Empty Block Count (1h) — empty blocks per SR in the last hour (barchart)
    • Avg Transactions per Block — average transaction count per block (timeseries)
    • Block Transaction Count Distribution — non-cumulative histogram bucket breakdown as stacked bars (timeseries)
  2. SR Set Change row (2 panels):

    • SR Set Change Events — table of add/remove events with color-coded action labels
    • SR Set Change Total — cumulative stat for SR additions and removals with threshold coloring

Why are these changes required?

tronprotocol/java-tron#6624 introduces tron:block_transaction_count (histogram) and tron:sr_set_change (counter) metrics. This PR updates the official Grafana dashboard template so node operators can import and use the new panels directly, reducing onboarding effort as suggested in this comment.

This PR has been tested by:

  • Manual Testing (2-node private net with Prometheus + Grafana)

Follow up

Extra details

  • New panels are inserted as collapsed rows between "Block" and "Net" sections
  • All PromQL queries follow the existing dashboard conventions ($group, $instance, backtick syntax, $__interval)
  • No changes to existing panels; safe to merge independently (panels show "No data" until java-tron metrics are available)

Add two new panel sections to the java-tron-server Grafana dashboard
to support metrics from tronprotocol/java-tron#6624:

- Block Metrics: empty block rate, per-SR empty block count,
  avg transactions per block, transaction count distribution
- SR Set Change: event table and cumulative totals by action
Add descriptions for the new metrics under "Blockchain status" and
"Block status" sections so node operators can discover and use them.
@warku123 warku123 force-pushed the feat/dashboard-new-metrics branch from 167304e to 7096913 Compare April 28, 2026 07:36
Comment thread metric_monitor/README.md Outdated
- `tron:verify_sign_latency_seconds_count`: Count of events
- `tron:verify_sign_latency_seconds_sum`: Total sum of all observed values

Histogram of transaction count per block, with buckets `[0, 10, 50, 100, 200, 500, 1000, 2000, 5000, 10000]`. Empty blocks can be queried via the `le="0.0"` bucket; the distribution buckets enable transaction volume analysis (P50/P99, large-block ratio, etc.):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the default buckets to align with java-tron latest metrics

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in ad334cb — bucket array updated to match the refined values in tronprotocol/java-tron#6730. Also note the dashboard panel was already realigned to the new boundaries in f9325c7 earlier in this PR.

warku123 added 2 commits May 6, 2026 11:49
The block_transaction_count histogram buckets in java-tron are being
refined to [0, 20, 50, 80, 100, 120, 140, 160, 180, 200, 230, 260,
300, 500, 2000] (tronprotocol/java-tron#6730), densifying the 0-300
range for percentile interpolation in the typical per-SR TPS range.

Update the Block Transaction Count Distribution panel to match: the
old le="10.0" and le="1000.0" boundaries no longer exist in the
refined array, so those queries would return nothing. Adopt 9 legend
buckets aligned to the new boundaries (0, 1-20, 21-50, 51-100,
101-200, 201-300, 301-500, 501-2000, 2000+) so the panel makes use
of the added 0-300 resolution.
Update the documented bucket array for tron:block_transaction_count
to match the refined buckets in tronprotocol/java-tron#6730:
[0, 20, 50, 80, 100, 120, 140, 160, 180, 200, 230, 260, 300, 500,
2000]. Per @Sunny6889's review on this PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants