Skip to content

feat: HTTPX semantic convention stability opt in#1589

Merged
kaylareopelle merged 6 commits intoopen-telemetry:mainfrom
hannahramadan:httpx_semconv_stability_opt_in
Aug 7, 2025
Merged

feat: HTTPX semantic convention stability opt in#1589
kaylareopelle merged 6 commits intoopen-telemetry:mainfrom
hannahramadan:httpx_semconv_stability_opt_in

Conversation

@hannahramadan
Copy link
Copy Markdown
Member

This PR is intended to assist in the transition from the old to new HTTP semantic conventions. Per the HTTP semantic convention stability migration spec, users should be able to set the environment variable OTEL_SEMCONV_STABILITY_OPT_IN to:

  • http to emit stable conventions only
  • http/dup to emit both old and the stable conventions
  • a blank env var will emit old conventions only
  • Span names have also changed. Spans will now be named based on only their method. For example, what used to be HTTP GET is now just GET - spec

The agent is required to maintain this bridge for 6 months and may drop the environment variable in the next major version and emit only the stable HTTP and networking conventions.

This approach was approved in #1547

@hannahramadan hannahramadan changed the title feat: semantic convention stability opt in feat: HTTPX semantic convention stability opt in Jul 10, 2025
@hannahramadan hannahramadan marked this pull request as ready for review July 11, 2025 00:02
Comment thread instrumentation/httpx/lib/opentelemetry/instrumentation/httpx/dup/plugin.rb Outdated
Comment thread instrumentation/httpx/lib/opentelemetry/instrumentation/httpx/stable/plugin.rb Outdated
attributes[OpenTelemetry::SemanticConventions::Trace::PEER_SERVICE] = config[:peer_service] if config[:peer_service]
attributes.merge!(OpenTelemetry::Common::HTTP::ClientContext.attributes)

span = tracer.start_span(verb.to_s, attributes: attributes, kind: :client, start_timestamp: start_time)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you remove the .to_s in dup, it should be removed here too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

removed in f9cbcc8

Copy link
Copy Markdown
Contributor

@kaylareopelle kaylareopelle left a comment

Choose a reason for hiding this comment

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

🎉

@kaylareopelle kaylareopelle merged commit 07de1d6 into open-telemetry:main Aug 7, 2025
62 checks passed
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.

3 participants