Skip to content
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

fix(prometheus_scrape source): scrape endpoints in parallel #17660

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/sources/util/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ pub(crate) async fn call<
client
.send(request)
.map_err(Error::from)
.and_then(|response| async move {
.and_then(|response| Box::pin(async move {
let (header, body) = response.into_parts();
let body = hyper::body::to_bytes(body).await?;
emit!(EndpointBytesReceived {
Expand All @@ -169,7 +169,7 @@ pub(crate) async fn call<
endpoint: endpoint.as_str(),
});
Ok((header, body))
})
}))
.into_stream()
.filter_map(move |response| {
ready(match response {
Expand Down Expand Up @@ -225,7 +225,7 @@ pub(crate) async fn call<
})
.flatten()
})
.flatten()
.flatten_unordered(None)
.boxed();

match out.send_event_stream(&mut stream).await {
Expand Down