open-telemetry / opentelemetry-rust-contrib

OpenTelemetry Contrib Packages for Rust
Apache License 2.0
29 stars 29 forks source link

Implement ETW exporter for metrics #43

Closed mattbodd closed 4 months ago

mattbodd commented 4 months ago

Fixes #16 Design discussion issue (if applicable) #

Changes

Implements an ETW (Event Tracing for Windows) exporter. This implementation heavily borrows the design patterns of the opentelemetry-user-events metrics exporter and swaps user_event APIs for ETW APIs provided by the tracelogging_dynamic crate.

Merge requirement checklist

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 38.38384% with 61 lines in your changes are missing coverage. Please review.

Project coverage is 50.3%. Comparing base (6ede632) to head (36d60bb).

Files Patch % Lines
opentelemetry-etw-metrics/src/exporter/mod.rs 0.0% 43 Missing :warning:
opentelemetry-etw-metrics/src/etw/mod.rs 67.8% 18 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #43 +/- ## ======================================= - Coverage 50.6% 50.3% -0.3% ======================================= Files 30 32 +2 Lines 4287 4386 +99 ======================================= + Hits 2171 2209 +38 - Misses 2116 2177 +61 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

lalitb commented 4 months ago

This looks awesome. Thanks for contributing :) In the future, we can explore consolidating the functionalities of both user-events and ETW into a single crate (say) opentelemetry-geneva-metrics-exporter, the common serialization logic can be reused, and select the transport protocol—ETW for Windows or user_events for Unix-like systems-- during build based on the platform. Just some thoughts :)

mattbodd commented 4 months ago

This looks awesome. Thanks for contributing :) In the future, we can explore consolidating the functionalities of both user-events and ETW into a single crate (say) opentelemetry-geneva-metrics-exporter, the common serialization logic can be reused, and select the transport protocol—ETW for Windows or user_events for Unix-like systems-- during build based on the platform. Just some thoughts :)

I like this direction and would be happy to follow up with a PR to merge the two functionalities into a single crate. Does that sound ok?

lalitb commented 4 months ago

I like this direction and would be happy to follow up with a PR to merge the two functionalities into a single crate. Does that sound ok?

Yes, let's discuss more internally before finalizing it.