Skip to content

Conversation

@lahsivjar
Copy link
Member

Description

Use the MergeCtx function exposed in queue batch settings to configure a merge function for context when merging batches in the exporterhelper. This will allow propagting the metadata keys across the batches.

Link to tracking issue

Fixes #41937

Testing

Unit tests added.

Documentation

Updated.

Comment on lines +44 to +46
func (p metadataKeysPartitioner) MergeCtx(
ctx1, ctx2 context.Context,
) context.Context {
Copy link
Member Author

Choose a reason for hiding this comment

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

@axw axw added the ready to merge Code review completed; ready to merge by maintainers label Oct 17, 2025
@songy23 songy23 merged commit dcf66b8 into open-telemetry:main Oct 17, 2025
205 checks passed
@github-actions github-actions bot added this to the next release milestone Oct 17, 2025
@lahsivjar lahsivjar deleted the mergectx branch October 17, 2025 11:56
ChrsMark pushed a commit to ChrsMark/opentelemetry-collector-contrib that referenced this pull request Oct 20, 2025
…agated (open-telemetry#43575)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Use the `MergeCtx` function exposed in queue batch settings to configure
a merge function for context when merging batches in the exporterhelper.
This will allow propagting the metadata keys across the batches.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes
open-telemetry#41937

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Unit tests added.

<!--Describe the documentation added.-->
#### Documentation
Updated.

<!--Please delete paragraphs that you did not use before submitting.-->

---------

Co-authored-by: Andrew Wilkins <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exporter/elasticsearch ready to merge Code review completed; ready to merge by maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use the newly introduced MergeCtx to propogate metadata keys in batch context

4 participants