Skip to content

feat: NET::HTTP semantic convention stability migration #1572

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

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

Conversation

hannahramadan
Copy link
Contributor

@hannahramadan hannahramadan commented Jun 24, 2025

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

Special note about NET::HTTP changes: http.target is split into two separate attributes, url.path and url.query, under stable conventions. Unlike some other HTTP libraries, NET::HTTP reports these attributes as one path. Because of this, some additional work was done to to separate the path from the query in order to report them as separate attributes.

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

Comment on lines +76 to +82
if use_ssl? && proxy?
span_name = 'CONNECT'
span_kind = :client
else
span_name = 'connect'
span_kind = :internal
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question here as on Excon: why is connect capitalized in one case and lowercase in the other?

Copy link
Contributor Author

@hannahramadan hannahramadan Jul 28, 2025

Choose a reason for hiding this comment

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

I'm not sure, but it seems to be intentional. I'll see if I can dig up anything on this. Also discussed in #1569 (comment)

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.

2 participants