Skip to content

feat: user-events logs exporter - add support for Resource attributes #288

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

Merged

Conversation

cijothomas
Copy link
Member

@cijothomas cijothomas commented Jun 5, 2025

Adding opt-in support for Resource attributes.

Copy link

codecov bot commented Jun 5, 2025

Codecov Report

Attention: Patch coverage is 20.96774% with 49 lines in your changes missing coverage. Please review.

Project coverage is 48.1%. Comparing base (a06d318) to head (6c895a7).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...pentelemetry-user-events-logs/src/logs/exporter.rs 20.5% 27 Missing ⚠️
opentelemetry-user-events-logs/src/lib.rs 0.0% 16 Missing ⚠️
...entelemetry-user-events-logs/src/logs/processor.rs 50.0% 6 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main    #288     +/-   ##
=======================================
- Coverage   48.3%   48.1%   -0.2%     
=======================================
  Files         69      69             
  Lines       9479    9529     +50     
=======================================
+ Hits        4581    4589      +8     
- Misses      4898    4940     +42     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cijothomas cijothomas requested a review from Copilot July 11, 2025 17:46
@cijothomas cijothomas marked this pull request as ready for review July 11, 2025 17:46
@cijothomas cijothomas requested a review from a team as a code owner July 11, 2025 17:46
@cijothomas cijothomas changed the title user-events logs exporter - add support for Resource attributes feat: user-events logs exporter - add support for Resource attributes Jul 11, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds optional Resource attribute forwarding to the user-events log exporter, allowing selected Resource keys to be emitted alongside each log.

  • Extends ProcessorBuilder with a with_resource_attributes option and passes chosen keys to the exporter
  • Updates UserEventsExporter to store, convert, and include those Resource attributes in PartC of the event payload
  • Adjusts tests and changelog to cover the new feature

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/logs/processor.rs Added resource_attributes field, with_resource_attributes builder, and new constructor parameter
src/logs/exporter.rs Extended exporter state, set_resource logic, PartC emission, and conversion helper
src/lib.rs Updated test setup to configure and assert on resource attributes
CHANGELOG.md Documented the new with_resource_attributes method
Comments suppressed due to low confidence (1)

opentelemetry-user-events-logs/src/logs/exporter.rs:22

  • The code refers to Key and AnyValue on this line but neither is imported. Add use opentelemetry::Key; and import AnyValue from the crate where it's defined (e.g. use eventheader::AnyValue;) so the code compiles.
    attributes_from_resource: Vec<(Key, AnyValue)>,

@cijothomas cijothomas merged commit d2d408e into open-telemetry:main Jul 17, 2025
21 of 22 checks passed
@cijothomas cijothomas deleted the cijothomas/userevents-resource branch July 17, 2025 17:05
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.

3 participants