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

feat: spec compliant sampling result support #1058

Merged
merged 10 commits into from
May 29, 2020

Conversation

legendecas
Copy link
Member

Which problem is this PR solving?

Short description of the changes

  • Add type api.SamplingResult.
  • Add api.Sampler.shouldSample additional parameters.

Copy link
Member

@mayurkale22 mayurkale22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, please address open comments.

@legendecas legendecas requested a review from mwear as a code owner May 24, 2020 11:29
@codecov
Copy link

codecov bot commented May 24, 2020

Codecov Report

Merging #1058 into master will decrease coverage by 0.04%.
The diff coverage is 85.71%.

@@            Coverage Diff             @@
##           master    #1058      +/-   ##
==========================================
- Coverage   92.32%   92.28%   -0.05%     
==========================================
  Files         115      116       +1     
  Lines        3389     3396       +7     
  Branches      683      686       +3     
==========================================
+ Hits         3129     3134       +5     
- Misses        260      262       +2     
Impacted Files Coverage Δ
...metry-core/src/trace/sampler/ProbabilitySampler.ts 84.21% <57.14%> (-9.91%) ⬇️
...ages/opentelemetry-api/src/trace/SamplingResult.ts 100.00% <100.00%> (ø)
packages/opentelemetry-tracing/src/Tracer.ts 100.00% <100.00%> (ø)

Copy link
Member

@dyladan dyladan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good so I'm going to approve it, but it should be noted that the parent handling in this will be replaced with the ParentOrElse sampler in #1075 and this will become a "dumb" probability sampler.

@legendecas
Copy link
Member Author

This looks good so I'm going to approve it, but it should be noted that the parent handling in this will be replaced with the ParentOrElse sampler in #1075 and this will become a "dumb" probability sampler.

Right. I can work on it in a follow-up PR.

shouldSample(
parentContext: SpanContext | undefined,
traceId: string,
spanId: string,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just so you know, spanId is going to be removed from the input to the sampler.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have any spec PR link to this? Do we expecting remove spanId in this PR?

Copy link
Member

@dyladan dyladan May 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have any spec PR link to this? Do we expecting remove spanId in this PR?

open-telemetry/opentelemetry-specification#621 just merged :)

The PR is named "spec compliant" so I would assume so ;)

Copy link
Member

@vmarchaud vmarchaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

shouldSample(
parentContext: SpanContext | undefined,
traceId: string,
spanId: string,
Copy link
Member

@dyladan dyladan May 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have any spec PR link to this? Do we expecting remove spanId in this PR?

open-telemetry/opentelemetry-specification#621 just merged :)

The PR is named "spec compliant" so I would assume so ;)

@mayurkale22 mayurkale22 requested a review from obecny May 29, 2020 17:46
@mayurkale22
Copy link
Member

@obecny I think all the comments has been addressed by the author. Could you please take a look again?

Copy link
Member

@obecny obecny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thx for changes

@mayurkale22 mayurkale22 merged commit e37f96a into open-telemetry:master May 29, 2020
@legendecas legendecas deleted the sampling-result branch May 31, 2020 06:36
dyladan pushed a commit to dyladan/opentelemetry-js that referenced this pull request Sep 9, 2022
pichlermarc pushed a commit to dynatrace-oss-contrib/opentelemetry-js that referenced this pull request Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spec compliant SamplingResult support
6 participants