Description
Describe the bug
Our team has created an Open Liberty-based web application using Open Liberty version 25.0.0.1 and IBM Semeru 17 Java.
We have been using the mpTelemetry-2.0
feature to enable MicroProfile Telemetry for producing distributed tracing data.
Within some of our environments, we set the OTEL_SDK_DISABLED=false
environment variable (along with others) to "enable" distributed tracing data generation and sending to a collection endpoint. However, in other environments where we don't want this to take place, we set OTEL_SDK_DISABLED=true
to use a "no-op" implementation for the SDK, as per here:
https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#general-sdk-configuration
We have noticed that even after setting OTEL_SDK_DISABLED=true
, we continue to see the CWMOT5100I
(INFO) message being generated whenever the /health
, /metrics
, or /openapi
endpoints are visited. Our Kubernetes environment makes use of /health
and /metrics
to check on the health of the microservice and collect service metrics.
For example, when the /health
endpoint is visited, we see the following message emitted:
{"message":"CWMOT5100I: The MicroProfile Telemetry Tracing feature is enabled but not configured to generate traces for the io.openliberty.microprofile.health.3.1.internal.jakarta application.","tid":"000000f4","timestamp":"2025-03-19T05:45:43.993+0000","ibm_messageId":"CWMOT5100I","module":"io.openliberty.microprofile.telemetry.internal.common.info.OpenTelemtryLifecycleManagerImpl","level":"INFO","ext_traceId":"","ext_sessionTracking":"[fcjEzc-ubOygZ]","ext_thread":"Default Executor-thread-74"}
and when the /metrics
endpoint is visited, we see the following:
{"message":"CWMOT5100I: The MicroProfile Telemetry Tracing feature is enabled but not configured to generate traces for the io.openliberty.microprofile.metrics.5.0.public.internal application.","tid":"0000012f","timestamp":"2025-03-19T05:45:47.815+0000","ibm_messageId":"CWMOT5100I","module":"io.openliberty.microprofile.telemetry.internal.common.info.OpenTelemtryLifecycleManagerImpl","level":"INFO","ext_traceId":"","ext_sessionTracking":"[fcjEzc-26zfLq]","ext_thread":"Default Executor-thread-133"}
It seems that setting OTEL_SDK_DISABLED=true
eliminates this message being emitted for all of our other application endpoints. However, this INFO message is still emitted in the cases mentioned above.
We are using mpHealth-2.0
and mpMetrics-5.1
.
We have noticed that if we downgrade our version of MicroProfile Telemetry to mpTelemetry-1.1
, this issue does not occur.
The reason this is a problem for us is because our Kubernetes system regularly visits /health
and /metrics
and we would like to eliminate unnecessary logging in our application (for cost reasons, etc.).
Please see our logging configuration below (from server.xml
). One workaround option for us would seem to be to filter out INFO messages using the traceSpecification
in the <logging>
section of server.xml
. However, the description here for traceSpecification
seems to indicate that it is not possible to disable INFO messages for a component/class/etc.:
https://openliberty.io/docs/latest/log-trace-configuration.html#settings
Steps to Reproduce
- Create an Open Liberty 25 based Java web application
- Include the features listed below (particularly:
mpTelemetry-2.0
) - Implement the
server.xml
logging
configuration as shown below - Set
OTEL_SDK_DISABLED=true
to disable OpenTelemetry SDK distributed tracing - Visit the
/health
and/metrics
endpoints of the application
Expected behavior
The CWMOT5100I
message is not emitted since OTEL_SDK_DISABLED=true
is set. However, for the /metrics
and /health
endpoints, it continues to be emitted.
Diagnostic information:
- OpenLiberty Version:
25.0.0.1
- Affected feature(s):
mpTelemetry-2.0
mpHealth-2.0
mpMetrics-5.1
- Java Version:
openjdk version "17.0.14" 2025-01-21
IBM Semeru Runtime Open Edition 17.0.14.0 (build 17.0.14+7)
Eclipse OpenJ9 VM 17.0.14.0 (build openj9-0.49.0, JRE 17 Linux amd64-64-Bit Compressed References 20250121_961 (JIT enabled, AOT enabled)
OpenJ9 - 3c3d179854
OMR - e49875871
JCL - cbbc8b94a62 based on jdk-17.0.14+7)
- server.xml configuration (WITHOUT sensitive information like passwords):
<?xml version="1.0" encoding="UTF-8"?>
<server description="MyApplication">
<!-- Enable features -->
<featureManager>
<feature>cdi-4.0</feature>
<feature>jsonb-3.0</feature>
<feature>jsonp-2.1</feature>
<feature>mpConfig-3.1</feature>
<feature>mpHealth-4.0</feature>
<feature>mpMetrics-5.1</feature>
<feature>webProfile-10.0</feature>
<feature>mpTelemetry-2.0</feature>
</featureManager>
<logging traceSpecification="*=FINER"
traceFormat="TBASIC"
isoDateFormat="true"
consoleLogLevel="INFO"
consoleFormat="JSON"
jsonFieldMappings="loglevel:level,ibm_datetime:timestamp,ibm_threadId:tid,type:,host:,ibm_serverName:,ibm_userDir:,ibm_methodName:,ibm_className:,ibm_sequence:,ext_appName:" />
</server>
Additional context
Add any other context about the problem here.