mirror of
https://github.com/hanzoai/traces.git
synced 2026-10-30 18:20:41 +00:00
* o7 compactor Signed-off-by: Joe Elliott <[email protected]> * wip: o7 v2 Signed-off-by: Joe Elliott <[email protected]> * test cleanup Signed-off-by: Joe Elliott <[email protected]> * remove compactor from jsonnet Signed-off-by: Joe Elliott <[email protected]> * changelog Signed-off-by: Joe Elliott <[email protected]> * gen manifest Signed-off-by: Joe Elliott <[email protected]> * config cleanup Signed-off-by: Joe Elliott <[email protected]> * docs Signed-off-by: Joe Elliott <[email protected]> * jsonnet Signed-off-by: Joe Elliott <[email protected]> * remove encoding Signed-off-by: Joe Elliott <[email protected]> * remove data encoding Signed-off-by: Joe Elliott <[email protected]> * lint and cleanup Signed-off-by: Joe Elliott <[email protected]> * unflake TestWorker\? Signed-off-by: Joe Elliott <[email protected]> --------- Signed-off-by: Joe Elliott <[email protected]>
33 lines
1.3 KiB
Go
33 lines
1.3 KiB
Go
package overrides
|
|
|
|
import (
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
"github.com/prometheus/client_golang/prometheus/promauto"
|
|
)
|
|
|
|
const discardReasonLabel = "reason"
|
|
|
|
// Exported reasons for discarded spans to be shared across packages.
|
|
const (
|
|
// ReasonRateLimited indicates that the tenant's spans/second exceeded their limits.
|
|
ReasonRateLimited = "rate_limited"
|
|
// ReasonTraceTooLarge indicates that a single trace has too many spans.
|
|
ReasonTraceTooLarge = "trace_too_large"
|
|
// ReasonLiveTracesExceeded indicates Tempo is already tracking too many live traces for this tenant.
|
|
ReasonLiveTracesExceeded = "live_traces_exceeded"
|
|
// ReasonUnknown indicates an unknown error when pushing spans.
|
|
ReasonUnknown = "unknown_error"
|
|
// ReasonTraceTooLargeToCompact indicates a trace is too large for the backend-worker to combine/compact.
|
|
ReasonCompactorDiscardedSpans = "trace_too_large_to_compact"
|
|
)
|
|
|
|
var metricDiscardedSpans = promauto.NewCounterVec(prometheus.CounterOpts{
|
|
Namespace: "tempo",
|
|
Name: "discarded_spans_total",
|
|
Help: "The total number of samples that were discarded.",
|
|
}, []string{discardReasonLabel, "tenant"})
|
|
|
|
func RecordDiscardedSpans(spansDiscarded int, reason string, tenant string) {
|
|
metricDiscardedSpans.WithLabelValues(reason, tenant).Add(float64(spansDiscarded))
|
|
}
|