Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/opentelemetry/src/spanExporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,9 @@ function getData(span: ReadableSpan): Record<string, unknown> {
data.url = requestData.url;
}

// TODO(v11): emit `url.query`/`url.fragment` (OTel-standard, no leading `?`/`#`) and drop
// this stripping + the `http.query`/`http.fragment` attributes. `http.query` is actually specced to
// keep the leading `?`, so stripping diverges from our own conventions; `url.query` sidesteps it.
if (requestData['http.query']) {
data['http.query'] = requestData['http.query'].slice(1);
}
Expand Down
2 changes: 2 additions & 0 deletions packages/opentelemetry/src/utils/parseSpanDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ export function descriptionForHttpMethod(
if (query) {
// Strip the leading `?`/`#` (the `URL.search`/`URL.hash` prefix) so the attribute matches the
// canonical format the OTel SDK exporter emits (`getData` in `spanExporter.ts` slices these too).
// TODO(v11): emit `url.query`/`url.fragment` (OTel-standard, no leading `?`/`#`) and drop
// this stripping + `http.query`/`http.fragment`; `http.query` is specced to keep the leading `?`.
data['http.query'] = query.slice(1);
}
if (fragment) {
Expand Down
Loading