Skip to content

Commit ecc1668

Browse files
author
dlituyev
committed
Remove unnecessary check if label is nil in observeWithExemplar instrumentation
1 parent 25ac2aa commit ecc1668

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

prometheus/promhttp/instrument_server.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ func observeWithExemplar(obs prometheus.Observer, val float64, labels map[string
3737
// addWithExemplar is a wrapper for [prometheus.ExemplarAdder.AddWithExemplar],
3838
// which falls back to [prometheus.Counter.Add] if no labels are provided.
3939
func addWithExemplar(obs prometheus.Counter, val float64, labels map[string]string) {
40-
if labels == nil {
41-
obs.Add(val)
42-
return
43-
}
4440
obs.(prometheus.ExemplarAdder).AddWithExemplar(val, labels)
4541
}
4642

0 commit comments

Comments
 (0)