Skip to content

Add context handling to sinks in consumertest #13048

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
merged 4 commits into from
May 21, 2025

Conversation

vignesh-codes
Copy link
Contributor

Description

This PR enhances the consumertest.Sink types (TracesSink, MetricsSink, LogsSink, ProfilesSink) to store and expose request contexts during consumption

Changes include:

  • Added context storage to all sink types
  • Added AllContexts() method to retrieve stored contexts
  • Updated Reset() to clear stored contexts
  • Added comprehensive tests for context transformation verification

Link to tracking issue

Fixes #13039

Testing

Added new test cases to verify context handling:

  • TestSinkContextTransformation: Verifies context preservation across all sink types
  • TestContextTransformationChain: Tests complex chains of context transformations
  • TestConcurrentContextTransformations: Ensures thread-safe context handling
  • Added context verification to existing sink tests

Documentation

@vignesh-codes vignesh-codes requested a review from a team as a code owner May 18, 2025 00:41
@vignesh-codes vignesh-codes requested a review from jmacd May 18, 2025 00:41
Copy link

linux-foundation-easycla bot commented May 18, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@vignesh-codes
Copy link
Contributor Author

Do we need changelog entry?

@dmathieu
Copy link
Member

Do we need changelog entry?

This changes the package's public API, so yes.

Copy link

codecov bot commented May 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.55%. Comparing base (4a5e154) to head (eaa50b7).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13048      +/-   ##
==========================================
+ Coverage   91.54%   91.55%   +0.01%     
==========================================
  Files         504      504              
  Lines       28157    28192      +35     
==========================================
+ Hits        25775    25810      +35     
  Misses       1873     1873              
  Partials      509      509              

☔ 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.

@vignesh-codes vignesh-codes requested a review from dmathieu May 20, 2025 07:06
@mx-psi mx-psi added this pull request to the merge queue May 21, 2025
Merged via the queue into open-telemetry:main with commit 2527d36 May 21, 2025
55 checks passed
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.

(consumertest) Allow access to request context in sinks
3 participants