Skip to content

Commit

Permalink
[Observability] refactor: remove error labels from metrics (#653)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanchriswhite authored Jul 6, 2024
1 parent 4517874 commit 4908ccc
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions telemetry/event_counters.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ func ProofRequirementCounter(
// Ensure the counter is not incremented if there was an error.
if err != nil {
incrementAmount = 0
labels = AppendErrLabel(err, labels...)
}

telemetry.IncrCounterWithLabels(
Expand All @@ -86,7 +85,6 @@ func ClaimComputeUnitsCounter(
// Ensure the counter is not incremented if there was an error.
if err != nil {
incrementAmount = 0
labels = AppendErrLabel(err, labels...)
}

telemetry.IncrCounterWithLabels(
Expand All @@ -113,7 +111,6 @@ func ClaimCounter(
// Ensure the counter is not incremented if there was an error.
if err != nil {
incrementAmount = 0
labels = AppendErrLabel(err, labels...)
}

telemetry.IncrCounterWithLabels(
Expand Down Expand Up @@ -153,13 +150,3 @@ func RelayEMAGauge(relayEMA uint64, serviceId string) {
labels,
)
}

// AppendErrLabel appends a label with the name "error" and a value of the error's
// message to the given labels slice if the error is not nil.
func AppendErrLabel(err error, labels ...metrics.Label) []metrics.Label {
if err == nil {
return labels
}

return append(labels, metrics.Label{Name: "error", Value: err.Error()})
}

0 comments on commit 4908ccc

Please sign in to comment.