open-telemetry / opentelemetry-cpp

The OpenTelemetry C++ Client
https://opentelemetry.io/
Apache License 2.0
890 stars 426 forks source link

[SDK] Add tracer scope configurator #3137

Open psx95 opened 1 week ago

psx95 commented 1 week ago

Re #2641

Adds scope configurator for Tracers.

Changes

Some optional, good-to-have convenience functions were recommended by the spec to accommodate common use-cases - these have not been added in this PR.

See the TracerConfigurator spec for these recommendations. They should be added in a future PR.

For significant contributions please make sure you have completed the following items:

netlify[bot] commented 1 week ago

Deploy Preview for opentelemetry-cpp-api-docs canceled.

Name Link
Latest commit 2329279b2658eacbbdf6e5c5a0c89b573c31bba9
Latest deploy log https://app.netlify.com/sites/opentelemetry-cpp-api-docs/deploys/673ba561a4a91f00082fc899
codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 86.04651% with 6 lines in your changes missing coverage. Please review.

Project coverage is 87.81%. Comparing base (a388e87) to head (2329279).

Files with missing lines Patch % Lines
sdk/src/trace/tracer_provider_factory.cc 50.00% 6 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/3137/graphs/tree.svg?width=650&height=150&src=pr&token=FJESTYQ2AD&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/3137?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) ```diff @@ Coverage Diff @@ ## main #3137 +/- ## ========================================== - Coverage 87.83% 87.81% -0.02% ========================================== Files 195 197 +2 Lines 6146 6176 +30 ========================================== + Hits 5398 5423 +25 - Misses 748 753 +5 ``` | [Files with missing lines](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/3137?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | Coverage Δ | | |---|---|---| | [...y/sdk/instrumentationscope/instrumentation\_scope.h](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/3137?src=pr&el=tree&filepath=sdk%2Finclude%2Fopentelemetry%2Fsdk%2Finstrumentationscope%2Finstrumentation_scope.h&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c2RrL2luY2x1ZGUvb3BlbnRlbGVtZXRyeS9zZGsvaW5zdHJ1bWVudGF0aW9uc2NvcGUvaW5zdHJ1bWVudGF0aW9uX3Njb3BlLmg=) | `100.00% <ø> (ø)` | | | [sdk/include/opentelemetry/sdk/trace/tracer.h](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/3137?src=pr&el=tree&filepath=sdk%2Finclude%2Fopentelemetry%2Fsdk%2Ftrace%2Ftracer.h&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c2RrL2luY2x1ZGUvb3BlbnRlbGVtZXRyeS9zZGsvdHJhY2UvdHJhY2VyLmg=) | `100.00% <ø> (ø)` | | | [...dk/include/opentelemetry/sdk/trace/tracer\_config.h](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/3137?src=pr&el=tree&filepath=sdk%2Finclude%2Fopentelemetry%2Fsdk%2Ftrace%2Ftracer_config.h&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c2RrL2luY2x1ZGUvb3BlbnRlbGVtZXRyeS9zZGsvdHJhY2UvdHJhY2VyX2NvbmZpZy5o) | `100.00% <100.00%> (ø)` | | | [...k/include/opentelemetry/sdk/trace/tracer\_context.h](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/3137?src=pr&el=tree&filepath=sdk%2Finclude%2Fopentelemetry%2Fsdk%2Ftrace%2Ftracer_context.h&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c2RrL2luY2x1ZGUvb3BlbnRlbGVtZXRyeS9zZGsvdHJhY2UvdHJhY2VyX2NvbnRleHQuaA==) | `100.00% <ø> (ø)` | | | [sdk/src/trace/tracer.cc](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/3137?src=pr&el=tree&filepath=sdk%2Fsrc%2Ftrace%2Ftracer.cc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c2RrL3NyYy90cmFjZS90cmFjZXIuY2M=) | `83.34% <100.00%> (+0.88%)` | :arrow_up: | | [sdk/src/trace/tracer\_config.cc](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/3137?src=pr&el=tree&filepath=sdk%2Fsrc%2Ftrace%2Ftracer_config.cc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c2RrL3NyYy90cmFjZS90cmFjZXJfY29uZmlnLmNj) | `100.00% <100.00%> (ø)` | | | [sdk/src/trace/tracer\_context.cc](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/3137?src=pr&el=tree&filepath=sdk%2Fsrc%2Ftrace%2Ftracer_context.cc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c2RrL3NyYy90cmFjZS90cmFjZXJfY29udGV4dC5jYw==) | `84.00% <100.00%> (+2.19%)` | :arrow_up: | | [sdk/src/trace/tracer\_provider.cc](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/3137?src=pr&el=tree&filepath=sdk%2Fsrc%2Ftrace%2Ftracer_provider.cc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c2RrL3NyYy90cmFjZS90cmFjZXJfcHJvdmlkZXIuY2M=) | `89.14% <100.00%> (ø)` | | | [sdk/src/trace/tracer\_provider\_factory.cc](https://app.codecov.io/gh/open-telemetry/opentelemetry-cpp/pull/3137?src=pr&el=tree&filepath=sdk%2Fsrc%2Ftrace%2Ftracer_provider_factory.cc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c2RrL3NyYy90cmFjZS90cmFjZXJfcHJvdmlkZXJfZmFjdG9yeS5jYw==) | `46.16% <50.00%> (+1.33%)` | :arrow_up: |

🚨 Try these New Features:

psx95 commented 4 days ago

Thanks for the detailed review, I will go over the suggestions and make necessary changes.