Merge pull request #544 from s-urbaniak/observe-example

prometheus/promhttp: actually observe values in trace in example
This commit is contained in:
Björn Rabenstein 2019-03-07 15:53:37 +01:00 committed by GitHub
commit c5e14697ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

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