Skip to content

Commit bf5151e

Browse files
authored
Merge pull request #47 from numberly/fix/revoke-token-dimension
fix: deleting uuid from metric cardinality
2 parents 81af1b0 + 3c2f24a commit bf5151e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/prometheus/prom.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var (
3939
Name: "vault_injector_revoke_token_count_success",
4040
Help: "Vault injector token revoked with success count",
4141
},
42-
[]string{"uuid", "namespace"},
42+
[]string{"namespace"},
4343
)
4444
RevokeTokenErrorCount = prometheus.NewCounterVec(
4545
prometheus.CounterOpts{

pkg/vault/handle_token.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ func (c *Connector) RevokeOrphanToken(ctx context.Context, tokenId, uuid, namesp
385385
c.Log.Errorf("error while revoking token: %v", err)
386386
return err
387387
}
388-
promInjector.RevokeTokenCount.WithLabelValues(uuid, namespace).Inc()
388+
promInjector.RevokeTokenCount.WithLabelValues(namespace).Inc()
389389
promInjector.TokenExpirationInTime.DeleteLabelValues(uuid, namespace)
390390
return nil
391391
}
@@ -397,7 +397,7 @@ func (c *Connector) RevokeSelfToken(ctx context.Context, tokenId, uuid, namespac
397397
promInjector.RevokeTokenErrorCount.WithLabelValues(uuid, namespace).Inc()
398398
c.Log.Errorf("error while revoking token: %v", err)
399399
}
400-
promInjector.RevokeTokenCount.WithLabelValues(uuid, namespace).Inc()
400+
promInjector.RevokeTokenCount.WithLabelValues(namespace).Inc()
401401
promInjector.TokenExpirationInTime.DeleteLabelValues(uuid, namespace)
402402
}
403403

0 commit comments

Comments
 (0)