Skip to content

Commit

Permalink
fix!: span name on instrumentation-xml-http-request (#3672)
Browse files Browse the repository at this point in the history
* 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 <deb2001-github@yahoo.de>

* Remove duplicate changelog entry

---------

Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
  • Loading branch information
3 people committed Mar 17, 2023
1 parent 89a984a commit 52facfa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ All notable changes to experimental packages in this project will be documented

### :boom: Breaking Change

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

### :rocket: (Enhancement)

### :bug: (Bug Fix)
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();

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

0 comments on commit 52facfa

Please sign in to comment.