Skip to content

Commit

Permalink
Give metric attributes unique names (#3891)
Browse files Browse the repository at this point in the history
From experimentation, it seems that attributes of the same name in
different metrics are shared. This leads to, for example, alert status
types showing up in the remediation graph.
  • Loading branch information
dmjb authored Jul 15, 2024
1 parent a37860e commit 23df4b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/engine/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ func (e *ExecutorMetrics) CountEvalStatus(
entityType db.Entities,
) {
e.evalCounter.Add(ctx, 1, metric.WithAttributes(
attribute.String("entity_type", string(entityType)),
attribute.String("status", string(status)),
attribute.String("eval_entity_type", string(entityType)),
attribute.String("eval_status_type", string(status)),
))
}

Expand All @@ -100,7 +100,7 @@ func (e *ExecutorMetrics) CountRemediationStatus(
status db.RemediationStatusTypes,
) {
e.evalCounter.Add(ctx, 1, metric.WithAttributes(
attribute.String("status", string(status)),
attribute.String("remediation_status_type", string(status)),
))
}

Expand All @@ -110,7 +110,7 @@ func (e *ExecutorMetrics) CountAlertStatus(
status db.AlertStatusTypes,
) {
e.evalCounter.Add(ctx, 1, metric.WithAttributes(
attribute.String("status", string(status)),
attribute.String("alert_status_type", string(status)),
))
}

Expand Down

0 comments on commit 23df4b3

Please sign in to comment.