Metricbeat jolokia agent for tomcat application

Hello
I'm contacting you about collecting metrics for a java tomcat application.
We want to collect metrics for our application and we need to put it on the ELK stack for graphing !!

here below many config :

==> on my tomcat server : 

-- jolokia running on port 8778
-- jolokia.yml :

  • module: jolokia
    metricsets: ["jmx"]
    hosts: ["localhost:8778"]
    period: 10s
    namespace: "jvm"
    jmx.mappings:
    • mbean: "java.lang:type=Memory"
      attributes:
      • attr: "HeapMemoryUsage"
        field: "memory.heap"
      • attr: "NonHeapMemoryUsage"
        field: "memory.nonheap"
    • mbean: "java.lang:type=Threading"
      attributes:
      • attr: "ThreadCount"
        field: "thread.count"
        event: threads
      • attr: "DaemonThreadCount"
        field: "thread.daemon"
        event: threads
        jmx.application:
        jmx.instance:

-- metricbeat.yml :

output.elasticsearch:
hosts: ["server_elastic:9200"]

the question is, we have to create a configuration on logstash? pipelines for example? or is the output to elasticsearch enough?

Thank you for your answer

regards
sai

Hi,

You do not need to create a LogStash pipeline for this usecase. MetricBeat will send the data in the correct form to ElasticSearch so you do not need to parse anything.

Best regards
Wolfram

okey i see
but with my configuration i have to restart services and it will work ?

many thanks

sai

It should work, yes.

@Wolfram_Haussig thanks for replying !!
do you know how to get dashboard on kibana ? should i create it ?
i can't get graphing for JMX on kibana !!!

regards
sai

note that i have not restart elk stack
and on my metricbeat machine log i see :

Mar 03 17:51:50 id-pp-prov-rt2-a metricbeat[16426]: 2020-03-03T17:51:50.274+0100        INFO        [monitoring]        log/log.go:145        Non-zero metrics in the last 30s        {"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":4350,"time":{"ms":112}},"total":{"ticks":10190,"time":{"ms":284},"value":10190},"user":{"ticks":5840,"time":{"ms":172}}},"handles":{"limit":{"hard":4096,"soft":1024},"open":10},"info":{"ephemeral_id":"25152cf0-58e5-4991-9da2-ada70ed237b3","uptime":{"ms":1050096}},"memstats":{"gc_next":15689216,"memory_alloc":8114200,"memory_total":1913013072,"rss":-2736128},"runtime":{"goroutines":46}},"libbeat":{"config":{"module":{"running":0}},"output":{"events":{"acked":69,"batches":6,"total":69},"read":{"bytes":2455},"write":{"bytes":89385}},"pipeline":{"clients":4,"events":{"active":1,"published":70,"total":70},"queue":{"acked":69}}},"metricbeat":{"jolokia":{"jmx":{"events":3,"success":3}},"system":{"cpu":{"events":3,"success":3},"filesystem":{"events":17,"success":17},"fsstat":{"events":1,"success":1},"load":{"events":4,"success":4},"memory":{"events":3,"success":3},"network":{"events":12,"success":12},"process":{"events":21,"success":21},"process_summary":{"events":3,"success":3},"socket_summary":{"events":3,"success":3}}},"system":{"load":{"1":0.07,"15":0.25,"5":0.2,"norm":{"1":0.07,"15":0.25,"5":0.2}}}}}}

Regards
sai

Hi Sai,

As the jolokia module can be widely configured and changed to fit the customers needs it would be hard - or even impossible - do create a dashboard for the customers.

I think the tomcat module of metricbeat - which is still in BETA - will get a dashboard as soon as it is GA as this has a defined set of metrics which can only be enabled or disabled...

So for now, you would have to create your own dashboards.

Best regards
Wolfram

ok thanks ,
but when i would create new dashboard in kibana i can't get jmx (spacename) !!

regards
sai

Hi @Wolfram_Haussig
Here below my conf in logstash server pipelines.yml:
- pipeline.id: pipeline_metrics
path.config: "/opt/logstash/config/conf.d/pipeline_metrics.conf"

    input {

beats {
port => 5044
}
}

output {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "%{[@metadata][beat]}-%{[@metadata][metricbeat-7.6.0]}"
}
}

my probleme i don't have any entries in elk stack :confused:
thanks

Hi,

Why are you using LogStash for this case? I think that the data is being written to the wrong index or it is not written at all. I would recommend that you configure MetricBeat to write directly to ElasticSearch. If this is not possible please check that:

  • does the logstash log show any errors?
  • if you have monitoring enabled please check if the pipeline is receiving and sending data
  • check in Kibana if you can see the correct index being created and written to

Best regards
Wolfram

1 Like

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