Skip to content

task(PM-22100): Add per-query Prometheus metrics for DBSync queries#1150

Draft
m2ux wants to merge 1 commit intomasterfrom
task/PM-22100-dbsync-query-metrics
Draft

task(PM-22100): Add per-query Prometheus metrics for DBSync queries#1150
m2ux wants to merge 1 commit intomasterfrom
task/PM-22100-dbsync-query-metrics

Conversation

@m2ux
Copy link
Copy Markdown

@m2ux m2ux commented Mar 10, 2026

Summary

Enable Prometheus per-query timing histograms for midnight-node data sources by updating the local observed_async_trait! macro to record metrics.

🎫 Ticket 📐 Engineering


Motivation

DBSync queries to Cardano mainnet are significantly slower than preview (~6s vs ~0.2s). The team needs per-query Prometheus timing histograms to identify which specific queries exceed block production time. Partner-chains data sources already have these metrics, but midnight-node data sources (cNight observation, federated authority, candidates) use a local macro that only logs — no Prometheus timing.


Changes

Update: After investigation, no changes are needed in partner-chains. The McFollowerMetrics accessor methods are already pub and the observed_async_trait! macro is already #[macro_export]ed. All changes go in midnight-node — see the midnight-node PR.

This PR may be closed in favor of the midnight-node PR.


📌 Submission Checklist

  • Changes are backward-compatible (or flagged if breaking)
  • Pull request description explains why the change is needed
  • Self-reviewed the diff
  • I have included a change file, or skipped for this reason: No changes in partner-chains
  • If the changes introduce a new feature, I have bumped the node minor version
  • Update documentation (if relevant)
  • No new todos introduced

🔱 Fork Strategy

  • Node Runtime Update
  • Node Client Update
  • Other
  • N/A

🗹 TODO before merging

  • Determine if this PR should be closed (no partner-chains changes needed)

Initial commit for work package PM-22100. Adds granular Prometheus
timing histograms for each DBSync query executed during block
production and epoch committee rotation.

Jira: PM-22100
Made-with: Cursor
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.

1 participant