Component(s)
processor/resourcedetection
Is your feature request related to a problem? Please describe.
With open-telemetry/opentelemetry-collector#14311 landing, the collector's service::telemetry will gain support for the resource detectors from the opentelemetry-go SDK (via the detection/development schema — see open-telemetry/opentelemetry-collector#14426 and #15226). Meanwhile, processor/resourcedetectionprocessor maintains its own parallel set of detector implementations (host, system, process, container, ec2, gcp, azure, k8snode, env, …).
This leaves two independent detection paths in the same binary:
- SDK detectors — used by
service::telemetry (and, by extension, the attributes reported by the OpAMP extension via include_resource_attributes).
- resourcedetectionprocessor detectors — used by user telemetry pipelines.
They can, and likely will, drift: different attribute keys, different detection semantics, different failure modes, different priorities. Users will see one set of resource attributes on their collector's self-telemetry/AgentDescription and a different set on the telemetry flowing through their pipelines — even with similar-looking configuration.
This came up in review on open-telemetry/opentelemetry-collector#14412:
I'm a bit concerned about two separate solutions in the same binary that could potentially diverge and produce different results. We probably should start using the sdk detectors libraries in the detection processor going forward.
Describe the solution you'd like
Migrate resourcedetectionprocessor to delegate to the opentelemetry-go SDK detectors wherever an equivalent exists, keeping only contrib-specific detectors as local implementations.
Concretely:
- Audit each detector under
processor/resourcedetectionprocessor/internal/ against what the SDK currently offers (host, process, container, service; cloud detectors arriving incrementally).
- For detectors with an SDK equivalent, replace the implementation with a thin adapter over the SDK detector, preserving the existing processor configuration surface for backwards compatibility.
- Keep detectors that have no SDK equivalent (e.g.
k8snode, kubeadm, openshift, heroku, consul, dynatrace, regional clouds without upstream coverage) as-is, but document which are SDK-backed and which are contrib-local.
- Ensure attribute keys and values produced by the migrated detectors match what the SDK emits so that a user enabling the same detector in
service::telemetry and in the processor gets consistent output.
Component(s)
processor/resourcedetection
Is your feature request related to a problem? Please describe.
With open-telemetry/opentelemetry-collector#14311 landing, the collector's
service::telemetrywill gain support for the resource detectors from theopentelemetry-goSDK (via thedetection/developmentschema — see open-telemetry/opentelemetry-collector#14426 and #15226). Meanwhile,processor/resourcedetectionprocessormaintains its own parallel set of detector implementations (host,system,process,container,ec2,gcp,azure,k8snode,env, …).This leaves two independent detection paths in the same binary:
service::telemetry(and, by extension, the attributes reported by the OpAMP extension viainclude_resource_attributes).They can, and likely will, drift: different attribute keys, different detection semantics, different failure modes, different priorities. Users will see one set of resource attributes on their collector's self-telemetry/AgentDescription and a different set on the telemetry flowing through their pipelines — even with similar-looking configuration.
This came up in review on open-telemetry/opentelemetry-collector#14412:
Describe the solution you'd like
Migrate
resourcedetectionprocessorto delegate to theopentelemetry-goSDK detectors wherever an equivalent exists, keeping only contrib-specific detectors as local implementations.Concretely:
processor/resourcedetectionprocessor/internal/against what the SDK currently offers (host, process, container, service; cloud detectors arriving incrementally).k8snode,kubeadm,openshift,heroku,consul,dynatrace, regional clouds without upstream coverage) as-is, but document which are SDK-backed and which are contrib-local.service::telemetryand in the processor gets consistent output.