Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle otlp semconv deployment.environment.name alongside deprecated deployment.environment #384

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

carsonip
Copy link
Member

@carsonip carsonip commented Oct 14, 2024

@carsonip carsonip requested a review from a team as a code owner October 14, 2024 13:31
@elastic-observability-automation elastic-observability-automation bot added the safe-to-test Changes are safe to run in the CI label Oct 14, 2024
@@ -66,7 +66,8 @@ func translateResourceMetadata(resource pcommon.Resource, out *modelpb.APMEvent)
out.Service.Node.Name = truncate(v.Str())

// deployment.*
case semconv.AttributeDeploymentEnvironment:
// deployment.environment is deprecated, use deployment.environment.name instead
case semconv.AttributeDeploymentEnvironment, "deployment.environment.name":
Copy link
Member Author

Choose a reason for hiding this comment

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

[to reviewer] No precedence between deprecated and new field, so the one appears later in the resource attributes wins.

Copy link
Member

Choose a reason for hiding this comment

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

just a question on semconv.AttributeDeploymentEnvironment: is it possible for it to change in future releases of semconv? Or being deprecated applies some special handling?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@lahsivjar lahsivjar Oct 15, 2024

Choose a reason for hiding this comment

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

BTW, we can also import semconv by versions to make things clear on what is latest and what is old - all semconvs are provided by the same module.

Something like semconv18. AttributeDeploymentEnvironment vs semconv27.AttributeDeploymentEnvironmentName - just an idea I have been playing around with for some other projects.

@carsonip carsonip changed the title Handle otlp semconv deployment.environment.name Handle otlp semconv deployment.environment.name alongside deprecated deployment.environment Oct 14, 2024
@carsonip carsonip merged commit 8e3a1a7 into elastic:main Oct 14, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe-to-test Changes are safe to run in the CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle otlp semconv deployment.environment.name as deployment.environment is deprecated
3 participants