Repository navigation
feat(metrics): send metrics as OTLP with METRICS_PROTOCOL=otlp - #425
Open
PrashantBtkl wants to merge 1 commit into
Open
PrashantBtkl wants to merge 1 commit into
PrashantBtkl wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for sending metrics via the OTLP/HTTP protocol as an alternative to Prometheus remote write, introducing a new --metrics-protocol configuration option, OTLP encoding logic, and separate spool directories to prevent payload conflicts. The review feedback suggests optimizing performance by reusing gzip.Writer instances via a sync.Pool during OTLP encoding, and adding a helper function to extract response body summaries for improved error reporting.
Opt-in; Prometheus remote write stays the default. Metric names and the job and instance labels match remote write, so existing queries keep working. Reuses the on-disk spool, with a separate directory per protocol. Part of nudgebee/nudgebee-enterprise#41490
PrashantBtkl
force-pushed
the
feat/nb-41490-otlp-metrics
branch
from
November 27, 2026 06:25
61261ce to
1035fb3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Metrics could only be pushed as Prometheus remote write, while traces and logs already use OTLP.
METRICS_PROTOCOL=otlpnow sends metrics as OTLP/HTTP too. Remote write stays the default.Metric names,
jobandinstancematch remote write. To get that, names carry no unit, counters without a_totalsuffix go as gauges, and no instrumentation scope orservice.versionis sent (VictoriaMetrics turns both into labels, which would start new series on every upgrade).Worth a look
service.nameandservice.instance.idlabels, so switching an existing host starts new series there.Linked issue / context
Part of nudgebee/nudgebee-enterprise#41490
How was this tested?
Run with
METRICS_PROTOCOL=otlpagainsthttp://<prometheus>:9090/api/v1/otlp/v1/metrics(--web.enable-otlp-receiver);up{job="nudgebee-node-agent"}should return the host.go test ./...andgo vet ./...pass.service.*labels.Checklist
## [Unreleased]