Skip to content

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

Open
warku123 wants to merge 5 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 5 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.
@bladehan1
Copy link
Copy Markdown
Contributor

Is the total number of panels too high for typical users?

Could the panel effects be made more intuitive with textures?

@warku123 warku123 requested a review from Sunny6889 May 29, 2026 03:38
…ast empty block stat

- Replace Empty Block Rate panel with P95/P99 Block Transaction Count
- Add Last Empty Block stat panel showing timestamp and witness
- Make Last Empty Block full-width for better layout
- Rename row title from "SR Set Change" to "SR Set"
@warku123
Copy link
Copy Markdown
Author

warku123 commented May 29, 2026

Hi @bladehan1, thanks for the review! We've refactored the layout in the latest commit to address both concerns:

Panel count

  • Instead of adding a separate "Block Metrics" row (4 panels as originally drafted), we merged the new block-related panels into the existing Block row:
    • Replaced the original Empty Block Rate with P95 / P99 Block Transaction Count (single panel, two quantile lines)
    • Added Last Empty Block as a full-width stat panel (timestamp + witness in plain text)
    • Kept Avg Transactions per Block
  • The SR Set row stays at 2 panels and is collapsible.
  • Net change: +3 panels instead of +6, integrated into existing rows rather than adding new ones.

Intuitiveness

  • Last Empty Block uses a stat panel — no need to read graphs; the exact timestamp and witness address are displayed directly.
  • P95/P99 share one panel with color-coded lines.

Here is the dashboard's snapshot for reference:
截屏2026-05-29 16 18 28

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.

3 participants