-
Notifications
You must be signed in to change notification settings - Fork 65
feat: Add support for Resource attributes in ETW logs exporter #410
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: cijothomas <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #410 +/- ##
=======================================
+ Coverage 48.1% 48.6% +0.5%
=======================================
Files 69 69
Lines 9810 9919 +109
=======================================
+ Hits 4719 4824 +105
- Misses 5091 5095 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
/easycla |
@copilot There are lint failures. Analyze and fix them. You can run |
Co-authored-by: cijothomas <[email protected]>
Fixed all formatting issues by running |
This PR adds support for exporting Resource attributes with each log record in the opentelemetry-etw-logs crate, following the same pattern implemented in PR #288 for opentelemetry-user-events-logs.
Background
Previously, the ETW logs exporter only automatically exported two specific resource attributes:
service.name
→ exported ascloud.roleName
in PartA of Common Schemaservice.instance.id
→ exported ascloud.roleInstance
in PartA of Common SchemaAll other resource attributes were ignored, limiting the ability to include additional context with log records.
Changes
New API
Added a
with_resource_attributes()
method to theProcessorBuilder
that allows users to specify which resource attributes should be exported with each log record:Implementation Details
service.name
andservice.instance.id
is preservedValue
toAnyValue
is handledPerformance Considerations
The implementation includes comprehensive documentation about performance implications, as resource attributes are serialized with every log record (unlike OTLP exporters where they're sent once per batch).
Documentation
Added extensive documentation with:
Testing
Backward Compatibility
This change is fully backward compatible. Existing code will continue to work unchanged, with only the default resource attributes (
service.name
andservice.instance.id
) being exported as before.Fixes #409.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.