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

chore: remove the global::shutdown_tracer_provider function #2369

Merged

Conversation

pitoniak32
Copy link
Contributor

@pitoniak32 pitoniak32 commented Dec 1, 2024

related to: #1961

Changes

Removing the opentelemetry::global::shutdown_tracer_provider(). This should no longer be in the API, making tracing consistent with logs and metrics.

Migration Guide

the opentelemetry::global::shutdown_tracer_provider() is no longer available, to shutdown the TracerProvider properly you will need to have access to the provider and call the shutdown() function.

example:

    let provider = init_tracer();
-   opentelemetry::global::shutdown_tracer_provider();
+   provider.shutdown()?;

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@pitoniak32 pitoniak32 requested a review from a team as a code owner December 1, 2024 20:42
Copy link

codecov bot commented Dec 1, 2024

Codecov Report

Attention: Patch coverage is 0% with 33 lines in your changes missing coverage. Please review.

Project coverage is 79.4%. Comparing base (b35c0d6) to head (b93e711).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
opentelemetry-sdk/src/trace/runtime_tests.rs 0.0% 22 Missing ⚠️
opentelemetry-zipkin/src/exporter/mod.rs 0.0% 11 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #2369     +/-   ##
=======================================
- Coverage   79.5%   79.4%   -0.1%     
=======================================
  Files        123     123             
  Lines      21473   21479      +6     
=======================================
- Hits       17078   17064     -14     
- Misses      4395    4415     +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -141,7 +141,9 @@ impl ZipkinPipelineBuilder {

/// Install the Zipkin trace exporter pipeline with a simple span processor.
#[allow(deprecated)]
pub fn install_simple(mut self) -> Result<Tracer, TraceError> {
pub fn install_simple(
Copy link
Member

@lalitb lalitb Dec 2, 2024

Choose a reason for hiding this comment

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

not related to this PR - but ZipkinPipelineBuilder should be replaced with ZipkinBuilder and the implementation should be made consistent to OTLP as done in #2221. The crate be only responsible to provide builder to create Zipkin exporter, and no convenience wrappers to create TracerProvider / Processors.

@lalitb
Copy link
Member

lalitb commented Dec 2, 2024

Thanks, nicely done. Can you also update the CHANGELOG for opentelemetry crate as this is a breaking change. CI lint failure doesn't look to be related to this PR, but coming from the latest stable toolchain v1.83 released on 28th Nov. I will have a look if no one is checking.

@pitoniak32
Copy link
Contributor Author

Thanks, nicely done. Can you also update the CHANGELOG for opentelemetry crate as this is a breaking change.

I'll update as soon as I'm at my computer again 👍

Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

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

LGTM with a changelog entry for the breaking change. Also PR desc can be updated to show how users can migrate.

@pitoniak32 pitoniak32 force-pushed the feat/remove-global-trace-shutdown branch from 994b31e to d13bf93 Compare December 4, 2024 13:11
@pitoniak32 pitoniak32 force-pushed the feat/remove-global-trace-shutdown branch from d13bf93 to b93e711 Compare December 4, 2024 13:13
@cijothomas cijothomas merged commit 6d1a765 into open-telemetry:main Dec 4, 2024
21 of 23 checks passed
@pitoniak32 pitoniak32 deleted the feat/remove-global-trace-shutdown branch December 5, 2024 00:49
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.

3 participants