fix(otel-collector): default k8snode resource detection on on-prem K8s [CDS-2925]#443
Merged
Merged
Conversation
…s [CDS-2925] Reverts the regression introduced in v0.129.2 (PR #411) where setting `provider: on-prem` on a Kubernetes distribution skipped the `resourcedetection/resource_catalog` processor entirely and limited `resourcedetection/env` to `[system, env]`. Without `k8s.node.*` resource attributes, the Coralogix Infra Catalog could not establish pod-to-node relationships on EKSA / self-managed Kubernetes clusters. For `provider: on-prem` on a Kubernetes distribution, the chart now defaults to: - `resourcedetection/resource_catalog`: detectors `[k8snode]` with `node_from_env_var: K8S_NODE_NAME` - `resourcedetection/env`: detectors `[env, k8snode, system]` with the matching `k8snode` block `K8S_NODE_NAME` is already injected via the Downward API in `_pod.tpl` for non-ECS / non-standalone / non-macOS distributions, so no additional plumbing is required. Users who set `presets.resourceDetection.detectors.env` or `.cloud` explicitly retain full control. Also adds an `examples/on-prem-k8s` fixture covering this configuration and re-renders all examples for chart bump 0.130.12 -> 0.130.13. Made-with: Cursor
Author
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
povilasv
approved these changes
Apr 22, 2026
…-2925] Address review feedback on PR #443. `presets.resourceDetection.detectors.env: []` was previously coerced back to the on-prem default by `| default $defaultEnvDetectors`, because Helm treats an empty list as falsy. Use `kindIs "invalid"` to distinguish "unset/null" from "explicitly empty", so users can opt out of resourcedetection/env entirely with `env: []`, and so explicit lists like `env: [system, env]` are respected verbatim on on-prem Kubernetes. values.yaml now declares `env:` (null) with an honest comment explaining the override semantics, and the JSON schema accepts ["array", "null"]. Verified with `helm template`: - on-prem K8s, env unset -> [env, k8snode, system] + k8snode block - on-prem K8s, env: [] -> detectors: [], no k8snode block - on-prem K8s, env: [system,env] -> [system, env], no k8snode block - AWS EKS, env unset -> [system, env], no k8snode block No rendered example fixtures change (all examples leave `env` unset). Made-with: Cursor
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.
Summary
Restores Coralogix Infra Catalog support on on-prem Kubernetes (e.g. EKSA) when users set
provider: on-prem. Without this, the resource catalog cannot resolve pod-to-node relationships because the chart was emitting nok8s.node.*resource attributes for on-prem deployments.Per Slack thread CDS-2925 (EKSA customer report).
Background
PR #411 (v0.129.2) made the resource detection processors provider-aware. For
provider: on-premit set the cloud detector list to empty in two places, which:resourcedetection/resource_catalogprocessor (gated byif gt (len $catalogDetectors) 0), so thelogs/resource_catalogpipeline emitted nothing useful for the Infra Catalog.resourcedetection/envwith only[system, env], sok8s.node.*attributes never landed on logs/metrics/traces either.K8S_NODE_NAMEis already injected via the Downward API intemplates/_pod.tplfor non-ECS / non-standalone / non-macOS distributions, so thek8snodedetector works out of the box without further plumbing.Changes
charts/opentelemetry-collector/templates/_config.tpl:opentelemetry-collector.kubernetesResourcesConfig: forprovider: on-premon Kubernetes, default$catalogDetectorsto[k8snode](was[]). Add ak8snode: { node_from_env_var: K8S_NODE_NAME }block underresourcedetection/resource_catalogwhen that detector is in use.opentelemetry-collector.resourceDetectionConfig: introduce$defaultEnvDetectors—[system, env]by default,[env, k8snode, system]for on-prem K8s. Add a siblingk8snode:config block underresourcedetection/envwhen that detector is in the list.charts/opentelemetry-collector/values.yaml:presets.resourceDetection.detectors.env: [system, env]so the template default applies (including the on-prem K8s default). Documented behavior and the# env: []opt-out in comments.charts/opentelemetry-collector/examples/on-prem-k8s/:distribution: ""+provider: on-prem+kubernetesResources+kubernetesAttributes+resourceDetection. Locks in the new defaults via rendered fixtures.Chart.yaml/CHANGELOG.md:All other touched files are re-rendered fixtures from
make generate-examples(chart version label bumps; the on-prem-k8s example is the only behavior change).Backward compatibility
presets.resourceDetection.detectors.envor.cloudexplicitly retain full control. Defaults only change when those values are unset.distribution: standalone/ecs/macos) behavior is unchanged.Test plan
helm lint charts/opentelemetry-collector— passesmake check-examples CHARTS=opentelemetry-collector— all 60 examples diff-clean againstmake generate-examplesoutput./charts/opentelemetry-collector/validate-configs.sh—on-prem-k8svalidates; only failures are pre-existing/environmental (standalone-systemdmissing receiver in bundled binary,standalone-windowsmacOS sandboxhostmetricsissue)processors.resourcedetection/resource_catalog.detectors == [k8snode]withk8snode.node_from_env_var: K8S_NODE_NAMEprocessors.resourcedetection/env.detectors == [env, k8snode, system]with siblingk8snode:blocklogs/resource_catalogpipeline includesresourcedetection/resource_catalogK8S_NODE_NAMEenv var injected on the deployment containerOut of scope
telemetry-shippers/otel-integration. The bot will pick up0.130.13on the next scheduled run viabump-otel-collector-version.sh.Made with Cursor