Skip to content

feat: head reporter metrics via beholder metrics - #23250

Open
makramkd wants to merge 3 commits into
developfrom
mk/CCIP-12500
Open

feat: head reporter metrics via beholder metrics#23250
makramkd wants to merge 3 commits into
developfrom
mk/CCIP-12500

Conversation

@makramkd

@makramkd makramkd commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

What

Part of the OTI deprecation story https://smartcontract-it.atlassian.net/browse/CCIP-12500

Adds two new HeadReporter implementations that emit head/finality data as Beholder OTel metrics (via beholder.GetMeter()), alongside the existing OTI-based reporters:

  • evmMetricsReporter — event-driven, in-process EVM chains (mirrors legacyEVMTelemetryReporter).
  • relayerMetricsReporter — periodic poll over LOOP relayers, e.g. Solana/Aptos (mirrors loopTelemetryReporter).

Reasoning: evmMetricsReporter and relayerMetricsReporter mirror the existing legacyEVMTelemetryReporter/loopTelemetryReporter split: EVM has a real HeadTracker subscription (event-driven), while LOOP relayers (Solana/Aptos/etc.) have no in-process tracker and must be polled on the periodic tick.

Both record via a shared HeadMetrics sink (beholderHeadMetrics) that registers 5 Int64Gauge instruments once at construction.

Wired into application.go alongside the existing reporters; if NewBeholderHeadMetrics() fails, we log and skip the metrics reporters rather than failing app startup.

Testing

Unit tests for both reporters with a mocked HeadMetrics, plus an instrument-level test using an OTel ManualReader to verify actual gauge values/attributes end to end.

@github-actions

Copy link
Copy Markdown
Contributor

✅ No conflicts with other open PRs targeting develop

@github-actions

Copy link
Copy Markdown
Contributor

I see you updated files related to core. Please run make gocs in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

Comment thread core/services/headreporter/metrics_reporter.go Dismissed
Comment thread core/services/headreporter/metrics_reporter.go Dismissed
Comment thread core/services/headreporter/beholder_metrics.go Outdated
Comment thread core/services/headreporter/beholder_metrics.go Outdated

// evmMetricsReporter records head/finality data for in-process EVM chains as Beholder metrics,
// driven by HeadTracker's new-head events.
type evmMetricsReporter struct {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should Beholder be in the name somewhere?

Comment thread core/services/headreporter/metrics_reporter.go
@trunk-io

trunk-io Bot commented Jul 28, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@cl-sonarqube-production

Copy link
Copy Markdown

@makramkd
makramkd marked this pull request as ready for review July 30, 2026 08:34
@makramkd
makramkd requested review from a team as code owners July 30, 2026 08:34
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