MetricBeat to capture all available Mbeans from Jolokia

Hello Team,

I really enjoyed working with Metricbeat and jolokia together to get my application Mbeans.
Below is my module configuration from metricbeat.yml

In this I have one static Mbean name which will never get changes but I have a dynamic Mbean : 'com.app:name=JobDetailedDiagnostics-APT/KMN/FACILITY' which gets changed everytime I restart my server.

Below are my questions:

  1. I understand Jolokia exposes dynamically created Mbeans but from metricbeat side, how do i configure dynamically created Mbeans?

  2. I have around 100+ Mbeans. I want to push all the Mbean information. So is there any way like jmx.mappings: all so that it would fetch all the available Mbeans?
    (In this case I dont need to worry about Dynamically created Mbeans too as everything will be pushed regardless of dynamic or static)

  • module: jolokia
    metricsets: ["jmx"]
    period: 10s
    hosts: ["http://localhost:8280/jolokia-war-1.6.0/"]
    namespace: "n4metrics"
    username: "tomcat"
    password: "******"
    jmx.mappings:
    • mbean: 'com.app:name=SystemHealthDiagnostics'
      attributes:
      • attr: ActiveSessions
        field: ActiveSessions
      • attr: NumberOfSlowQueries
        field: NumberOfSlowQueries
      • attr: ActiveDatabaseConnections
        field: ActiveDatabaseConnections
      • attr: SlowQueriesTimeFrameInMillis
        field: SlowQueriesTimeFrameInMillis
      • attr: SystemActive
        field: SystemActive
      • attr: Description
        field: Description
    • mbean: 'com.app:name=JobDetailedDiagnostics-APT/KMN/FACILITY'
      attributes:
      • attr: LocallyScheduledJobs
        field: LocallyScheduledJobs
      • attr: LocallyExecutingJobs
        field: LocallyExecutingJobs
      • attr: AllDiagnostics
        field: AllDiagnostics
      • attr: LocallyScheduledJobCount
        field: LocallyScheduledJobCount
      • attr: LocalExecutingJobCount
        field: LocalExecutingJobCount
      • attr: MaxThreadPoolCount
        field: MaxThreadPoolCount
      • attr: Description
        field: Description
        ..........
        ..........
        ..........

Hi @Kathir_J,

Before proceeding further I want to clarify some terminology first.

When you say "dynamic Mbean" are you referring to the dynamic naming of the class, i.e. JobDetailedDiagnostics-*. Or are you referring to the concept of classes implementing the DynamicMBean interface, as shown here: https://docs.oracle.com/cd/E19206-01/816-4178/6madjde4l/index.html?

Yep.. I meant dynamic naming of the class. Anyways I found out that with * search, able to retrieve the dynamically created Mbean attributes.
Thanks anyways.
My 2nd question was to include all Mbeans without mentioning Mbean names under jmx mappings?

something like,

module: jolokia
metricsets: ["jmx"]
period: 10s
hosts: ["http://localhost:8280/jolokia-war-1.6.0/"]
namespace: "n4metrics"
username: "tomcat"
password: "******"
jmx mappings: *

Is there a way?

We don't support something like jmx.mappings: * because it could lead to a potential explosion of fields in Elasticsearch, depending on the number of MBeans and the number of attributes in each.

It's something we could consider, though. If you are on GitHub, please file an issue for this request here: https://github.com/elastic/beats/issues/new. That way you'll be notified of any discussions and progress. If you aren't on GitHub, let me know and I'll file the issue for you.

Have raised an issue in Github.

https://github.com/elastic/beats/issues/8168

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