Class MessagingConfig
java.lang.Object
io.opentelemetry.instrumentation.api.incubator.semconv.messaging.internal.MessagingConfig
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 TypeMethodDescriptionstatic io.opentelemetry.instrumentation.api.config.IncludeExcludegetHeaders(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.IncludeExcludegetHeaders(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 booleanisBatchSendMessageCreationSpansEnabled(io.opentelemetry.api.OpenTelemetry openTelemetry, String instrumentationName) Returns whether an instrumentation should emit a creation span for each message in a batch send.static booleanisBatchSendMessageCreationSpansEnabled(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 booleanisReceiveTelemetryEnabled(io.opentelemetry.api.OpenTelemetry openTelemetry, boolean systemPropertyFallback) Returns whether messaging receive telemetry is enabled.
-
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_spansdeclarative setting andmessage-create-spans.enabledflat 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_spansdeclarative setting andmessage-create-spans.enabledflat 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.
-