java.lang.Object
io.opentelemetry.instrumentation.api.incubator.semconv.messaging.MessagingConsumerMetrics
All Implemented Interfaces:
io.opentelemetry.instrumentation.api.instrumenter.OperationListener

public final class MessagingConsumerMetrics extends Object implements io.opentelemetry.instrumentation.api.instrumenter.OperationListener
OperationListener which keeps track of consumer metrics.
  • Method Summary

    Modifier and Type
    Method
    Description
    static io.opentelemetry.instrumentation.api.instrumenter.OperationMetrics
    get()
    Deprecated.
    static io.opentelemetry.instrumentation.api.instrumenter.OperationMetrics
    Returns only the stable client-operation-duration metric.
    static io.opentelemetry.instrumentation.api.instrumenter.OperationMetrics
    Returns only the stable consumed-messages metric for a delivered message.
    static io.opentelemetry.instrumentation.api.instrumenter.OperationMetrics
    Returns metrics for extractors configured with MessagingOperationType, emitting only the stable messaging.client.* instruments.
    static io.opentelemetry.instrumentation.api.instrumenter.OperationMetrics
    Returns metrics for extractors configured with MessagingOperationType that additionally emit the deprecated messaging.receive.duration and messaging.receive.messages instruments.
    void
    onEnd(io.opentelemetry.context.Context context, io.opentelemetry.api.common.Attributes endAttributes, long endNanos)
     
    io.opentelemetry.context.Context
    onStart(io.opentelemetry.context.Context context, io.opentelemetry.api.common.Attributes startAttributes, long startNanos)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • get

      @Deprecated public static io.opentelemetry.instrumentation.api.instrumenter.OperationMetrics get()
      Deprecated.
      Use getForOperationType(). May be removed in the next minor release.
      Returns metrics for extractors configured with MessageOperation.

      In 3.0 this method name will be reused for getForOperationType(), which emits different instruments, so callers must migrate rather than rely on this name continuing to behave the same way.

    • getForOperationType

      public static io.opentelemetry.instrumentation.api.instrumenter.OperationMetrics getForOperationType()
      Returns metrics for extractors configured with MessagingOperationType, emitting only the stable messaging.client.* instruments.
    • getForOperationTypeWithOldMetrics

      public static io.opentelemetry.instrumentation.api.instrumenter.OperationMetrics getForOperationTypeWithOldMetrics()
      Returns metrics for extractors configured with MessagingOperationType that additionally emit the deprecated messaging.receive.duration and messaging.receive.messages instruments.

      Intended only for instrumentations that already emitted the pre-1.43 metrics before migrating to MessagingOperationType, so that they keep emitting them until 3.0. New instrumentations should use getForOperationType() instead.

    • getClientOperationDuration

      public static io.opentelemetry.instrumentation.api.instrumenter.OperationMetrics getClientOperationDuration()
      Returns only the stable client-operation-duration metric.
    • getConsumedMessages

      public static io.opentelemetry.instrumentation.api.instrumenter.OperationMetrics getConsumedMessages()
      Returns only the stable consumed-messages metric for a delivered message.
    • onStart

      @CanIgnoreReturnValue public io.opentelemetry.context.Context onStart(io.opentelemetry.context.Context context, io.opentelemetry.api.common.Attributes startAttributes, long startNanos)
      Specified by:
      onStart in interface io.opentelemetry.instrumentation.api.instrumenter.OperationListener
    • onEnd

      public void onEnd(io.opentelemetry.context.Context context, io.opentelemetry.api.common.Attributes endAttributes, long endNanos)
      Specified by:
      onEnd in interface io.opentelemetry.instrumentation.api.instrumenter.OperationListener