Skip to content
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

fix!: span name on instrumentation-xml-http-request #3672

Merged
merged 8 commits into from
Mar 17, 2023
Merged
2 changes: 2 additions & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ All notable changes to experimental packages in this project will be documented

### :bug: (Bug Fix)

* fix: remove HTTP/HTTPS prefix from span name in instrumentation-xml-http-request
dyladan marked this conversation as resolved.
Show resolved Hide resolved

### :books: (Refine Doc)

### :house: (Internal)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ export class XMLHttpRequestInstrumentation extends InstrumentationBase<XMLHttpRe
this._diag.debug('ignoring span as url matches ignored url');
return;
}
const spanName = `HTTP ${method.toUpperCase()}`;
const spanName = `${method.toUpperCase()}`;
jufab marked this conversation as resolved.
Show resolved Hide resolved

const currentSpan = this.tracer.startSpan(spanName, {
kind: api.SpanKind.CLIENT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ describe('xhr', () => {

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

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