Skip to content

Add sampler header file#118

Merged
reyang merged 31 commits into
open-telemetry:masterfrom
ziqizh:sampling-api-header
Jun 23, 2020
Merged

Add sampler header file#118
reyang merged 31 commits into
open-telemetry:masterfrom
ziqizh:sampling-api-header

Conversation

@ziqizh
Copy link
Copy Markdown
Contributor

@ziqizh ziqizh commented Jun 17, 2020

@ziqizh ziqizh requested a review from a team June 17, 2020 02:21
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Jun 17, 2020

CLA Check
The committers are authorized under a signed CLA.

@ziqizh ziqizh marked this pull request as draft June 17, 2020 02:21
Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h Outdated
Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h Outdated
Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h Outdated
Copy link
Copy Markdown
Contributor

@pyohannes pyohannes left a comment

Choose a reason for hiding this comment

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

This is a good start.

Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h Outdated
Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h Outdated
Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h Outdated
Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h Outdated
Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h Outdated
Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h Outdated
Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h Outdated
Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h Outdated
@ziqizh ziqizh closed this Jun 17, 2020
@ziqizh ziqizh reopened this Jun 17, 2020
Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h Outdated
Copy link
Copy Markdown
Member

@reyang reyang left a comment

Choose a reason for hiding this comment

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

Overall looks good to me, might need to wait for the attributes PR #117.

@ziqizh ziqizh marked this pull request as ready for review June 17, 2020 19:29
@ziqizh
Copy link
Copy Markdown
Contributor Author

ziqizh commented Jun 17, 2020

I signed it

Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h Outdated
Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h
Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h Outdated
@ziqizh ziqizh mentioned this pull request Jun 19, 2020
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 22, 2020

Codecov Report

Merging #118 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #118   +/-   ##
=======================================
  Coverage   93.29%   93.29%           
=======================================
  Files          66       66           
  Lines        1656     1656           
=======================================
  Hits         1545     1545           
  Misses        111      111           

* A key/value pair that can be used to set attributes.
*/
struct AttributeKeyValue {
nostd::string_view key;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Storing a string_view has some pitfalls - string_view is essentially a pointer to an underlying string, so it relies on the underlying string value to outlive the string_view's lifetime. If "key" isn't too large, I recommend just storing it as a string.

Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h Outdated
Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h Outdated
Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h Outdated
Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h
Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h
Copy link
Copy Markdown
Contributor

@pyohannes pyohannes left a comment

Choose a reason for hiding this comment

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

I have two more nits regarding the doc strings, otherwise this looks good to me. The TODOs for Links and SpanContext can remain, as this is work that still needs to be done and is not part of this PR.

Also, there is no more dependency on #117 any more, so this can be merged as soon as the doc strings are addressed.

Great job!

Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h Outdated
Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h
Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h Outdated
@nholbrook nholbrook mentioned this pull request Jun 23, 2020
Copy link
Copy Markdown
Contributor

@pyohannes pyohannes left a comment

Choose a reason for hiding this comment

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

A few more nits. Please make sure you rebase. Then I think this is ready to be merged.

Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h Outdated
Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h Outdated
Comment thread sdk/include/opentelemetry/sdk/trace/sampler.h Outdated
@pyohannes
Copy link
Copy Markdown
Contributor

Looks all good from my side and ready to merge. @reyang

@reyang
Copy link
Copy Markdown
Member

reyang commented Jun 23, 2020

LGTM, will merge after CI finished.

@ziqizh
Copy link
Copy Markdown
Contributor Author

ziqizh commented Jun 23, 2020

LGTM, will merge after CI finished.

  1. Should I change the attributes in SamplingResult from unique_ptr<map> to unique_ptr<const map> since the spec requires attributes to be immutable?
  2. I don't have authorization to merge this PR. Do I need to apply for a maintainer role?

@reyang reyang merged commit 70d86d5 into open-telemetry:master Jun 23, 2020
@reyang
Copy link
Copy Markdown
Member

reyang commented Jun 24, 2020

  1. Should I change the attributes in SamplingResult from unique_ptr<map> to unique_ptr<const map> since the spec requires attributes to be immutable?

This seems to be a nice to have thing. On the other side, I'm guessing even with a const map, the actual value are not guaranteed to be const?

  1. I don't have authorization to merge this PR. Do I need to apply for a maintainer role?

Nope.

@nholbrook nholbrook mentioned this pull request Jun 30, 2020
@reyang reyang mentioned this pull request Aug 25, 2020
GerHobbelt pushed a commit to GerHobbelt/opentelemetry-cpp that referenced this pull request Jun 17, 2025
[SEMANTIC CONVENTIONS] Upgrade to weaver 0.11.0 (open-telemetry#3194)
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.

5 participants