Skip to content

[processor/resourcedetection] Align detectors with opentelemetry-go SDK detectors #48159

Description

@dmitryax

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestnever staleIssues marked with this label will be never staled and automatically removedprocessor/resourcedetectionResource detection processor

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions