Skip to content

feat: make resource detector ordering deterministic#5120

Merged
xrmx merged 6 commits intoopen-telemetry:mainfrom
herin049:feat/update-detector-init-order
Apr 22, 2026
Merged

feat: make resource detector ordering deterministic#5120
xrmx merged 6 commits intoopen-telemetry:mainfrom
herin049:feat/update-detector-init-order

Conversation

@herin049
Copy link
Copy Markdown
Contributor

Description

Makes the ordering and merging of resource detector attributes deterministic, with the otel resource detector being last unless explicitly listed in OTEL_EXPERIMENTAL_RESOURCE_DETECTORS.

Fixes #5054

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

uv run tox -e py314-test-opentelemetry-sdk

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@herin049 herin049 requested a review from a team as a code owner April 17, 2026 04:49
Copy link
Copy Markdown
Contributor

@xrmx xrmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py Outdated
Comment thread opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py Outdated
@herin049 herin049 force-pushed the feat/update-detector-init-order branch from 1cadc94 to 4c5163a Compare April 20, 2026 18:18
@xrmx xrmx enabled auto-merge (squash) April 21, 2026 12:46
@xrmx xrmx disabled auto-merge April 21, 2026 16:15
@xrmx xrmx enabled auto-merge (squash) April 22, 2026 08:50
@xrmx xrmx merged commit 849cfac into open-telemetry:main Apr 22, 2026
1388 of 1392 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Resource creation race condition with OTEL_RESOURCE_ATTRIBUTES env var

5 participants