fix(prometheus.remote_write): Fix sent_batch_duration_seconds measuring before the request was sent [backport]#5698
Merged
kgeckhart merged 1 commit intorelease/v1.14from Mar 2, 2026
Conversation
…ng before the request was sent (#5697) `prometheus_remote_storage_sent_batch_duration_seconds` was measuring before the HTTP request was sent rather than after, causing the metric to reflect encoding/serialization time rather than the actual send duration. Applies the fix from prometheus/prometheus#18214 via a fork replace directive pointing to https://github.com/grafana/prometheus/tree/fix-sent-batch-duration-v0.309.1. Remove the replace directive when upstream PR #18214 is merged and Prometheus is upgraded. (cherry picked from commit 10cfb6c)
Contributor
🔍 Dependency Reviewgithub.com/prometheus/prometheus v0.309.1 -> github.com/grafana/prometheus v1.8.2-0.20260302171028-8cf60eef5463 — ✅ Safe
Notes
|
kgeckhart
approved these changes
Mar 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #5697
This PR backports #5697 to release/v1.14.
Original PR Author
@kgeckhart
Description
prometheus_remote_storage_sent_batch_duration_secondswas measuring before the HTTP request was sent rather than after, causing the metric to reflect encoding/serialization time rather than the actual send duration.Applies the fix from prometheus/prometheus#18214 via a fork replace directive pointing to https://github.com/grafana/prometheus/tree/fix-sent-batch-duration-v0.309.1.
Remove the replace directive when upstream PR #18214 is merged and Prometheus is upgraded.
This backport was created automatically.