How to enable OpenTelemetry metric in payara 6

Hi,

I found documentation how to setup OpenTelemetry for payara. There is information where documentation says deployment of an OpenTelemetry Agent is not necessary and may lead to duplicate traces.

I enable request tracing and setup -Dotel.sdk.disabled=false. I use OTPL exporter where data are sent to elastic apm server. I cannot see any metric about my jvm in kibana

when I added this option to my domain.xml -javaagent:${com.sun.aas.installRoot}/lib/opentelemetry-javaagent-2.11.0.jar
I see metric about jvm in Kibana.

I cannot disable payara open telemetry agent because data are sent regardless of request tracing enabled property : false/true which leads to duplicate traces and spans.

Please could you share some information how to setup open telemetry metric for jvm only with payara Open Telemetry agent?

thanks

I have this system properties in my domain.xml, but I can not see any metrics.

    <jvm-options>-Dotel.exporter.otlp.endpoint=http://localhost:8200</jvm-options>
    <jvm-options>-Dotel.service.name=xxx</jvm-options>
    <jvm-options>-Dotel.sdk.disabled=false</jvm-options>
    <jvm-options>-Dotel.metrics.exporter=otlp</jvm-options>
    <jvm-options>-Dotel.metrics.enabled=true</jvm-options>

I found in payara code via github how open telemetry is configured via startup. This is a reason why I added explicitly otel.metrics.exporter=otlp, but it doesn’t work.

If I added open telemetry agent explicitly, I see jvm metric in kibana without any configuration.

Thanks for help.