Add table summarizing sampler properties and processing#871
Add table summarizing sampler properties and processing#871yurishkuro merged 22 commits intoopen-telemetry:masterfrom
Conversation
|
LGTM - although, at least in Java, |
| trace events can be avoided. [Span Processors](#span-processor) will receive | ||
| all spans with this flag set. However, [Span Exporter](#span-exporter) will | ||
| not receive them unless the `Sampled` flag was set. | ||
| * `IsRecording` field of a `Span`. If `true` the current `Span` records tracing |
There was a problem hiding this comment.
| * `IsRecording` field of a `Span`. If `true` the current `Span` records tracing | |
| * `IsRecording` field of a `Span`. If `true` the current `Span` records in memory tracing |
There was a problem hiding this comment.
What is "in memory data"? I think the current wording (== the old wording) is more clear here. What would be more clear IMHO would be:
| * `IsRecording` field of a `Span`. If `true` the current `Span` records tracing | |
| * `IsRecording` field of a `Span`. If `false` the current `Span` discards all tracing |
and remove the "otherwise ...".
Co-authored-by: Yuri Shkuro <[email protected]>
Co-authored-by: Yuri Shkuro <[email protected]>
Co-authored-by: Yuri Shkuro <[email protected]>
Co-authored-by: Christian Neumüller <[email protected]>
Co-authored-by: Yuri Shkuro <[email protected]>
Co-authored-by: Christian Neumüller <[email protected]>
| processing. | ||
| specification](https://www.w3.org/TR/trace-context/#sampled-flag). This flag indicates that the `Span` has been | ||
| `sampled` and will be exported. [Span Exporters](#span-exporter) MUST | ||
| receive those spans which have `Sampled` flag set to true and they SHOULD NOT receive the ones |
There was a problem hiding this comment.
Since the text here is "SHOULD NOT" - it means the recommendation is to not call Exporters for Spans without Sampled flag set. Processors could still do it, and spec is not prohibiting it.
As we used "SHOULD NOT" here, do we still require additional explicit clarification here, or in the table that "Depending on the Processor, Exporter may still get span without Sampled flag set? @carlosalberto @Oberon00
There was a problem hiding this comment.
I don't think it's necessary but it would be nice. If you want, you can add a sentence to the built in span processors section that they MUST NOT call exporters for unsampled spans (unless explicitly requested).
There was a problem hiding this comment.
Let me address that as a follow up PR. I fear adding it might delay this PRs progress.
(Meanwhile I'll to figure out under what scenarios a user want to sent unsampled spans to exporter).
lzchen
left a comment
There was a problem hiding this comment.
Just curious, is IsRecording something that can be explicitly set by the user/instrumentations? I don't see anywhere in the API that actually gives the ability to change it. It doesn't seem to be a "must have" in span [creation](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#span-creation either.
|
IsRecording is set according to the sampling decision, see the spec of |
The only place which can set the |
|
@Oberon00 |
|
It goes both ways a bit. The sampler gets the parent SpanContext, which includes the parent Sampled flag, as input and can use that to influence the Decision it returns (see ParentBased sampler). But that decision, as you said, then determines the sampled+recorded flags of the child span. |
| The following table summarizes the expected behavior for each combination of | ||
| `IsRecording` and `SampledFlag`. | ||
|
|
||
| | `IsRecording` | `Sampled` Flag | Span Processor receives Span? | Span Exporter receives Span? | |
There was a problem hiding this comment.
Actually the third column is a change / additional specification, but I think it's good.
@cijothomas Can you add "Fixes #782" to the PR description?
| processing. | ||
| specification](https://www.w3.org/TR/trace-context/#sampled-flag). This flag indicates that the `Span` has been | ||
| `sampled` and will be exported. [Span Exporters](#span-exporter) MUST | ||
| receive those spans which have `Sampled` flag set to true and they SHOULD NOT receive the ones |
There was a problem hiding this comment.
I don't think it's necessary but it would be nice. If you want, you can add a sentence to the built in span processors section that they MUST NOT call exporters for unsampled spans (unless explicitly requested).
Co-authored-by: Christian Neumüller <[email protected]>
|
@yurishkuro I made more refactoring after initial approval- So re-requested review from you. (Also saw you as the assigned owner) |
|
@yurishkuro Please merge. |
…ry#871) * Add table summarizing sampler properties and processing * markdownlink * event -> data to avoid confusion with Event Co-authored-by: Yuri Shkuro <[email protected]> * events -> data Co-authored-by: Yuri Shkuro <[email protected]> * plural Co-authored-by: Yuri Shkuro <[email protected]> * use MUST Co-authored-by: Christian Neumüller <[email protected]> * Update specification/trace/sdk.md Co-authored-by: Yuri Shkuro <[email protected]> * Update specification/trace/sdk.md Co-authored-by: Christian Neumüller <[email protected]> * reword * spacing * more links fix * markdownl * Update specification/trace/sdk.md Co-authored-by: Christian Neumüller <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]> Co-authored-by: Christian Neumüller <[email protected]> Co-authored-by: Carlos Alberto Cortez <[email protected]>
Co-authored-by: Armin Ruech <[email protected]>
Fixes #782
No change to existing behavior. Just clarifying when does SpanProcessor and SpanExporters get Span, based on
IsRecordingandSampledflag, with a table to make it very obvious.Please provide a brief description of the changes here. Update the
CHANGELOG.mdfor non-trivial changes.Related issues #
Related oteps #