Skip to content

Conversation

@SungJin1212
Copy link
Member

This PR adds a cortex_distributor_push_requests_total count metric to track the number of push requests by type.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@dosubot dosubot bot added the type/observability To help know what is going on inside Cortex label Jan 30, 2026
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
@SungJin1212 SungJin1212 force-pushed the Add-push-request-count-metric branch from 78fce6b to 3a153db Compare January 30, 2026 09:13
Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

Overall it looks good. Thanks


// Handler is a http.Handler which accepts WriteRequests.
func Handler(remoteWrite2Enabled bool, maxRecvMsgSize int, overrides *validation.Overrides, sourceIPs *middleware.SourceIPExtractor, push Func) http.Handler {
func Handler(remoteWrite2Enabled bool, maxRecvMsgSize int, overrides *validation.Overrides, sourceIPs *middleware.SourceIPExtractor, push Func, requestTotal *prometheus.CounterVec) http.Handler {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also count OTLP? That's a different push handler though

rw20WrittenExemplarsHeader = "X-Prometheus-Remote-Write-Exemplars-Written"

labelValuePRW1 = "prw1"
labelValuePRW2 = "prw2"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is prw2 a standard name we should use? I wonder if users know what it means.
It is mentioned in https://prometheus.io/docs/specs/prw/remote_write_spec_2_0 though so maybe we can use it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M type/observability To help know what is going on inside Cortex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants