Skip to content

feat(otel): add deployment.environment.name from service_environment to the resource - #353

Merged
lesnik512 merged 1 commit into
mainfrom
feat/otel-deployment-environment
Oct 28, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
feat/otel-deployment-environment

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Closes #332.

service_environment reached Sentry but not the OTel resource. _build_resource now sets deployment.environment.name from it, and the existing if v filter leaves the key out when service_environment is unset.

The key is a string literal. Its stable constant first appears in semconv 0.63b0, and at the 1.28 floor it exists only in _incubating. resources.DEPLOYMENT_ENVIRONMENT holds the old "deployment.environment" key, so it is not used.

Additive, so it fits a minor. One edge for the release notes: lite-bootstrap's attributes are merged over OTEL_RESOURCE_ATTRIBUTES, so a service that sets both service_environment and deployment.environment.name in that variable now gets the config value.

Tests: a parametrized test covers the set and unset cases on the tracer provider's resource, and the metrics-endpoint test now checks that the meter provider's resource carries the key too. Both failed before the change. Full suite passes at 100% coverage; just lint is clean.

@lesnik512
lesnik512 merged commit cdbaed6 into main Oct 28, 2026
35 checks passed
@lesnik512
lesnik512 deleted the feat/otel-deployment-environment branch October 28, 2026 15:18
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.

Add deployment.environment.name from service_environment to the OTel resource

1 participant