Skip to content

feat(collector): add resourceDetection preset for parity with the kube-stack helm chart#2157

Open
cyrille-leclerc wants to merge 8 commits intoopen-telemetry:mainfrom
cyrille-leclerc:feat/collector-resource-detection-preset
Open

feat(collector): add resourceDetection preset for parity with the kube-stack helm chart#2157
cyrille-leclerc wants to merge 8 commits intoopen-telemetry:mainfrom
cyrille-leclerc:feat/collector-resource-detection-preset

Conversation

@cyrille-leclerc
Copy link
Copy Markdown
Member

@cyrille-leclerc cyrille-leclerc commented Apr 19, 2026

Here is the PR description:


Add resourceDetection preset to the opentelemetry-collector chart

Goal

Implement the presets.resourceDetection feature in the opentelemetry-collector chart, bringing it to parity with the equivalent preset already present in the opentelemetry-kube-stack chart (see otel-kube-stack PR here).

Implementation

A new presets.resourceDetection block is introduced with a top-level enabled flag (default: false for backward compatibility). When set to true, the chart injects a resourcedetection/env processor into all configured pipelines (logs, metrics, traces).

Supported detectors

Detector Enabled by default (when resourceDetection.enabled: true) Purpose
env ✅ yes Reads resource attributes from environment variables
k8snode ✅ yes Detects node-level attributes from the Kubernetes API
eks ❌ no Detects EKS cluster name
aks ❌ no Detects AKS cluster name
gcp ❌ no Detects GCP/GKE cluster name

Each detector can be individually overridden regardless of the top-level enabled state.

Sample configuration

presets:
  # ...

  # Configures the collector to detect resource attributes adding a resourcedetection processor named `resourcedetection/env` to the pipelines.
  # Adds the resourcedetection/env processor to all pipelines.
  # Each detector can be enabled individually. Base detectors `env` and `k8snode` are enabled by default when `resourceDetection/enabled` is `true`. 
  # Cloud provider specific detectors (`eks`, `aks`, `gcp`)
  resourceDetection:
    enabled: false
    env:
      enabled: true
    k8snode:
      enabled: true
    eks:
      enabled: false
    aks:
      enabled: false
    gcp:
      enabled: false

Follow-up

A subsequent PR will add presets.resourceDetection to the opentelemetry-kube-stack chart, including the enabled flag and the env/k8snode sub-configs. The only difference from this chart will be that presets.resourceDetection.enabled defaults to true there, since the kube-stack chart already ships resourcedetection/env (with env + k8snode) as part of its default daemon collector configuration.

Add a resourceDetection preset to the opentelemetry-collector chart, matching the equivalent preset in the opentelemetry-kube-stack chart. Supports EKS, AKS, and GCP detectors (all disabled by default), configures the resourcedetection/env processor, and wires it into all available pipelines.
…reset

Add env and k8snode as individually configurable detectors in the
resourceDetection preset, matching the baseline detector set used by
the opentelemetry-kube-stack chart.
Enable the env and k8snode detectors in the resourceDetection preset
by default, matching the baseline behavior of the kube-stack chart
which always includes these two detectors in its daemon collector config.
Add presets.resourceDetection.enabled (default: true) to allow users
to fully disable the resourcedetection/env processor without having to
individually disable each detector.
Set presets.resourceDetection.enabled default to false so the preset
is opt-in, consistent with all other presets in the chart.
Remove env and k8snode from the example values since they are already
enabled by default within the preset, and update rendered output.
@cyrille-leclerc cyrille-leclerc marked this pull request as ready for review April 20, 2026 08:12
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.

1 participant