Skip to content

Commit

Permalink
Add spanId getter for app context
Browse files Browse the repository at this point in the history
  • Loading branch information
goshander committed Oct 15, 2024
1 parent 11c259f commit 606f02e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lib/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,11 @@ export class AppContext {
}

getTraceId() {
// @ts-ignore
return this.span?._spanContext?.toTraceId();
return this.span?.context()?.toTraceId();
}

getSpanId() {
return this.span?.context()?.toSpanId();
}

// allow add extra logger data, after ctx already initialized (ex. to add traceId from ctx)
Expand Down

0 comments on commit 606f02e

Please sign in to comment.