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

public final class MessagingProducerMetrics extends Object implements io.opentelemetry.instrumentation.api.instrumenter.OperationListener
OperationListener which keeps track of producer 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 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.publish.duration instrument.
    static io.opentelemetry.instrumentation.api.instrumenter.OperationMetrics
    Returns only the stable sent-messages metric.
    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.publish.duration instrument.

      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.

    • getSentMessages

      public static io.opentelemetry.instrumentation.api.instrumenter.OperationMetrics getSentMessages()
      Returns only the stable sent-messages metric.
    • 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