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

Fix #1867 Orderly shutdown in examples #1868

Merged
merged 3 commits into from
Jan 4, 2023

Conversation

marcalff
Copy link
Member

Fixes #1867

Changes

Implemented explicit cleanup for:

  • The global Tracer provider
  • The global Meter provider
  • The global Logger provider

in examples.

This is needed to shutdown opentelemetry-cpp in a controlled way.

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@marcalff marcalff requested a review from a team December 14, 2022 23:09
@codecov
Copy link

codecov bot commented Dec 14, 2022

Codecov Report

Merging #1868 (a3f3373) into main (d5f0c48) will decrease coverage by 0.08%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1868      +/-   ##
==========================================
- Coverage   85.80%   85.72%   -0.07%     
==========================================
  Files         171      171              
  Lines        5243     5243              
==========================================
- Hits         4498     4494       -4     
- Misses        745      749       +4     
Impacted Files Coverage Δ
ext/src/http/client/curl/http_client_curl.cc 80.31% <0.00%> (-1.13%) ⬇️
sdk/src/trace/batch_span_processor.cc 90.70% <0.00%> (-0.77%) ⬇️

@marcalff marcalff marked this pull request as draft December 15, 2022 14:44
Copy link
Member

@lalitb lalitb left a comment

Choose a reason for hiding this comment

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

LGTM

@marcalff marcalff marked this pull request as ready for review January 3, 2023 19:21
@marcalff
Copy link
Member Author

marcalff commented Jan 3, 2023

Changed this PR as ready for review, and ready for merge:

  • the cleanup has merits on its own, cleaning up the signal provider singleton before shutting down,
  • the explicit sdk::init() and sdk::cleanup() calls, discussed and needed for other reasons, will be introduced with another PR, with separate review and discussion.
  • the two are orthogonal in my opinion, so this PR can be merged independently.

@lalitb lalitb merged commit a343da0 into open-telemetry:main Jan 4, 2023
@ThomsonTan
Copy link
Contributor

Do we still need sdk::init() and sdk::cleanup()? I think yes?

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.

[EXAMPLE] The otlp_http client crashes on exit
4 participants