Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #142 +/- ##
==========================================
+ Coverage 93.61% 93.75% +0.13%
==========================================
Files 71 74 +3
Lines 1754 1792 +38
==========================================
+ Hits 1642 1680 +38
Misses 112 112
|
oulin-coder
approved these changes
Jul 1, 2020
pyohannes
reviewed
Jul 6, 2020
pyohannes
reviewed
Jul 8, 2020
| * A placeholder class that stores the states of a span. | ||
| * Will be replaced by the real SpanContext class once it is implemented. | ||
| */ | ||
| class Sampler::SpanContext |
Contributor
There was a problem hiding this comment.
|
|
||
| private: | ||
| std::shared_ptr<Sampler> delegate_sampler_; | ||
| std::string description_; |
Contributor
There was a problem hiding this comment.
We could make both members const, as there's no way to change them.
| { | ||
| return {Decision::NOT_RECORD, nullptr}; | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
We could flatten this out, to increase readability:
if (parent_context == nullptr)
{
return delegate_sampler_->ShouldSample(parent_context, trace_id, name, span_kind, attributes);
}
if (parent_context->sampled_flag)
{
return {Decision::RECORD_AND_SAMPLE, nullptr};
}
return {Decision::NOT_RECORD, nullptr};
pyohannes
approved these changes
Jul 9, 2020
Contributor
pyohannes
left a comment
There was a problem hiding this comment.
Looks good. Extracting the SpanContext class will happen in a separate PR.
Contributor
|
@reyang this should be ready to merge. |
reyang
reviewed
Jul 9, 2020
| } | ||
| } // namespace trace | ||
| } // namespace sdk | ||
| OPENTELEMETRY_END_NAMESPACE No newline at end of file |
Member
There was a problem hiding this comment.
nit: would you add an empty line before EOF?
reyang
reviewed
Jul 9, 2020
| bool is_recording; | ||
| bool sampled_flag; | ||
| }; | ||
| /** |
Member
There was a problem hiding this comment.
nit: probably add an empty line here.
Member
|
Please rebase after fixing the nits. |
Closed
GerHobbelt
pushed a commit
to GerHobbelt/opentelemetry-cpp
that referenced
this pull request
Jun 17, 2025
Update dependency platforms to v0.0.11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Create a ParentOrElse sampler and corresponding test cases described in the spec.