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

opentelemetry-sdk: use release candidate code attributes #4508

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

xrmx
Copy link
Contributor

@xrmx xrmx commented Mar 26, 2025

Description

Instead of using the deprecated use latest release candidate code attributes.
While at it stop using SpanAttributes.

This is similar to what the go sdk is doing open-telemetry/opentelemetry-go-contrib#6870

Refs #4316

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?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A

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

Instead of using the deprecated use latest release candidate code
attributes.
While at it stop using SpanAttributes.
@xrmx xrmx requested a review from a team as a code owner March 26, 2025 14:37
@@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#4494](https://github.com/open-telemetry/opentelemetry-python/pull/4494))
- Improve CI by cancelling stale runs and setting timeouts
([#4498](https://github.com/open-telemetry/opentelemetry-python/pull/4498))
- opentelemetry-sdk: use release candidate code attributes
Copy link
Contributor Author

@xrmx xrmx Mar 26, 2025

Choose a reason for hiding this comment

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

Suggested change
- opentelemetry-sdk: use release candidate code attributes
- opentelemetry-sdk: use release candidate code attributes: `code.function` -> `code.function.name`, `code.lineno` -> `code.line.number`, `code.filepath` -> `code.file.path`

Copy link
Member

@emdneto emdneto left a comment

Choose a reason for hiding this comment

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

Since code semconv is in Release Candidate status, I'm good with the change.

https://opentelemetry.io/docs/specs/semconv/code/

Existing code instrumentations that are using v1.29.0 of code conventions (or prior):

SHOULD NOT change the version of the code conventions that they emit by default until the code semantic conventions are marked stable.

if value is not None and value.args:
attributes[SpanAttributes.EXCEPTION_MESSAGE] = str(
attributes[exception_attributes.EXCEPTION_MESSAGE] = str(
value.args[0]
)
if tb is not None:
# https://github.com/open-telemetry/opentelemetry-specification/blob/9fa7c656b26647b27e485a6af7e38dc716eba98a/specification/trace/semantic_conventions/exceptions.md#stacktrace-representation
Copy link
Member

Choose a reason for hiding this comment

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

While we are still here, can you change the URL to point to the main one?

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.

4 participants