Interface LabelsProcessor

  • All Known Implementing Classes:
    NoopLabelsProcessor

    public interface LabelsProcessor
    Labels processor is an abstraction to manipulate instrument labels during metrics capture process.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      io.opentelemetry.api.metrics.common.Labels onLabelsBound​(io.opentelemetry.context.Context ctx, io.opentelemetry.api.metrics.common.Labels labels)
      Called when bound synchronous instrument is created or metrics are recorded for non-bound synchronous instrument.
    • Method Detail

      • onLabelsBound

        io.opentelemetry.api.metrics.common.Labels onLabelsBound​(io.opentelemetry.context.Context ctx,
                                                                 io.opentelemetry.api.metrics.common.Labels labels)
        Called when bound synchronous instrument is created or metrics are recorded for non-bound synchronous instrument. Allows to manipulate labels which this instrument is bound to in case of binding operation or labels used for recording values in case of non-bound synchronous instrument. Particular use case includes enriching labels and/or adding more labels depending on the Context

        Please note, this is an experimental API. In case of bound instruments, it will be only invoked upon instrument binding and not when measurements are recorded.

        Parameters:
        ctx - context of the operation
        labels - immutable labels. When processors are chained output labels of the previous one is passed as an input to the next one. Last labels returned by a chain of processors are used for bind() operation.
        Returns:
        labels to be used as an input to the next processor in chain or bind() operation if this is the last processor