-
Notifications
You must be signed in to change notification settings - Fork 96
Add support for overriding sampling per span #394
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -232,6 +232,8 @@ export interface TraceOptions { | |||
spanContext?: SpanContext; | ||||
/** Span kind */ | ||||
kind?: SpanKind; | ||||
/** Determines the sampling rate. Ranges from 0.0 to 1.0 */ | ||||
samplingRate?: number; | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am happy to change here, but the global sampler takes the same input
number . WDYT?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I'm OK with that, but could you create an issue to track changing it in both places to bring it closer to the specs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure. |
||||
} | ||||
|
||||
/** Defines the span options */ | ||||
|
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.
Should these new parameters be optional to make this less of a breaking change? If we keep them, could you modify the change list to include a mention of it?
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.
Possible. On the other hand, this is internal API and won't affect users in any way.
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.
OK, I see, this does not change the
RootSpan
interface type, just the implementations. In OpenCensus Web, I create spans directly from performance timings, but it seems like the instrumented Node libraries use the helper utilities inTracer
to create, start and end spans. So makes sense this is not really part of the exported API.