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(instrumentation-fetch)! Remove HTTP prefix in span name. #4962

Closed
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
2 changes: 2 additions & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ All notable changes to experimental packages in this project will be documented

### :boom: Breaking Change

* fix(instrumentation-fetch)! Remove HTTP prefix in span name. [#4962](https://github.com/open-telemetry/opentelemetry-js/pull/4962) @wolfgangcodes

### :rocket: (Enhancement)

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