Skip to content

pkg/beholder: bridge prometheus metrics through otel#2053

Merged
jmank88 merged 1 commit into
mainfrom
bridge-prom
May 22, 2026
Merged

pkg/beholder: bridge prometheus metrics through otel#2053
jmank88 merged 1 commit into
mainfrom
bridge-prom

Conversation

@jmank88
Copy link
Copy Markdown
Contributor

@jmank88 jmank88 commented May 13, 2026

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 13, 2026

✅ API Diff Results - github.com/smartcontractkit/chainlink-common

✅ Compatible Changes (5)

package github (1)
  • com/smartcontractkit/chainlink-common/pkg/sqlutil/promutil — ➕ Added
pkg/beholder.Config (1)
  • MetricProducers — ➕ Added
pkg/beholder.writerClientConfig (1)
  • MetricProducers — ➕ Added
pkg/loop.EnvConfig (2)
  • TelemetryPrometheusBridgeEnabled — ➕ Added

  • TelemetryPrometheusBridgePrefixes — ➕ Added


📄 View full apidiff report

pavel-raykov
pavel-raykov previously approved these changes May 14, 2026
@jmank88 jmank88 requested a review from ogtownsend May 18, 2026 15:38
@jmank88 jmank88 force-pushed the bridge-prom branch 2 times, most recently from b82f4d0 to 33f3121 Compare May 18, 2026 16:39
ogtownsend
ogtownsend previously approved these changes May 19, 2026
Comment thread pkg/loop/server.go Outdated
Comment thread pkg/beholder/client.go Outdated
Comment thread pkg/loop/server.go Outdated
Comment thread pkg/beholder/config.go Outdated
@jmank88 jmank88 force-pushed the bridge-prom branch 2 times, most recently from e003dc7 to e4b7a40 Compare May 20, 2026 22:11
@jmank88 jmank88 marked this pull request as ready for review May 21, 2026 11:53
@jmank88 jmank88 requested review from a team as code owners May 21, 2026 11:53
pkcll
pkcll previously approved these changes May 21, 2026
pavel-raykov
pavel-raykov previously approved these changes May 22, 2026
@jmank88 jmank88 added this pull request to the merge queue May 22, 2026
@jmank88 jmank88 removed this pull request from the merge queue due to a manual request May 22, 2026
@jmank88
Copy link
Copy Markdown
Contributor Author

jmank88 commented May 22, 2026

Removed comment and fixed condition - please re-ack

@jmank88 jmank88 requested review from pavel-raykov and pkcll May 22, 2026 14:47
@jmank88 jmank88 enabled auto-merge May 22, 2026 14:48
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 66195c6 Previous: 969150a Ratio
BenchmarkKeystore_Sign/nop/in-process 792.2 ns/op 372.6 ns/op 2.13

This comment was automatically generated by workflow using github-action-benchmark.

pavel-raykov
pavel-raykov previously approved these changes May 22, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds optional support for bridging existing Prometheus metrics into the Beholder/OpenTelemetry metric pipeline (via the OTel Prometheus bridge), controllable through loop server environment configuration.

Changes:

  • Introduces MetricProducers in beholder.Config and wires producers into the OTel PeriodicReader.
  • Adds loop env vars to enable the Prometheus bridge and optionally filter bridged metrics by name prefixes.
  • Adds a small Prometheus gatherer wrapper (PrefixGatherer) and updates Beholder config example to a JSON golden file; updates relevant dependencies.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/sqlutil/promutil/promutil.go New PrefixGatherer to filter Prometheus metric families by prefix.
pkg/loop/server.go Conditionally attaches OTel Prometheus bridge metric producer to Beholder config.
pkg/loop/config.go Adds env config for enabling the bridge and configuring prefix filters.
pkg/loop/config_test.go Extends env parsing/serialization tests for new bridge env vars.
pkg/beholder/config.go Adds MetricProducers to Beholder config API.
pkg/beholder/client.go Applies MetricProducers to the metrics periodic reader (producer support).
pkg/beholder/config_test.go Replaces prior example output with a JSON golden-file test.
pkg/beholder/testdata/config-example.json New JSON golden file representing example Beholder config.
go.mod Adds OTel Prometheus bridge dependency and updates Prometheus/JWT deps.
go.sum Dependency checksum updates for the above.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/loop/config.go
Comment thread pkg/sqlutil/promutil/promutil.go Outdated
Comment thread pkg/sqlutil/promutil/promutil.go Outdated
Comment on lines +16 to +20
func (g *PrefixGatherer) Gather() ([]*dto.MetricFamily, error) {
var ret []*dto.MetricFamily
all, err := g.Gatherer.Gather()
if err != nil {
return nil, err
@jmank88 jmank88 added this pull request to the merge queue May 22, 2026
Merged via the queue into main with commit 6767593 May 22, 2026
31 of 33 checks passed
@jmank88 jmank88 deleted the bridge-prom branch May 22, 2026 20:19
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.

5 participants