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

Spec compliant SamplingResult support #1033

Closed
legendecas opened this issue May 7, 2020 · 1 comment · Fixed by #1058
Closed

Spec compliant SamplingResult support #1033

legendecas opened this issue May 7, 2020 · 1 comment · Fixed by #1058
Assignees

Comments

@legendecas
Copy link
Member

legendecas commented May 7, 2020

According to spec here about span sampling (https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/sdk.md#sampling), there are three flags representing how a span was exported:

  1. NOT_RECORD, same as https://github.com/open-telemetry/opentelemetry-js/blob/master/packages/opentelemetry-api/src/trace/trace_flags.ts#L22, do nothing with the span.
  2. RECORD, record span events but do not export span.
  3. RECORD_AND_SAMPLED, record span events, and export span.

As for now, api.Sampler.shouldSample returns a boolean, representing sampling or not. It should return an enum to support all flags in spec.

@legendecas
Copy link
Member Author

Ah.. just noticed a TODO in the code doc. Anyway, I'm going for this.

@dyladan dyladan added this to Confirmed in Spec Compliance May 14, 2020
pichlermarc pushed a commit to dynatrace-oss-contrib/opentelemetry-js that referenced this issue Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Spec Compliance
Required by Spec
Development

Successfully merging a pull request may close this issue.

2 participants