Type to search.

JMX configuration options

Serverless Observability

Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Stack

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

APM Agent Java

The Elastic APM Java agent enables you to trace the execution of operations in your Java applications, sending performance metrics and errors to the Elastic APM Server.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

APM Agent Java 1.11+

The Elastic APM Java agent enables you to trace the execution of operations in your Java applications, sending performance metrics and errors to the Elastic APM Server.

Availability

  • Generally available since 1.11

    This functionality is generally available and ready for production usage.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

Report metrics from JMX to the APM Server

Can contain multiple comma separated JMX metric definitions:

Text
object_name[<JMX object name pattern>] attribute[<JMX attribute>:metric_name=<optional metric name>]
  • object_name:

    For more information about the JMX object name pattern syntax, see the ObjectName Javadocs.

  • attribute:

    The name of the JMX attribute. The JMX value has to be either a Number or a composite where the composite items are numbers. This element can be defined multiple times. An attribute can contain optional properties. The syntax for that is the same as for ObjectName.

    • metric_name:

      A property within attribute. This is the name under which the metric will be stored. Setting this is optional and will be the same as the attribute if not set. Note that all JMX metric names will be prefixed with jvm.jmx. by the agent.

The agent creates labels for each JMX key property such as type and name.

The JMX object name pattern supports wildcards. The attribute definition does NOT support wildcards, but a special definition attribute[*] is accepted (from 1.44.0) to mean match all possible (numeric) attributes for the associated object name pattern The definition object_name[*:type=*,name=*] attribute[*] would match all possible JMX metrics In the following example, the agent will create a metricset for each memory pool name (such as G1 Old Generation and G1 Young Generation)

Text
object_name[java.lang:type=GarbageCollector,name=*] attribute[CollectionCount:metric_name=collection_count] attribute[CollectionTime]

The resulting documents in Elasticsearch look similar to these (metadata omitted for brevity):

JSON
{
  "@timestamp": "2019-08-20T16:51:07.512Z",
  "jvm": {
    "jmx": {
      "collection_count": 0,
      "CollectionTime":   0
    }
  },
  "labels": {
    "type": "GarbageCollector",
    "name": "G1 Old Generation"
  }
}
JSON
{
  "@timestamp": "2019-08-20T16:51:07.512Z",
  "jvm": {
    "jmx": {
      "collection_count": 2,
      "CollectionTime":  11
    }
  },
  "labels": {
    "type": "GarbageCollector",
    "name": "G1 Young Generation"
  }
}

The agent also supports composite values for the attribute value. In this example, HeapMemoryUsage is a composite value, consisting of committed, init, used and max.

Text
object_name[java.lang:type=Memory] attribute[HeapMemoryUsage:metric_name=heap]

The resulting documents in Elasticsearch look similar to this:

JSON
{
  "@timestamp": "2019-08-20T16:51:07.512Z",
  "jvm": {
    "jmx": {
      "heap": {
        "max":      4294967296,
        "init":      268435456,
        "committed": 268435456,
        "used":       22404496
      }
    }
  },
  "labels": {
    "type": "Memory"
  }
}

dynamic config

Default Type Dynamic
<none> List true
Java System Properties Property file Environment
elastic.apm.capture_jmx_metrics capture_jmx_metrics ELASTIC_APM_CAPTURE_JMX_METRICS