JMX error fetching data

I'm trying to send JMX data using a Dockerized Metricbeat to the cloud, but I get the following error:

2019-08-30T09:30:45.033Z	INFO	module/wrapper.go:247	Error fetching data for metricset jolokia.jmx: error making http request: Post http://localhost:9998/jolokia: EOF

Here's some of my config:

- module: jolokia
  metricsets: ["jmx"]
  period: 1s
  hosts: ["localhost:9998"]
  namespace: "metrics"
    - mbean: 'java.lang:type=Runtime'
        - attr: Uptime
          field: uptime
          event: uptime
    - mbean: 'java.lang:type=GarbageCollector,name=ConcurrentMarkSweep'
        - attr: CollectionTime
          field: gc.cms_collection_time
        - attr: CollectionCount
          field: gc.cms_collection_count
    - mbean: 'java.lang:type=Memory'
        - attr: HeapMemoryUsage
          field: memory.heap_usage
        - attr: NonHeapMemoryUsage
          field: memory.non_heap_usage

I'm running my Java application with the following options:

I hope the above satisfies the requirement from the Elastic JMX docs for the JMX agent through JVM.

I've verified that I can connect and see metrics by running the jmxterm tool:

java -jar jmxterm-1.0.1-uber.jar -l localhost:9998
Welcome to JMX terminal. Type "help" for available commands.
#domain = JMImplementation:
#domain =
#domain = io.dropwizard:
#domain = java.lang:
java.lang:name=CodeHeap 'non-nmethods',type=MemoryPool
java.lang:name=CodeHeap 'non-profiled nmethods',type=MemoryPool

Any ideas why this is happening?

I was using the JVM flags, but apparently that's not a Jolokia agent.
Installing that as a separate JAR file fixed things.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.