(ctx context.Context)
| 219 | } |
| 220 | |
| 221 | func 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 | |
| 228 | func instrumentHandlerFunc(tracer *tracing.Tracer, reg prometheus.Registerer, handlerName string, handler http.Handler) (string, http.HandlerFunc) { |
| 229 | reg = prometheus.WrapRegistererWith(prometheus.Labels{"handler": handlerName}, reg) |