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

Pull sampling probability from env var #737

Merged
merged 1 commit into from Feb 22, 2022

Conversation

jbtrystram
Copy link
Contributor

@jbtrystram jbtrystram commented Feb 15, 2022

Pull sampling probability from env var OTEL_TRACES_SAMPLER_ARG in the default sdk config
I could not find an enum with the expected values strings, so I hard coded them in there, if I missed the file please let me know !

Tho whomever may review this : The spec states the following :

For variables accepting an enum value, if the user provides a value the SDK does not recognize, the SDK MUST generate a warning and gracefully ignore the setting.

this why I added some calls to log but it looks like no logger is initialized. Should I add a logger to the crate ? Thanks for your guidance

Signed-off-by: jbtrystram jbtrystram@redhat.com

@jbtrystram jbtrystram requested a review from a team as a code owner February 15, 2022 13:26
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 15, 2022

CLA Signed

The committers are authorized under a signed CLA.

  • ✅ Jean-Baptiste Trystram (9393807)

@TommyCpp
Copy link
Contributor

TommyCpp commented Feb 15, 2022

Hi 👋 Thanks for the contribution. We are currently avoiding using log directly as open telemetry includes log support so at some point this repo will implement the log facade. Usually, we just use eprintln! for warning or logging.

Also, you can run precommit.sh script in the root path of the project to help format the code and identity any lint issue.

@jbtrystram jbtrystram force-pushed the feature/sampler_from_env branch 2 times, most recently from 7c73589 to 66f9039 Compare February 16, 2022 08:44
@jbtrystram
Copy link
Contributor Author

@TommyCpp thanks for the tips. This should be good but i can't run the CI !

@codecov
Copy link

codecov bot commented Feb 16, 2022

Codecov Report

Merging #737 (20917dd) into main (e108b1e) will decrease coverage by 1.42%.
The diff coverage is 37.74%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #737      +/-   ##
==========================================
- Coverage   71.54%   70.12%   -1.43%     
==========================================
  Files         102      108       +6     
  Lines        8611     8806     +195     
==========================================
+ Hits         6161     6175      +14     
- Misses       2450     2631     +181     
Impacted Files Coverage Δ
opentelemetry-api/src/attributes/encoder.rs 0.00% <ø> (ø)
opentelemetry-api/src/attributes/mod.rs 41.93% <ø> (ø)
opentelemetry-api/src/baggage.rs 84.56% <ø> (ø)
opentelemetry-api/src/global/error_handler.rs 42.10% <ø> (ø)
opentelemetry-api/src/global/metrics.rs 83.33% <ø> (ø)
opentelemetry-api/src/global/trace.rs 35.89% <ø> (ø)
opentelemetry-api/src/metrics/async_instrument.rs 0.00% <ø> (ø)
opentelemetry-api/src/metrics/config.rs 50.00% <ø> (ø)
opentelemetry-api/src/metrics/counter.rs 100.00% <ø> (ø)
opentelemetry-api/src/metrics/descriptor.rs 71.69% <ø> (ø)
... and 87 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dacd75a...20917dd. Read the comment docs.

@jbtrystram jbtrystram force-pushed the feature/sampler_from_env branch 3 times, most recently from c2ee2a6 to 8715175 Compare February 21, 2022 10:31
…he default sdk config

Signed-off-by: jbtrystram <jbtrystram@redhat.com>
@jtescher jtescher merged commit f282659 into open-telemetry:main Feb 22, 2022
@jbtrystram jbtrystram deleted the feature/sampler_from_env branch February 22, 2022 09:06
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.

None yet

3 participants