WithLabelFromCtx registers a label for dynamic resolution with access to context. See the example for ExampleInstrumentHandlerWithLabelResolver for example usage
(name string, valueFn LabelValueFromCtx)
| 78 | // WithLabelFromCtx registers a label for dynamic resolution with access to context. |
| 79 | // See the example for ExampleInstrumentHandlerWithLabelResolver for example usage |
| 80 | func WithLabelFromCtx(name string, valueFn LabelValueFromCtx) Option { |
| 81 | return optionApplyFunc(func(o *options) { |
| 82 | o.extraLabelsFromCtx[name] = valueFn |
| 83 | }) |
| 84 | } |