- Metricbeat Reference: other versions:
- Overview
- Getting started with Metricbeat
- Setting up and running Metricbeat
- Upgrading Metricbeat
- How Metricbeat works
- Configuring Metricbeat
- Specify which modules to run
- Specify general settings
- Load external configuration files
- Configure the internal queue
- Configure the output
- Set up index lifecycle management
- Specify SSL settings
- Filter and enhance the exported data
- Parse data by using ingest node
- Set up project paths
- Set up the Kibana endpoint
- Load the Kibana dashboards
- Load the Elasticsearch index template
- Configure logging
- Use environment variables in the configuration
- Autodiscover
- YAML tips and gotchas
- Regular expression support
- HTTP Endpoint
- metricbeat.reference.yml
- Beats central management
- Modules
- Aerospike module
- Apache module
- Ceph module
- Couchbase module
- Docker module
- Dropwizard module
- Elasticsearch module
- Elasticsearch ccr metricset
- Elasticsearch cluster_stats metricset
- Elasticsearch index metricset
- Elasticsearch index_recovery metricset
- Elasticsearch index_summary metricset
- Elasticsearch ml_job metricset
- elasticsearch ml_job MetricSet
- Elasticsearch node metricset
- Elasticsearch node_stats metricset
- Elasticsearch pending_tasks metricset
- elasticsearch pending_tasks MetricSet
- Elasticsearch shard metricset
- envoyproxy module
- Etcd module
- Golang module
- Graphite module
- HAProxy module
- HTTP module
- Jolokia module
- Kafka module
- Kibana module
- Kubernetes module
- Kubernetes apiserver metricset
- Kubernetes container metricset
- Kubernetes event metricset
- Kubernetes node metricset
- Kubernetes pod metricset
- Kubernetes state_container metricset
- Kubernetes state_deployment metricset
- Kubernetes state_node metricset
- Kubernetes state_pod metricset
- Kubernetes state_replicaset metricset
- Kubernetes state_statefulset metricset
- Kubernetes system metricset
- Kubernetes volume metricset
- kvm module
- Logstash module
- Memcached module
- MongoDB module
- Munin module
- MySQL module
- Nginx module
- PHP_FPM module
- PostgreSQL module
- Prometheus module
- RabbitMQ module
- Redis module
- System module
- System core metricset
- System cpu metricset
- System diskio metricset
- System filesystem metricset
- System fsstat metricset
- System load metricset
- System memory metricset
- System network metricset
- System process metricset
- System process_summary metricset
- System raid metricset
- System socket metricset
- System socket_summary metricset
- System uptime metricset
- traefik module
- uwsgi module
- vSphere module
- Windows module
- ZooKeeper module
- Exported fields
- Aerospike fields
- Alias fields
- Apache fields
- Beat fields
- Ceph fields
- Cloud provider metadata fields
- Common fields
- Couchbase fields
- Docker fields
- Docker fields
- Dropwizard fields
- Elasticsearch fields
- envoyproxy fields
- Etcd fields
- Golang fields
- Graphite fields
- HAProxy fields
- Host fields
- HTTP fields
- Jolokia fields
- Kafka fields
- Kibana fields
- Kubernetes fields
- Kubernetes fields
- kvm fields
- Logstash fields
- Memcached fields
- MongoDB fields
- Munin fields
- MySQL fields
- Nginx fields
- PHP_FPM fields
- PostgreSQL fields
- Prometheus fields
- RabbitMQ fields
- Redis fields
- System fields
- traefik fields
- uwsgi fields
- vSphere fields
- Windows fields
- ZooKeeper fields
- Monitoring Metricbeat
- Securing Metricbeat
- Troubleshooting
- Contributing to Beats
Jolokia jmx metricset
editJolokia jmx metricset
editThe jmx
metricset collects metrics from
Jolokia agents.
Features and configuration
editTested with Jolokia 1.5.0.
To collect metrics from a Jolokia instance, define a mapping section that
specifies an MBean ObjectName
followed by an array of attributes to fetch. For
each attribute in the array, specify the Elastic field name where the
returned value will be saved.
For example, to get the Uptime
attribute from the java.lang:type=Runtime
MBean and map it to an event field called jolokia.testnamespace.uptime
,
configure the following mapping:
- module: jolokia metricsets: ["jmx"] hosts: ["localhost:8778"] namespace: "testnamespace" http_method: "POST" jmx.mappings: - mbean: 'java.lang:type=Runtime' attributes: - attr: Uptime field: uptime event: uptime target: url: "service:jmx:rmi:///jndi/rmi://targethost:9999/jmxrmi" user: "jolokia" password: "s!cr!t"
The |
|
The |
|
The field where the returned value will be saved. This field will be called
|
|
The |
If the underlying attribute is an object (such as the HeapMemoryUsage
attribute in java.lang:type=Memory
), its structure will be published to
Elastic "as is".
You can configure nested metric aliases by using dots in the mapping name (for
example, gc.cms_collection_time
). For more examples, see
/jolokia/jmx/test/config.yml.
All metrics from a single mapping will be POSTed to the defined host/port and sent to Elastic as a single event. To make it possible to differentiate between metrics from multiple similar applications running on the same host, you should configure multiple modules.
When wildcards are used, an event is sent to Elastic for each matching
MBean, and an mbean
field is added to the event.
Accessing Jolokia via POST or GET method
editAll requests to Jolokia are made by default using HTTP POST method. However, there are specific circumstances
on the environment where Jolokia agent is deployed, in which POST method can be unavailable. In this case you can use
HTTP GET method, by defining http_method
attribute. In general you can use either POST or GET, but GET has the following
drawbacks:
- Proxy requests are not allowed.
-
If more than one
jmx.mappings
are defined, then Metricbeat will perform as many GET requests as the mappings defined. For example the following configuration with 3 mappings will create 3 GET requests, one for every MBean. On the contrary, if you use HTTP POST, Metricbeat will create only 1 request to Jolokia.
- module: jolokia metricsets: ["jmx"] enabled: true period: 10s hosts: ["localhost:8080"] namespace: "jolokia_metrics" path: "/jolokia" http_method: 'GET' jmx.mappings: - mbean: 'java.lang:type=Memory' attributes: - attr: HeapMemoryUsage field: memory.heap_usage - attr: NonHeapMemoryUsage field: memory.non_heap_usage - mbean: 'Catalina:name=*,type=ThreadPool' attributes: - attr: port field: catalina.port - attr: maxConnections field: catalina.maxConnections - mbean: 'java.lang:type=Runtime' attributes: - attr: Uptime field: uptime
Limitations
edit-
All Jolokia requests have
canonicalNaming
set tofalse
. See the Jolokia Protocol documentation for more detail about this parameter. -
If
http_method
is set toGET
, then Proxy requests are not allowed. Thus, setting a value totarget
section is going to fail with an error.
Exposed fields, dashboards, indexes, etc.
editBecause this module is very general and can be tailored for any application that exposes its metrics over Jolokia, it comes with no exposed field descriptions, dashboards, or index patterns.
Fields
editFor a description of each field in the metricset, see the exported fields section.
Here is an example document generated by this metricset:
{ "@timestamp": "2017-10-12T08:05:34.853Z", "beat": { "hostname": "host.example.com", "name": "host.example.com" }, "event": { "dataset": "jolokia.jmx", "duration": 115000 }, "jolokia": { "testnamespace": { "memory": { "heap_usage": { "committed": 514850816, "init": 536870912, "max": 7635730432, "used": 42087240 }, "non_heap_usage": { "committed": 29229056, "init": 2555904, "max": -1, "used": 28395640 } }, "uptime": 239893 } }, "metricset": { "host": "127.0.0.1:8778", "module": "jolokia", "name": "jmx", "namespace": "jolokia.testnamespace", "rtt": 115 } }
On this page