Skip to content

Commit 52facfa

Browse files
jufabFlarnadyladan
authored
fix!: span name on instrumentation-xml-http-request (#3672)
* fix: remove HTTP in span name * fix: add entry in CHANGELOG.md * fix: add breaking change changelog * Update experimental/packages/opentelemetry-instrumentation-xml-http-request/src/xhr.ts Co-authored-by: Gerhard Stöbich <[email protected]> * Remove duplicate changelog entry --------- Co-authored-by: Gerhard Stöbich <[email protected]> Co-authored-by: Daniel Dyla <[email protected]>
1 parent 89a984a commit 52facfa

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

experimental/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ All notable changes to experimental packages in this project will be documented
66

77
### :boom: Breaking Change
88

9+
* fix: remove HTTP/HTTPS prefix from span name in instrumentation-xml-http-request [#3672](https://github.com/open-telemetry/opentelemetry-js/pull/3672) @jufab
10+
911
### :rocket: (Enhancement)
1012

1113
### :bug: (Bug Fix)

experimental/packages/opentelemetry-instrumentation-xml-http-request/src/xhr.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ export class XMLHttpRequestInstrumentation extends InstrumentationBase<XMLHttpRe
329329
this._diag.debug('ignoring span as url matches ignored url');
330330
return;
331331
}
332-
const spanName = `HTTP ${method.toUpperCase()}`;
332+
const spanName = method.toUpperCase();
333333

334334
const currentSpan = this.tracer.startSpan(spanName, {
335335
kind: api.SpanKind.CLIENT,

experimental/packages/opentelemetry-instrumentation-xml-http-request/test/xhr.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ describe('xhr', () => {
318318

319319
it('span should have correct name', () => {
320320
const span: tracing.ReadableSpan = exportSpy.args[1][0][0];
321-
assert.strictEqual(span.name, 'HTTP GET', 'span has wrong name');
321+
assert.strictEqual(span.name, 'GET', 'span has wrong name');
322322
});
323323

324324
it('span should have correct kind', () => {

0 commit comments

Comments
 (0)