[nr-k8s-otel-collector] make collector observability resource attributes configurable#2133
Open
achang209 wants to merge 2 commits intonewrelic:masterfrom
Open
Conversation
|
|
Author
|
@dbudziwojskiNR @Philip-R-Beckwith would love feedback on this at your earliest convenience. Thanks! |
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 / why we need it:
Exposes
service::telemetry::resourceas a configurable Helm value undercollectorObservability.resource, allowing users to enrich internalotelcol_*metrics with custom resource attributes.Without this, internal collector metrics arrive in New Relic with no cluster or environment context, making it impossible to distinguish which cluster or environment a collector's internal metrics originate from in multi-cluster deployments. The
resource/newrelicprocessor correctly enriches pipeline metrics withk8s.cluster.name, butservice::telemetryexports directly via OTLP and bypasses all pipeline processors, so it never receives that enrichment.This PR adds a
resourceblock underservice::telemetryin both the daemonset and deployment configmaps.k8s.cluster.nameis automatically populated from the existingnewrelic.common.clusterhelper, following the same pattern already used in theresource/newrelicprocessor. Additional arbitrary attributes can be passed viacollectorObservability.resourcefor things likeenv.This also fixes a minor inconsistency where
values.yamldocumented the scrape interval field asscrapeIntervalMsbut the configmap template referenced it asscrapeIntervalSeconds.Which issue this PR fixes
(optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close that issue when PR gets merged)Special notes for your reviewer:
resourceblock is placed atservice::telemetry::resourceper the OTel collector internal telemetry docs, which applies resource attributes across all internal telemetry signals (metrics, logs, and traces)resourceblock is only rendered whencollectorObservability.enabledistrue, so there is no impact to users who have not enabled collector observabilityk8s.cluster.nameis always set automatically and does not need to be specified by the userdaemonset-configmap.yamlanddeployment-configmap.yamlscrapeIntervalMs→scrapeIntervalSecondsrename invalues.yamlis a documentation fix only — the configmap template already usedscrapeIntervalSecondsso behavior is unchangedChecklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]
[mychartname])Release Notes to Publish (nr-k8s-otel-collector)
If this PR contains changes in
nr-k8s-otel-collector, please complete the following section. All other charts should ignore this section.🚀 What's Changed
collectorObservability.resourceto allow users to enrich internal collector metrics with custom resource attributes.k8s.cluster.nameis automatically populated from the chart's cluster value, enabling multi-cluster observability out of the box. Additional attributes such asenvcan be passed viacollectorObservability.resource.scrapeIntervalMsinvalues.yamlbutscrapeIntervalSecondsin the configmap template.