-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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(apm): Sampling of traces #2500
Conversation
Also set op otherwise span will be discarded by the server
@@ -402,6 +402,8 @@ export class Tracing implements Integration { | |||
|
|||
const span = hub.startSpan( | |||
{ | |||
op: 'operation', | |||
sampled: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FTR (as we talked over video chat), I believe more users will forget to set this and get surprised and frustrated.
It feels like only the SDK itself should ever set the valued of sampled
, never the user.
This is the docs pr |
packages/apm/src/hubextensions.ts
Outdated
const experimentsOptions = (client && client.getOptions()._experiments) || {}; | ||
span.initFinishedSpans(experimentsOptions.maxSpans as number); | ||
} | ||
// We always want to record spans independent from the sample rate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a short summary of why?
Co-Authored-By: Rodolfo Carvalho <rodolfo.carvalho@sentry.io>
Co-Authored-By: Rodolfo Carvalho <rodolfo.carvalho@sentry.io>
Co-Authored-By: Rodolfo Carvalho <rodolfo.carvalho@sentry.io>
…ipt into apm/set-sampled
@@ -187,7 +192,10 @@ export class Span implements SpanInterface, SpanContext { | |||
traceId: this._traceId, | |||
}); | |||
|
|||
span.spanRecorder = this.spanRecorder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already happening in finishSpan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get this in and keep iterating.
Reworking the sampling decision, now everything is consistent with it was meant to be.
tracesSampleRate
forceNoChild
parameter fromhub.startSpan
Span
internal, only usehub.startSpan