Skip to content

Commit

Permalink
fix(instrumentation-fetch)! Remove HTTP prefix in span name.
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgangcodes committed Aug 28, 2024
1 parent e311672 commit bf6a8bb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to experimental packages in this project will be documented
## Unreleased

### :boom: Breaking Change
* fix(instrumentation-fetch)! Remove HTTP prefix in span name.

### :rocket: (Enhancement)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export class FetchInstrumentation extends InstrumentationBase<FetchInstrumentati
return;
}
const method = (options.method || 'GET').toUpperCase();
const spanName = `HTTP ${method}`;
const spanName = `${method}`;
return this.tracer.startSpan(spanName, {
kind: api.SpanKind.CLIENT,
attributes: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ describe('fetch', () => {

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 Expand Up @@ -932,7 +932,7 @@ describe('fetch', () => {
);
assert.strictEqual(
exportSpy.args[0][0][0].name,
'HTTP GET',
'GET',
'wrong span captured'
);

Expand Down

0 comments on commit bf6a8bb

Please sign in to comment.