Uh oh!
There was an error while loading. Please reload this page.
fix(opentelemetry): Strip leading ? and # from inferred http.query and http.fragment - #21848
Conversation
…d http.fragment The inferred `http.query` and `http.fragment` span attributes kept the leading `?`/`#` from `URL.search`/`URL.hash`, unlike the values the OTel SDK span exporter emits (`getData` in `spanExporter.ts` slices these off). Strip them so both code paths produce the same canonical attribute format. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
size-limit report 📦
|
Uh oh!
There was an error while loading. Please reload this page.
@andreiborza@Lms24 Just an FYI here that our conventions specify that this property contains a leading That said the ideal option is probably to deprecate |
@mjq thanks for raising this! I aligned this with our current span exporter, we can go for url.query in v11 but I'd rather not break existing users now. |
…ation (#21852) Adds `TODO(v11)` markers at the two spots that strip the leading `?`/`#` from `http.query`/`http.fragment` — the span exporter's `getData` and `parseSpanDescription`'s `descriptionForHttpMethod`. Per the [discussion on #21848](#21848 (comment)), `http.query` is specced to *keep* the leading `?`, so the stripping diverges from our own conventions. The v11 direction is to emit the OTel-standard `url.query`/`url.fragment` (no leading char, already in `@sentry/conventions`) and drop `http.query`/`http.fragment`. Comment-only, no behavior change. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
What
Strip the leading
?/#from the inferredhttp.queryandhttp.fragmentspan attributes indescriptionForHttpMethod.Why
The inferred values were taken straight from
URL.search/URL.hash, which include the leading?/#. The OTel SDK span exporter (getDatainspanExporter.ts) slices these off, so the same logical attribute ended up in two different formats depending on the code path. Stripping the prefix here makes both paths emit the same canonical format.