Wildfly exports otel traces despite sampler-type is set to off

45 views
Skip to first unread message

Mattias Andersson

unread,
Mar 10, 2026, 5:15:11 AM (4 days ago) Mar 10
to WildFly
I want to disable opentelemetry traces by default to avoid error logs when I develop my application locally. When I deploy the application in prod and have an OTEL collector I enable traces and provide an url to the collector.

In the following example I have a simple jaxrs application with a CDI bean. When CDI is enabled in the deployed war, Wildfly starts to export opentelemetry traces despite sampler-type is set to off.

https://github.com/attiand/wildfly-opentelemetry

Any idea what causes this behavior ? 

/Mattias

Jason Lee

unread,
Mar 10, 2026, 1:04:34 PM (3 days ago) Mar 10
to Mattias Andersson, WildFly
I do not off hand, but I’ll look into it.

--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/wildfly/aae9990f-f176-40ad-9e92-a429ed3d69den%40googlegroups.com.

-- 
Jason Lee
Principal Software Engineer
IBM Java Middleware
Java Champion

Jason Lee

unread,
Mar 10, 2026, 3:07:23 PM (3 days ago) Mar 10
to Mattias Andersson, WildFly
I have file an issue to track this: https://issues.redhat.com/browse/WFLY-21584

Mattias Andersson

unread,
Mar 10, 2026, 3:16:25 PM (3 days ago) Mar 10
to WildFly
Tanks!  /M

Jason Lee

unread,
Mar 11, 2026, 12:22:02 PM (3 days ago) Mar 11
to Mattias Andersson, WildFly
Can you paste the full error log(s) you’re seeing?

Mattias Andersson

unread,
Mar 11, 2026, 12:28:32 PM (3 days ago) Mar 11
to WildFly

Jason Lee

unread,
Mar 11, 2026, 1:43:25 PM (2 days ago) Mar 11
to Mattias Andersson, WildFly
OK. I think what you’re seeing there is OpenTelemetery trying to export logs:

(vert.x-eventloop-thread-2) Failed to export LogsRequestMarshalers.

The system appears to be honoring the always_off sampler (if I start up a collector, no spans are exported), but that property doesn’t affect logs or metrics. If you really need to shut down ALL publishing, you’ll need to enable MicroProfile Telemetry, and set the Otel properties (otel.[metrics|logs].exporter=none) via MP Config.

Note that, according to the spec, the Otel SDK is disabled by default in an MP environment, so simply enabling that extension in your local environment may be sufficient to suppress the error logging your seeing in dev.

Mattias Andersson

unread,
Mar 12, 2026, 7:21:48 AM (2 days ago) Mar 12
to WildFly
ok 


If I now set the sampler-type to on I still don’t get any traces. /subsystem=opentelemetry:write-attribute(name=sampler-type, value="on")

If I instead run /system-property=otel.sdk.disabled:add(value=false) Wildfly start exporting

If I now set the sampler-type to off it still exporting: /subsystem=opentelemetry:write-attribute(name=sampler-type, value="off")

Note that I have not checked if Wildfly really exports traces. I have just noted that I get the error log.

Perhaps it would be better to migrate to microprofile-telemetry ?

/Mattias 

Jason Lee

unread,
Mar 12, 2026, 8:50:56 AM (2 days ago) Mar 12
to Mattias Andersson, WildFly
Whether or not you enable MP Telemetry is probably going to be a personal preference. All it adds, practically speaking, is the ability to configure OpenTelemetry via MP Config, so you see this kind of finer-grained control via the Otel properties. I think, technically, you can also achieve that by setting system properties as you did for otel.sdk.disabled, but MP Config is probably tidier.

With all that said, if you all you really want is to disable signal publishing in your local environment to avoid connection refused logging, I’d probably just set /system-property=otel.sdk.disabled:add(value=true) in my local environment to keep things as close to production as possible, but that too is a personal preference.

Hope that helps.

Mattias Andersson

unread,
Mar 12, 2026, 9:21:38 AM (2 days ago) Mar 12
to WildFly

It does, thanks for the feedback!

/Mattias

Jason Lee

unread,
Mar 12, 2026, 11:13:39 AM (2 days ago) Mar 12
to Mattias Andersson, WildFly
Great! Glad we got you sorted out. :)

Reply all
Reply to author
Forward
0 new messages