Skip to content
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

Sampling API needs to be revisited #273

Closed
lmolkova opened this issue Oct 11, 2019 · 3 comments · Fixed by #369
Closed

Sampling API needs to be revisited #273

lmolkova opened this issue Oct 11, 2019 · 3 comments · Fixed by #369
Assignees
Labels
pkg:OpenTelemetry.Api Issues related to OpenTelemetry.Api NuGet package

Comments

@lmolkova
Copy link

https://github.com/open-telemetry/oteps/blob/master/text/0006-sampling.md

@lmolkova
Copy link
Author

this was accidentally closed via PR. There are more changes coming through OTEP, so let's keep it open.

Also, spec now asks to have extra config for probability sampler

The default behavior is to apply the sampling probability only for Spans that are root spans (no parent) and Spans with remote parent. However there should be configuration to change this to "root spans only", or "all spans".

@lmolkova lmolkova reopened this Dec 13, 2019
@lmolkova lmolkova added the pkg:OpenTelemetry.Api Issues related to OpenTelemetry.Api NuGet package label Jan 23, 2020
@SergeyKanzhelev SergeyKanzhelev self-assigned this Mar 4, 2020
@CodeBlanch
Copy link
Member

@cijothomas @rajkumar-rangaraj FYI I'm working on bringing us up to spec as it is right now with regard to Probability & ParentOrElse sampler. Should have a PR up soon, just working on tests.

Probability

  • The ProbabilitySampler MUST ignore the parent SampledFlag.
    To respect the parent SampledFlag, the ProbabilitySampler should be used as a delegate of the ParentOrElse sampler specified below.
  • Description MUST be ProbabilitySampler{0.000100}.

TODO: Add details about how the ProbabilitySampler is implemented as a function
of the TraceID.

ParentOrElse

  • This is a composite sampler. ParentOrElse(delegateSampler) either respects the parent span's sampling decision or delegates to delegateSampler for root spans.
  • If parent exists:
    • If parent's SampledFlag is set to true returns RECORD_AND_SAMPLED
    • If parent's SampledFlag is set to false returns NOT_RECORD
  • If no parent (root span) exists returns the result of the delegateSampler.
  • Description MUST be ParentOrElse{delegateSampler.getDescription()}.
Parent ParentOrElse(delegateSampler)
Exists and SampledFlag is true RECORD_AND_SAMPLED
Exists and SampledFlag is false NOT_RECORD
No parent(root spans) Result of delegateSampler()

@CodeBlanch CodeBlanch mentioned this issue Jul 20, 2020
2 tasks
@reyang reyang removed this from the v0.3 milestone Jul 27, 2020
@cijothomas
Copy link
Member

Closing in favor of: #941

Yun-Ting pushed a commit to Yun-Ting/opentelemetry-dotnet that referenced this issue Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:OpenTelemetry.Api Issues related to OpenTelemetry.Api NuGet package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants