Skip to content

fix: Adds shutdown function for spans #2812

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

shivanshuraj1333
Copy link
Member

Fixes: #2779

@shivanshuraj1333 shivanshuraj1333 requested a review from a team as a code owner March 16, 2025 21:25
@shivanshuraj1333
Copy link
Member Author

After taking some inspirations from the logs PR https://github.com/open-telemetry/opentelemetry-rust/pull/2764/files
I have updated the trait, and not sure how to handle shutdown for tonic/trace.rs

@shivanshuraj1333 shivanshuraj1333 changed the title nit: adds shutdown function for spans fix: Adds shutdown function for spans Mar 18, 2025
@shivanshuraj1333 shivanshuraj1333 force-pushed the fix/issues/2779 branch 2 times, most recently from 1ed73b1 to 5be511b Compare March 18, 2025 12:33
Copy link

codecov bot commented Mar 18, 2025

Codecov Report

Attention: Patch coverage is 17.39130% with 19 lines in your changes missing coverage. Please review.

Project coverage is 80.8%. Comparing base (a711ae9) to head (48d5f5d).

Files with missing lines Patch % Lines
opentelemetry-otlp/src/exporter/tonic/trace.rs 0.0% 11 Missing ⚠️
opentelemetry-otlp/src/span.rs 0.0% 5 Missing ⚠️
opentelemetry-otlp/src/exporter/http/trace.rs 0.0% 1 Missing ⚠️
opentelemetry-sdk/src/trace/span_processor.rs 50.0% 1 Missing ⚠️
opentelemetry-stdout/src/trace/exporter.rs 0.0% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #2812     +/-   ##
=======================================
- Coverage   80.9%   80.8%   -0.1%     
=======================================
  Files        124     124             
  Lines      23726   23738     +12     
=======================================
+ Hits       19197   19200      +3     
- Misses      4529    4538      +9     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

None => Err(OTelSdkError::AlreadyShutdown), // `inner` was already `None`, meaning it's already shut down.
}
fn shutdown(&self) -> OTelSdkResult {
// match self.inner.take() {
Copy link
Member Author

Choose a reason for hiding this comment

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

need to make self mutable for this to work, shutdown for tonic needs to be implemented according to #2777

Copy link
Member

Choose a reason for hiding this comment

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

can you add a TODO here linking to the issue.

@shivanshuraj1333
Copy link
Member Author

shivanshuraj1333 commented Mar 18, 2025

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.
Please add changelog entry marking breaking change for custom processor/exporter authors

@@ -17,6 +17,10 @@
`Error` which contained many variants unrelated to building an exporter, the
new one returns specific variants applicable to building an exporter. Some
variants might be applicable only on select features.
- *Breaking*
Copy link
Member

Choose a reason for hiding this comment

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

this is not a breaking change for OTLP Exporter, just fixing bugs.

Copy link
Member

Choose a reason for hiding this comment

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

We need to list the breaking change in the SDK changelog. (You can check the previous entries there that did similar breaking changes)

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.

See https://github.com/open-telemetry/opentelemetry-rust/pull/2812/files

Blocking only to prevent merge while changelog is fixed.

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, once changelog is fixed.

Signed-off-by: Shivanshu Raj Shrivastava <[email protected]>
Signed-off-by: Shivanshu Raj Shrivastava <[email protected]>
Signed-off-by: Shivanshu Raj Shrivastava <[email protected]>
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.

SpanExporter shutdown
5 participants