MCPcopy
hub / github.com/prometheus/client_golang / getExemplarFn

Function getExemplarFn

tutorials/whatsup/reference/main.go:221–226  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

219}
220
221func getExemplarFn(ctx context.Context) prometheus.Labels {
222 if spanCtx := tracing.GetSpan(ctx); spanCtx.Context().IsSampled() {
223 return prometheus.Labels{"traceID": spanCtx.Context().TraceID()}
224 }
225 return nil
226}
227
228func instrumentHandlerFunc(tracer *tracing.Tracer, reg prometheus.Registerer, handlerName string, handler http.Handler) (string, http.HandlerFunc) {
229 reg = prometheus.WrapRegistererWith(prometheus.Labels{"handler": handlerName}, reg)

Callers 1

whatsUpHandlerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected