opentelemetry-collector/consumer
Vignesh (Vinn) 2527d36934
Add context handling to sinks in consumertest (#13048)
#### 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](https://github.com/open-telemetry/opentelemetry-collector/issues/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
2025-05-21 15:29:28 +00:00
..
consumererror Update module google.golang.org/grpc to v1.72.1 (#13053) 2025-05-20 15:24:25 +00:00
consumertest Add context handling to sinks in consumertest (#13048) 2025-05-21 15:29:28 +00:00
internal Avoid public APIs with internal params in custom Options (#11054) 2024-09-17 13:08:41 -07:00
xconsumer Update module google.golang.org/grpc to v1.72.1 (#13053) 2025-05-20 15:24:25 +00:00
Makefile [consumer] split consumer into its own module (#6557) 2022-11-16 13:20:02 -08:00
consumer.go Avoid public APIs with internal params in custom Options (#11054) 2024-09-17 13:08:41 -07:00
doc.go [chore] some doc changes to consumer package (#9150) 2023-12-19 16:02:25 -08:00
go.mod Update module google.golang.org/grpc to v1.72.1 (#13053) 2025-05-20 15:24:25 +00:00
go.sum Update module google.golang.org/grpc to v1.72.1 (#13053) 2025-05-20 15:24:25 +00:00
logs.go Clarify that data cannot be accessed after Consume* func is called (#12284) 2025-02-06 16:50:29 +00:00
logs_test.go [chore]: enable require-error rule from testifylint (#11199) 2024-09-18 15:02:22 -07:00
metrics.go Clarify that data cannot be accessed after Consume* func is called (#12284) 2025-02-06 16:50:29 +00:00
metrics_test.go [chore]: enable require-error rule from testifylint (#11199) 2024-09-18 15:02:22 -07:00
package_test.go [chore] Enable goleak for all (passing) tests (#9173) 2024-01-03 08:35:58 -08:00
traces.go Clarify that data cannot be accessed after Consume* func is called (#12284) 2025-02-06 16:50:29 +00:00
traces_test.go [chore]: enable require-error rule from testifylint (#11199) 2024-09-18 15:02:22 -07:00