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
  • Loading branch information
dlituyev committed Mar 17, 2023
1 parent 25ac2aa commit ecc1668
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions prometheus/promhttp/instrument_server.go
Expand Up @@ -37,10 +37,6 @@ func observeWithExemplar(obs prometheus.Observer, val float64, labels map[string
// addWithExemplar is a wrapper for [prometheus.ExemplarAdder.AddWithExemplar],
// which falls back to [prometheus.Counter.Add] if no labels are provided.
func addWithExemplar(obs prometheus.Counter, val float64, labels map[string]string) {
if labels == nil {
obs.Add(val)
return
}
obs.(prometheus.ExemplarAdder).AddWithExemplar(val, labels)
}

Expand Down

0 comments on commit ecc1668

Please sign in to comment.