Class MessagingConfig

java.lang.Object
io.opentelemetry.instrumentation.api.incubator.semconv.messaging.internal.MessagingConfig

public final class MessagingConfig extends Object
Resolves common and instrumentation-specific messaging configuration.

This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

  • Method Summary

    Modifier and Type
    Method
    Description
    static io.opentelemetry.instrumentation.api.config.IncludeExclude
    getHeaders(io.opentelemetry.api.OpenTelemetry openTelemetry)
    Returns the configured messaging header selector, or an empty selector when no headers are configured to be captured.
    static io.opentelemetry.instrumentation.api.config.IncludeExclude
    getHeaders(io.opentelemetry.api.OpenTelemetry openTelemetry, boolean systemPropertyFallback)
    Returns the configured messaging header selector, or an empty selector when no headers are configured to be captured.
    static boolean
    isBatchSendMessageCreationSpansEnabled(io.opentelemetry.api.OpenTelemetry openTelemetry, String instrumentationName)
    Returns whether an instrumentation should emit a creation span for each message in a batch send.
    static boolean
    isBatchSendMessageCreationSpansEnabled(io.opentelemetry.api.OpenTelemetry openTelemetry, String instrumentationName, boolean systemPropertyFallback)
    Returns whether an instrumentation should emit a creation span for each message in a batch send.
    static boolean
    isReceiveTelemetryEnabled(io.opentelemetry.api.OpenTelemetry openTelemetry, boolean systemPropertyFallback)
    Returns whether messaging receive telemetry is enabled.

    Methods inherited from class Object

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

    • getHeaders

      public static io.opentelemetry.instrumentation.api.config.IncludeExclude getHeaders(io.opentelemetry.api.OpenTelemetry openTelemetry)
      Returns the configured messaging header selector, or an empty selector when no headers are configured to be captured.
    • getHeaders

      public static io.opentelemetry.instrumentation.api.config.IncludeExclude getHeaders(io.opentelemetry.api.OpenTelemetry openTelemetry, boolean systemPropertyFallback)
      Returns the configured messaging header selector, or an empty selector when no headers are configured to be captured.
      Parameters:
      systemPropertyFallback - whether to fall back to the flat system properties when the declarative configuration does not contain a value. This is needed by library instrumentation entry points that have no programmatic configuration surface.
    • isReceiveTelemetryEnabled

      public static boolean isReceiveTelemetryEnabled(io.opentelemetry.api.OpenTelemetry openTelemetry, boolean systemPropertyFallback)
      Returns whether messaging receive telemetry is enabled.
      Parameters:
      systemPropertyFallback - whether to fall back to flat system properties when declarative configuration does not contain a value. This is needed by library instrumentation entry points that have no programmatic configuration surface.
    • isBatchSendMessageCreationSpansEnabled

      public static boolean isBatchSendMessageCreationSpansEnabled(io.opentelemetry.api.OpenTelemetry openTelemetry, String instrumentationName)
      Returns whether an instrumentation should emit a creation span for each message in a batch send.

      Resolves the instrumentation-specific message_create_spans declarative setting and message-create-spans.enabled flat property, then falls back to the common messaging setting.

    • isBatchSendMessageCreationSpansEnabled

      public static boolean isBatchSendMessageCreationSpansEnabled(io.opentelemetry.api.OpenTelemetry openTelemetry, String instrumentationName, boolean systemPropertyFallback)
      Returns whether an instrumentation should emit a creation span for each message in a batch send.

      Resolves the instrumentation-specific message_create_spans declarative setting and message-create-spans.enabled flat property, then falls back to the common messaging setting.

      Parameters:
      systemPropertyFallback - whether to fall back to flat system properties when declarative configuration does not contain a value. This is needed by library instrumentation entry points that have no programmatic configuration surface.