Skip to content

Commit a4f1063

Browse files
committed
dump metrics only in RouterOnly
1 parent 2f766dd commit a4f1063

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/receive/handler.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,9 @@ func (h *Handler) receiveHTTP(w http.ResponseWriter, r *http.Request) {
627627
h.writeTimeseriesTotal.WithLabelValues(strconv.Itoa(responseStatusCode), tenant).Observe(float64(stats.timeseries))
628628
h.writeSamplesTotal.WithLabelValues(strconv.Itoa(responseStatusCode), tenant).Observe(float64(stats.totalSamples))
629629
}
630+
if h.receiverMode != RouterOnly {
631+
return
632+
}
630633
for _, ts := range wreq.Timeseries {
631634
if lat := secondsSinceOldestSample(ts); lat > 0 {
632635
h.writeE2eLatency.WithLabelValues(strconv.Itoa(responseStatusCode), tenantHTTP).Observe(secondsSinceOldestSample(ts))

0 commit comments

Comments
 (0)