prometheus/promhttp: actually observe values in trace in example

This is similar to
https://github.com/prometheus/client_golang/pull/535 fixing ExampleInstrumentRoundTripperDuration.

Signed-off-by: Sergiusz Urbaniak <sergiusz.urbaniak@gmail.com>
This commit is contained in:
Sergiusz Urbaniak 2019-03-06 13:58:46 +01:00
parent 9a369d2d38
commit 60728f445d
1 changed files with 4 additions and 4 deletions

View File

@ -162,16 +162,16 @@ func ExampleInstrumentRoundTripperDuration() {
// functions that we want to instrument.
trace := &InstrumentTrace{
DNSStart: func(t float64) {
dnsLatencyVec.WithLabelValues("dns_start")
dnsLatencyVec.WithLabelValues("dns_start").Observe(t)
},
DNSDone: func(t float64) {
dnsLatencyVec.WithLabelValues("dns_done")
dnsLatencyVec.WithLabelValues("dns_done").Observe(t)
},
TLSHandshakeStart: func(t float64) {
tlsLatencyVec.WithLabelValues("tls_handshake_start")
tlsLatencyVec.WithLabelValues("tls_handshake_start").Observe(t)
},
TLSHandshakeDone: func(t float64) {
tlsLatencyVec.WithLabelValues("tls_handshake_done")
tlsLatencyVec.WithLabelValues("tls_handshake_done").Observe(t)
},
}