Caused by: org.apache.kafka.common.KafkaException: Failed to construct kafka producer at org.apache.kafka.clients.producer.KafkaProducer.(KafkaProducer.java:439) at org.apache.kafka.clients.producer.KafkaProducer.(KafkaProducer.java:290) at org.apache.kafka.clients.producer.KafkaProducer.(KafkaProducer.java:317) at org.apache.kafka.clients.producer.KafkaProducer.(KafkaProducer.java:302) at com.ericsson.bss.msg.client.api.impl.MsgProducer.(MsgProducer.java:80) at com.ericsson.bss.msg.client.api.internal.impl.MsgProducerImpl.createProducer(MsgProducerImpl.java:357) at com.ericsson.bss.msg.client.api.internal.impl.MsgProducerImpl.checkIfProducerInitialized(MsgProducerImpl.java:279) at com.ericsson.bss.msg.client.api.internal.impl.MsgProducerImpl.sendMessage(MsgProducerImpl.java:291) at com.ericsson.bss.msg.client.api.internal.impl.MsgProducerImpl.sendSync(MsgProducerImpl.java:124) ... 78 more Caused by: org.apache.kafka.common.KafkaException: Class io.opentelemetry.javaagent.shaded.instrumentation.kafka.internal.OpenTelemetryMetricsReporter cannot be found at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstance(AbstractConfig.java:396) at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstances(AbstractConfig.java:478) at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstances(AbstractConfig.java:459) at org.apache.kafka.clients.producer.KafkaProducer.(KafkaProducer.java:350) ... 86 more Caused by: java.lang.ClassNotFoundException: io.opentelemetry.javaagent.shaded.instrumentation.kafka.internal.OpenTelemetryMetricsReporter at org.ops4j.pax.web.service.spi.servlet.OsgiServletContextClassLoader.loadClass(OsgiServletContextClassLoader.java:128) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:398) at org.apache.kafka.common.utils.Utils.loadClass(Utils.java:417) at org.apache.kafka.common.utils.Utils.newInstance(Utils.java:406) at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstance(AbstractConfig.java:394) ... 89 more Suppressed: java.lang.ClassNotFoundException: io.opentelemetry.javaagent.shaded.instrumentation.kafka.internal.OpenTelemetryMetricsReporter cannot be found by org.apache.aries.jax.rs.whiteboard_2.0.2 at org.eclipse.osgi.internal.loader.BundleLoader.generateException(BundleLoader.java:541) at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:536) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:416) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:168) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:527) at org.ops4j.pax.web.service.spi.servlet.OsgiServletContextClassLoader.loadClass(OsgiServletContextClassLoader.java:121) ... 94 more Suppressed: java.lang.ClassNotFoundException: io.opentelemetry.javaagent.shaded.instrumentation.kafka.internal.OpenTelemetryMetricsReporter cannot be found by org.ops4j.pax.web.pax-web-jetty_8.0.15 at org.eclipse.osgi.internal.loader.BundleLoader.generateException(BundleLoader.java:541) at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:536) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:416) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:168) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:527) at org.ops4j.pax.web.service.spi.servlet.OsgiServletContextClassLoader.loadClass(OsgiServletContextClassLoader.java:121) ... 94 more Suppressed: java.lang.ClassNotFoundException: io.opentelemetry.javaagent.shaded.instrumentation.kafka.internal.OpenTelemetryMetricsReporter cannot be found by org.ops4j.pax.web.pax-web-jsp_8.0.15 at org.eclipse.osgi.internal.loader.BundleLoader.generateException(BundleLoader.java:541) at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:536) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:416) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:168) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:527) at org.ops4j.pax.web.service.spi.servlet.OsgiServletContextClassLoader.loadClass(OsgiServletContextClassLoader.java:121) ... 94 more
I explored the ot-javaagent jar and all other jar https://opentelemetry.io/blog/2022/instrument-kafka-clients/ defined in this link but the class with package io.opentelemetry.javaagent.shaded.instrumentation.kafka.internal.OpenTelemetryMetricsReporter is not found.