Skip to content

Conversation

@EzzioMoreira
Copy link
Contributor

Description

A lot of code imports semantic conventions attributes from opentelemetry.semconv.trace.SpanAttributes instead of the preferred opentelemetry.semconv.attributes and opentelemetry.semconv.incubating.

This PR refactors the semantic conventions to use the new stable attribute modules instead of the deprecated SpanAttributes class.

The changes migrate from:

  • Module Update: opentelemetry-instrumentation/src/opentelemetry/instrumentation/_semconv.py
  • From opentelemetry.semconv.trace import SpanAttributes
  • To specific imports from opentelemetry.semconv.schemas.* and opentelemetry.semconv._incubating.attributes.*

Key Changes:

  • Updated imports in opentelemetry-instrumentation/_semconv.py to use the new attribute modules
  • Schema URL Modernization: Updated schema URL handling to use the official Schemas.V1_33_0.value from opentelemetry.semconv.schemas instead of the deprecated SpanAttributes.SCHEMA_URL

Refs #3475

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 Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

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

@EzzioMoreira EzzioMoreira requested a review from a team as a code owner July 4, 2025 01:06
@xrmx xrmx moved this to Easy to review / merge / close in @xrmx's Python PR digest Jul 4, 2025
@xrmx xrmx added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Jul 29, 2025
@EzzioMoreira
Copy link
Contributor Author

@emdneto and @xrmx I need a review of this PR.

@xrmx xrmx enabled auto-merge (squash) August 11, 2025 13:26
@xrmx xrmx merged commit aa0579d into open-telemetry:main Aug 11, 2025
625 checks passed
@github-project-automation github-project-automation bot moved this from Easy to review / merge / close to Done in @xrmx's Python PR digest Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants