Skip to content

Commit

Permalink
Remove method label from timeseries' metrics
Browse files Browse the repository at this point in the history
Signed-off-by: Douglas Camata <[email protected]>
  • Loading branch information
douglascamata authored Jun 21, 2022
1 parent 95a7a37 commit 3b3592b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/receive/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@ func NewHandler(logger log.Logger, o *Options) *Handler {
Subsystem: "receive",
Name: "write_timeseries_total",
Help: "The number of timeseries received in the incoming write requests.",
}, []string{"code", "method", "tenant"},
}, []string{"code", "tenant"},
),
writeSamplesTotal: promauto.With(o.Registry).NewCounterVec(
prometheus.CounterOpts{
Namespace: "thanos",
Subsystem: "receive",
Name: "write_samples_total",
Help: "The number of sampled received in the incoming write requests.",
}, []string{"code", "method", "tenant"},
}, []string{"code", "tenant"},
),
}

Expand Down Expand Up @@ -413,9 +413,9 @@ func (h *Handler) receiveHTTP(w http.ResponseWriter, r *http.Request) {
}
http.Error(w, err.Error(), responseStatusCode)
}
h.writeTimeseriesTotal.WithLabelValues(strconv.Itoa(responseStatusCode), r.Method, tenant).Add(float64(len(wreq.Timeseries)))
h.writeTimeseriesTotal.WithLabelValues(strconv.Itoa(responseStatusCode), tenant).Add(float64(len(wreq.Timeseries)))
for _, timeseries := range wreq.Timeseries {
h.writeSamplesTotal.WithLabelValues(strconv.Itoa(responseStatusCode), r.Method, tenant).Add(float64(len(timeseries.Samples)))
h.writeSamplesTotal.WithLabelValues(strconv.Itoa(responseStatusCode), tenant).Add(float64(len(timeseries.Samples)))
}
}

Expand Down

0 comments on commit 3b3592b

Please sign in to comment.