Skip to content

Commit

Permalink
Fix shouldTrace decision based on sampling decision from edge
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeymisson committed Sep 1, 2023
1 parent 750d149 commit 2783499
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/service/tracing/tracingMiddlewares.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,6 @@ export const traceUserLandRemainingPipelineMiddleware = () => {
}
function shouldTrace(ctx: ServiceContext, rootSpan: SpanContext | undefined) {
// Should trace if path isnt blacklisted and tracing decision came from the edge
return !PATHS_BLACKLISTED_FOR_TRACING.includes(ctx.request.path) && rootSpan != null
return !PATHS_BLACKLISTED_FOR_TRACING.includes(ctx.request.path) && ((rootSpan as any).isSampled?.() ?? false)
}

0 comments on commit 2783499

Please sign in to comment.