[AMQ Streams] Kafka Connect metrics fails with FileNotFoundException: /opt/kafka/custom-config/metrics-config.yml (No such file or directory)

Solution Verified - Updated -

Issue

  • Kafka Connect metrics fails with the following error:

    Exception in thread "main" java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513)
    at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525)
    Caused by: java.io.FileNotFoundException: /opt/kafka/custom-config/metrics-config.yml (No such file or directory)
    at java.base/java.io.FileInputStream.open0(Native Method)
    at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
    at java.base/java.io.FileInputStream.(FileInputStream.java:157)
    at java.base/java.io.FileReader.(FileReader.java:75)
    at io.prometheus.jmx.shaded.io.prometheus.jmx.JmxCollector.(JmxCollector.java:78)
    at io.prometheus.jmx.shaded.io.prometheus.jmx.JavaAgent.premain(JavaAgent.java:29)
    ... 6 more
    *** java.lang.instrument ASSERTION FAILED ***: "result" with message agent load/premain call failed at         ./src/java.instrument/share/native/libinstrument/JPLISAgent.c line: 422
    FATAL ERROR in native method: processing of -javaagent failed, processJavaStart failed
    
  • The kafka connect metrics is looking for metrics-config.yaml instead of metrics-config.json.

Environment

  • Red Hat AMQ Streams 2.1
  • Red Hat OpenShift Container Platform (RHOCP) 4.10

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content