MCPcopy
hub / github.com/grafana/tempo / SetPartitionLagSeconds

Function SetPartitionLagSeconds

pkg/ingest/metrics.go:100–102  ·  view source on GitHub ↗

SetPartitionLagSeconds is similar to the auto exported lag, except it is in real clock seconds which can only be known after the record is read from the queue, therefore it is set by the caller. Call ResetLagMetricsForRevokedPartitions when partitions are revoked to prevent exporting stale data.

(group string, partition int32, lag time.Duration)

Source from the content-addressed store, hash-verified

98// which can only be known after the record is read from the queue, therefore it is set by the caller.
99// Call ResetLagMetricsForRevokedPartitions when partitions are revoked to prevent exporting stale data.
100func SetPartitionLagSeconds(group string, partition int32, lag time.Duration) {
101 metricPartitionLagSeconds.WithLabelValues(group, strconv.Itoa(int(partition))).Set(lag.Seconds())
102}
103
104// ResetLagMetricsForRevokedPartitions should be called when a partition is revoked to prevent
105// exporting stale metrics for partitions that the application no longer owns.

Callers 3

consumePartitionMethod · 0.92
readKafkaMethod · 0.92
consumeMethod · 0.92

Calls 1

SetMethod · 0.65

Tested by

no test coverage detected