Skip to content

Conversation

@ndr-ds
Copy link
Contributor

@ndr-ds ndr-ds commented Dec 11, 2025

Motivation

Several metrics improvements were needed:

  • Chain worker request queue wait time wasn't being tracked
  • Views metering needed updates

Proposal

  • Add chain_worker_request_queue_wait_time histogram metric
  • Update views metering implementation
  • Adjust bucket ranges for better granularity

Test Plan

  • Deploy and verify new metrics are emitted
  • Check Grafana dashboards show the metrics
  • Verify metric values are reasonable

Release Plan

  • Nothing to do / These changes follow the usual release cycle.

@ndr-ds ndr-ds force-pushed the 11-28-several_metrics_changes branch from 58b94ab to 8b41b5a Compare December 15, 2025 22:00
@ndr-ds ndr-ds force-pushed the 11-28-several_metrics_changes branch from 8b41b5a to bb38573 Compare January 7, 2026 18:42
@ndr-ds ndr-ds changed the base branch from 12-01-rocksdb_config_tuning to graphite-base/5123 January 7, 2026 22:26
@ndr-ds ndr-ds force-pushed the 11-28-several_metrics_changes branch from bb38573 to 26e0c2b Compare January 7, 2026 22:26
@ndr-ds ndr-ds force-pushed the graphite-base/5123 branch from 8680174 to 241959f Compare January 7, 2026 22:26
@ndr-ds ndr-ds changed the base branch from graphite-base/5123 to 11-28-make_notification_and_cross_chain_queue_sizes_grow_with_network_size January 7, 2026 22:27
@ndr-ds ndr-ds marked this pull request as ready for review January 7, 2026 22:31
@ndr-ds ndr-ds force-pushed the 11-28-several_metrics_changes branch from 26e0c2b to c0eced0 Compare January 7, 2026 22:43
@ndr-ds ndr-ds force-pushed the 11-28-several_metrics_changes branch from c0eced0 to 73b4c94 Compare January 8, 2026 01:13
// Put back the sender in the cache for next time.
chain_workers.insert(chain_id, sender);
#[cfg(with_metrics)]
metrics::CHAIN_WORKER_ENDPOINTS_CACHED.set(chain_workers.len() as i64);
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this decrement properly as chain workers are removed from the cache? i.e. is this the only place where workers are being evicted? Or can they be also dropped elsewhere (and we'd get outdated values in metrics).

)
});

/// Number of cached chain worker channel endpoints in the BTreeMap.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// Number of cached chain worker channel endpoints in the BTreeMap.
/// Number of cached chain worker channel endpoints in the `BTreeMap`.

(or: "in the map"?)

) -> Result<(ChainInfoResponse, NetworkActions), WorkerError> {
trace!("{} <-- {:?}", self.nickname, certificate);
#[cfg(with_metrics)]
let metrics_data = (
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's introduce a struct MetricsData for that, and make this line just:

let metrics_data = MetricsData::new(&certificate);

#[cfg(with_metrics)]
{
if matches!(_outcome, BlockOutcome::Processed) {
let (
Copy link
Contributor

Choose a reason for hiding this comment

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

…then we could just call something like metrics_data.record() here. (Or log? gather? update?)

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.

4 participants