Skip to content

Conversation

@scottgerring
Copy link
Member

More work for #2432. In this case we're adding coverage for using the batch log exporters from non-tokio main functions.

Changes

Please provide a brief description of the changes here.

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)

@scottgerring scottgerring marked this pull request as ready for review December 19, 2024 09:43
@scottgerring scottgerring requested a review from a team as a code owner December 19, 2024 09:43
@codecov
Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 76.1%. Comparing base (acf16ed) to head (a30e807).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
opentelemetry-zipkin/src/exporter/mod.rs 0.0% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #2455     +/-   ##
=======================================
- Coverage   76.1%   76.1%   -0.1%     
=======================================
  Files        122     122             
  Lines      22065   22066      +1     
=======================================
  Hits       16793   16793             
- Misses      5272    5273      +1     

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


struct MetadataMap<'a>(&'a mut tonic::metadata::MetadataMap);

impl<'a> Injector for MetadataMap<'a> {
Copy link
Member Author

Choose a reason for hiding this comment

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

I applied clippy fixes and it wants to elide this lifecycle 🤷

struct MetadataMap<'a>(&'a tonic::metadata::MetadataMap);

impl<'a> Extractor for MetadataMap<'a> {
impl Extractor for MetadataMap<'_> {
Copy link
Member Author

Choose a reason for hiding this comment

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

... and this one

struct ValueVisitor(Option<AnyValue>);

impl<'kvs> log::kv::VisitValue<'kvs> for ValueVisitor {
impl log::kv::VisitValue<'_> for ValueVisitor {
Copy link
Member Author

Choose a reason for hiding this comment

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

... and this one.
I can remove these, but we should probably start enforcing this in CI anyway, I reckon :D

}

#[test]
#[cfg(any(feature = "tonic-client", feature = "reqwest-blocking-client"))]
Copy link
Member Author

Choose a reason for hiding this comment

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

@cijothomas here's the new test. I took advantage of the temporary tokio runtime to setup the collector too.


unsafe impl<'a> Send for UnsafeSlice<'a> {}
unsafe impl<'a> Sync for UnsafeSlice<'a> {}
unsafe impl Send for UnsafeSlice<'_> {}
Copy link
Member Author

Choose a reason for hiding this comment

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

More elision

@scottgerring
Copy link
Member Author

@cijothomas , works on my machine ;) Needs the integration tests label applied here to confirm then I reckon it's good!

let logger_provider = rt.block_on(async {
// While we're here setup our collector container too, as this needs tokio to run
test_utils::start_collector_container().await?;
init_logs()
Copy link
Member

Choose a reason for hiding this comment

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

nit - will it make sense to have two different tests, with init_logs being called within tokio runtime only for tonic-client ?

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.

Thanks.

@lalitb lalitb added the integration tests Run integration tests label Dec 19, 2024
@cijothomas cijothomas merged commit 0fc0764 into open-telemetry:main Dec 19, 2024
22 of 23 checks passed
@scottgerring scottgerring deleted the chore/test-sync-exporters branch December 19, 2024 17:06
bantonsson pushed a commit to bantonsson/opentelemetry-rust that referenced this pull request Oct 9, 2025
bantonsson pushed a commit to bantonsson/opentelemetry-rust that referenced this pull request Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration tests Run integration tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants