Skip to content

[exporter][batcher] Multi-batch support - Version 2 #12760

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 15 commits into from
Jun 5, 2025

Conversation

sfc-gh-sili
Copy link
Contributor

@sfc-gh-sili sfc-gh-sili commented Mar 29, 2025

Description

This PR introduces two new components

  • Partitioner - an interface for fetching batch key. A partitioner type should implement the function GetKey() which returns the batching key. Partitioner should be provided to the queue_bacher along with sizer in queue_batch::Settings.
  • multi_batcher. It supports key-based batching by routing the requests to a corresponding shard_batcher. Each shard_batcher corresponds to a shard described in Exporter batcher dynamic sharding of the partitions #12473.

Link to tracking issue

#12795

Testing

Documentation

Copy link

codecov bot commented Mar 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.30%. Comparing base (4074b72) to head (4f50e16).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12760      +/-   ##
==========================================
+ Coverage   91.29%   91.30%   +0.01%     
==========================================
  Files         508      509       +1     
  Lines       28695    28751      +56     
==========================================
+ Hits        26196    26252      +56     
  Misses       1986     1986              
  Partials      513      513              

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

@sfc-gh-sili sfc-gh-sili force-pushed the sili-metadata-key-3 branch 6 times, most recently from 2834e5c to e501416 Compare April 1, 2025 05:22
@sfc-gh-sili sfc-gh-sili marked this pull request as ready for review April 1, 2025 05:23
@sfc-gh-sili sfc-gh-sili requested a review from a team as a code owner April 1, 2025 05:23
@sfc-gh-sili sfc-gh-sili changed the title [exporter][batcher] Multi-batch support - Version 2 [in discussion][exporter][batcher] Multi-batch support - Version 2 Apr 3, 2025
@sfc-gh-sili sfc-gh-sili force-pushed the sili-metadata-key-3 branch 2 times, most recently from 46eca7f to 182507f Compare April 4, 2025 20:47
}

func newMultiBatcher(bCfg BatchConfig, bSet batcherSettings[request.Request]) *multiBatcher {
// TODO: Determine what is the right behavior for this in combination with async queue.
Copy link
Contributor

Choose a reason for hiding this comment

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

What question(s) are there? I'm not sure I'm following.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This comment is duplicated from newDefaultBatcher(). IIUC, this is related to how goroutines are allocated when async queue and the batcher are used together. Right now:

  • AsyncQueue owns a goroutine pool of size n that is in charge of reading from the queue and calling Batcher::consume().
  • Batcher::consume() is in charge of appending the new item to the batch and invoking the flushing goroutine if needed
  • Batcher can allocate up to m goroutines for dispatching the active batch.

Both n and m come from the same config field sending_queue::num_consumers, but it does not necessarily make sense use the same number of goroutines for "reading from queue" and "dispatching the request'

@sfc-gh-sili sfc-gh-sili force-pushed the sili-metadata-key-3 branch 4 times, most recently from 0c09d43 to 57c510d Compare April 22, 2025 08:01
@sfc-gh-sili sfc-gh-sili changed the title [in discussion][exporter][batcher] Multi-batch support - Version 2 [exporter][batcher] Multi-batch support - Version 2 Apr 22, 2025
@sfc-gh-sili sfc-gh-sili force-pushed the sili-metadata-key-3 branch from 57c510d to c33eb25 Compare April 25, 2025 22:34
@sfc-gh-sili sfc-gh-sili requested a review from dmitryax April 26, 2025 01:00
@sfc-gh-sili sfc-gh-sili force-pushed the sili-metadata-key-3 branch from e4366df to dee077d Compare May 4, 2025 00:06
@sfc-gh-sili sfc-gh-sili force-pushed the sili-metadata-key-3 branch 2 times, most recently from c9c5349 to 5c0eaf8 Compare May 4, 2025 05:05
@sfc-gh-sili sfc-gh-sili force-pushed the sili-metadata-key-3 branch 7 times, most recently from 891c0d1 to f53126b Compare May 17, 2025 01:09
@sfc-gh-sili sfc-gh-sili requested a review from dmitryax May 20, 2025 01:54
@sfc-gh-sili sfc-gh-sili force-pushed the sili-metadata-key-3 branch from 4496dd3 to 29d524b Compare June 2, 2025 21:19
@sfc-gh-sili sfc-gh-sili force-pushed the sili-metadata-key-3 branch from 29d524b to c206c68 Compare June 3, 2025 00:56
@dmitryax dmitryax added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Jun 4, 2025
@dmitryax dmitryax added this pull request to the merge queue Jun 5, 2025
Merged via the queue into open-telemetry:main with commit 3fc55a6 Jun 5, 2025
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy