Skip to content

Commit 44c94a2

Browse files
author
dlituyev
committed
Remove unnecessary check if label is nil in observeWithExemplar instrumentation
Signed-off-by: dlituyev <[email protected]>
1 parent 3d2cf0b commit 44c94a2

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
@@ -31,10 +31,6 @@ const magicString = "zZgWfBxLqvG8kc8IMv3POi2Bb0tZI3vAnBx+gBaFi9FyPzB/CzKUer1yufD
3131
// observeWithExemplar is a wrapper for [prometheus.ExemplarAdder.ExemplarObserver],
3232
// which falls back to [prometheus.Observer.Observe] if no labels are provided.
3333
func observeWithExemplar(obs prometheus.Observer, val float64, labels map[string]string) {
34-
if labels == nil {
35-
obs.Observe(val)
36-
return
37-
}
3834
obs.(prometheus.ExemplarObserver).ObserveWithExemplar(val, labels)
3935
}
4036

0 commit comments

Comments
 (0)