From 60728f445d290e966e430abeb60b0e846267d677 Mon Sep 17 00:00:00 2001 From: Sergiusz Urbaniak Date: Wed, 6 Mar 2019 13:58:46 +0100 Subject: [PATCH] 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 --- prometheus/promhttp/instrument_client_1_8_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/prometheus/promhttp/instrument_client_1_8_test.go b/prometheus/promhttp/instrument_client_1_8_test.go index fad9ecb..2d0ff4f 100644 --- a/prometheus/promhttp/instrument_client_1_8_test.go +++ b/prometheus/promhttp/instrument_client_1_8_test.go @@ -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) }, }