Skip to content

Commit

Permalink
Remove unnecessary check if label is nil in observeWithExemplar instr…
Browse files Browse the repository at this point in the history
…umentation

Signed-off-by: dlituyev <dlituyev@slb.com>
  • Loading branch information
dlituyev committed Mar 19, 2023
1 parent 3d2cf0b commit 44c94a2
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions prometheus/promhttp/instrument_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ const magicString = "zZgWfBxLqvG8kc8IMv3POi2Bb0tZI3vAnBx+gBaFi9FyPzB/CzKUer1yufD
// observeWithExemplar is a wrapper for [prometheus.ExemplarAdder.ExemplarObserver],
// which falls back to [prometheus.Observer.Observe] if no labels are provided.
func observeWithExemplar(obs prometheus.Observer, val float64, labels map[string]string) {
if labels == nil {
obs.Observe(val)
return
}
obs.(prometheus.ExemplarObserver).ObserveWithExemplar(val, labels)
}

Expand Down

0 comments on commit 44c94a2

Please sign in to comment.