Skip to content

Commit

Permalink
Log name and ID on span end misuse (#3716)
Browse files Browse the repository at this point in the history
* Log name and ID on span end misuse

* Changelog

* lint
  • Loading branch information
dyladan committed Apr 5, 2023
1 parent 73da976 commit 65b2b79
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/

### :rocket: (Enhancement)

* feat(tracing): log span name and IDs when span end is called multiple times [#3716](https://github.com/open-telemetry/opentelemetry-js/pull/3716)

### :bug: (Bug Fix)

* fix(instrumentation-http): fixed description for http.server.duration metric [#3710](https://github.com/open-telemetry/opentelemetry-js/pull/3710)
Expand Down
4 changes: 3 additions & 1 deletion packages/opentelemetry-sdk-trace-base/src/Span.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,9 @@ export class Span implements APISpan, ReadableSpan {

end(endTime?: TimeInput): void {
if (this._isSpanEnded()) {
diag.error('You can only call end() on a span once.');
diag.error(
`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`
);
return;
}
this._ended = true;
Expand Down

0 comments on commit 65b2b79

Please sign in to comment.