Skip to content

Commit

Permalink
fix(prometheus_scrape source): scrape endpoints in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
wjordan committed Jun 9, 2023
1 parent cb9a3a5 commit 5557211
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 5557211

Please sign in to comment.