dockerkibanametricbeat

Why does my metricbeat extension ignore my ActiveMQ broker host configuration in Kibana docker?


I'm trying to set up a local Kibana instance with ActiveMQ for testing purposes. I've created a docker network called elastic-network. I have 3 containers in my network: elasticsearch, kibana and finally activemq. In my kibana container, I downloaded metric beats using the following shell command

curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-7.11.2-linux-x86_64.tar.gz

In the configuration file metricbeat.reference.yml, I've changed the host for my ActiveMQ instance running under the container activemq

- module: activemq
  metricsets: ['broker', 'queue', 'topic']
  period: 10s
  hosts: ['activemq:8161']
  path: '/api/jolokia/?ignoreErrors=true&canonicalNaming=false'
  username: admin # default username
  password: admin # default passwor

When I run metricbeat using the verbose parameter ./metricbeat -e I get some error mentioning that ActiveMQ API is unreachable. My problem is that metricbeat ignore my active mq broker configuration and tries to connect to localhost.

Is there a reason why my configuration could be ignored?


Solution

  • After looking through the documentation, I saw that for Linux, unlike the other OS, you also have to change the configuration in the module directory module.d/activemq.yml, not just the metricbeat.reference.yml

    # Module: activemq
    # Docs: https://www.elastic.co/guide/en/beats/metricbeat/7.11/metricbeat-module-activemq.html
    
    - module: activemq
      metricsets: ['broker', 'queue', 'topic']
      period: 10s
      hosts: ['activemq:8161']
      path: '/api/jolokia/?ignoreErrors=true&canonicalNaming=false'
      username: admin # default username
      password: admin # default password