Skip to content

feat(sdk-trace-web,fetch,grpc,http,xml-http-request): only emit stable http metrics, spans and attributes#6819

Open
maryliag wants to merge 14 commits into
open-telemetry:mainfrom
maryliag:http-stable
Open

feat(sdk-trace-web,fetch,grpc,http,xml-http-request): only emit stable http metrics, spans and attributes#6819
maryliag wants to merge 14 commits into
open-telemetry:mainfrom
maryliag:http-stable

Conversation

@maryliag

@maryliag maryliag commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Part Of #6240

  • Only emit stable HTTP metrics.
  • Remove config that allow to send old metrics
  • Update documentation
  • Cleanup removing functions, files and sem conv no longer used

Fixes #2353

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.87234% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 95.52%. Comparing base (c3bb4a3) to head (272045d).

Files with missing lines Patch % Lines
...emetry-instrumentation-xml-http-request/src/xhr.ts 95.83% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6819      +/-   ##
==========================================
- Coverage   95.52%   95.52%   -0.01%     
==========================================
  Files         384      382       -2     
  Lines       12974    12886      -88     
  Branches     2976     2948      -28     
==========================================
- Hits        12394    12309      -85     
+ Misses        580      577       -3     
Files with missing lines Coverage Δ
...s/opentelemetry-instrumentation-fetch/src/fetch.ts 83.17% <100.00%> (-1.41%) ⬇️
...opentelemetry-instrumentation-fetch/src/semconv.ts 100.00% <ø> (ø)
...emetry-instrumentation-grpc/src/instrumentation.ts 96.29% <100.00%> (+0.86%) ⬆️
.../opentelemetry-instrumentation-grpc/src/semconv.ts 100.00% <ø> (ø)
...ry-instrumentation-xml-http-request/src/semconv.ts 100.00% <ø> (ø)
...emetry-instrumentation-xml-http-request/src/xhr.ts 93.22% <95.83%> (-0.68%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@maryliag maryliag marked this pull request as ready for review June 17, 2026 19:52
@maryliag maryliag requested review from a team as code owners June 17, 2026 19:52
@maryliag maryliag changed the title feat(several): only emit stable http metrics feat(sdk-trace-web,fetch,grpc,http,xml-http-request): only emit stable http metrics Jun 17, 2026

HTTP semantic conventions (semconv) were stabilized in v1.23.0, and a [migration process](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/non-normative/http-migration.md#http-semantic-convention-stability-migration) was defined.
`instrumentation-grpc` versions 0.201.0 and later include support for migrating to stable HTTP semantic conventions, as described below.
`instrumentation-grpc` versions 0.201.0 - XXXX include support for migrating to stable HTTP semantic conventions, as described below.

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.

nit: do we have versions we want to replace these placeholders with? If not the "and later" language makes more sense for now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

once this is about to merge I can update with the version, because it might take a little while. I want to have a specific one because after this gets merged the "migration" described won't make sense anymore, so it needs to be for the specific versions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@pichlermarc can you let me know once you know which version it would be? so I can update the docs accordingly before it gets merged

@pichlermarc

Copy link
Copy Markdown
Member

This also fixes #2353 since the code that causes this will be removed and the bug does not exist for the new semantic conventions. I'll link it.

@pichlermarc pichlermarc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for working on this 🙌

I think the title needs to be updated (we're not only emitting stable-only metrics but also spans and their attributes follow the new semconv with this change).

import type * as api from '@opentelemetry/api';
import {
hrTimeToNanoseconds,
timeInputToHrTime,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We'll have to keep everything in @opentelemetry/sdk-trace-web around for now, otherwise we'll have to delay this PR until SDK 3.0

We'll deprecate this package anyway though, so it'll go away then. :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

can you clarify what do I need to add back? you mean just the semconv file I deleted or the changes on utils and test files?

@pichlermarc pichlermarc Jun 19, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

you mean just the semconv file I deleted or the changes on utils and test files?

Both. Essentially we'd need to undo everything that was changed in @opentelemetry/sdk-trace-web.

Unfortunately, it's a stable package and the spec requires us to version all stable packages in unison. So merging this PR as-is - with a breaking change in @opentelemetry/sdk-trace-web - would require us to bump all SDK packages to 3.0.0 on the next release.

Our current plan for this package is that we'll deprecate and retire it when we publish 3.0.0, ref #5290 (comment)

David has created an issue to decide how to deal with the utils going forward when @opentelemetry/sdk-trace-web is deprecated/removed: #6591

For this PR, it's okay/easier if we just make the existing instrumentations emit fully stable semconv and leave the future of the @opentelemetry/sdk-trace-web package to #5290 & #6591

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changes reverted

@maryliag maryliag changed the title feat(sdk-trace-web,fetch,grpc,http,xml-http-request): only emit stable http metrics feat(sdk-trace-web,fetch,grpc,http,xml-http-request): only emit stable http metrics, spans and attributes Jun 18, 2026
@maryliag

Copy link
Copy Markdown
Contributor Author

@pichlermarc let me know if you want any other changes.
The only thing missing is the version update that I can update when this PR is about to merge (and if you know which version will be)

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.

http instrumentation: url and host attributes are sometime wrong for outgoing requests with ipv6 address

3 participants