You can use the JMX metrics provided by link:https://zookeeper.apache.org/doc/r3.1.2/zookeeperJMX.html[Zookeeper] and link:http://docs.confluent.io/3.0.0/kafka/monitoring.html[Kafka] to monitor {prodname}.
To use these metrics, you must enable them when you start the Zookeeper, Kafka, and Kafka Connect services.
Enabling JMX involves setting the correct environment variables.
The environment variables that you must set depend on whether you are running Zookeeper, Kafka, and Kafka Connect in a local installation or in Docker containers.
The IP address or resolvable host name of the Docker host,
which JMX uses to construct a URL sent to the JMX client.
A value of `localhost` or `127.0.0.1` will not work.
Typically, `0.0.0.0` can be used.
The value is used to specify the JVM parameter `-Djava.rmi.server.hostname=$JMXHOST`.
`JMXAUTH`::
Whether JMX clients must use password authentication when connecting.
Must be either `true` or `false`.
The default is `false`.
The value is used to specify the JVM parameter `-Dcom.sun.management.jmxremote.authenticate=$JMXAUTH`.
`JMXSSL`::
Whether JMX clients connect using SSL/TLS.
Must be either `true` or `false`.
The default is `false`.
The value is used to specify the JVM parameter `-Dcom.sun.management.jmxremote.ssl=$JMXSSL`.
`JMXLOG4J`::
Whether the Log4J JMX MBeans should be disabled.
Must be either `true` or `false`.
The default is `true`.
The value is used to specify the JVM parameter `-Dzookeeper.jmx.log4j.disable=$JMXLOG4J`.
.Enabling JMX in a Zookeeper Docker container
====
The following example Docker command starts a container using the `debezium/zookeeper` image with values for the `JMXPORT` and `JMXHOST` environment variables,
and maps the Docker host's port 9010 to the container's JMX port:
The IP address or resolvable host name of the Docker host,
which JMX uses to construct a URL sent to the JMX client.
A value of `localhost` or `127.0.0.1` will not work.
Typically, `0.0.0.0` can be used.
The value is used to specify the JVM parameter `-Djava.rmi.server.hostname=$JMXHOST`.
`JMXAUTH`::
Whether JMX clients must use password authentication when connecting.
Must be either `true` or `false`.
The default is `false`.
The value is used to specify the JVM parameter `-Dcom.sun.management.jmxremote.authenticate=$JMXAUTH`.
`JMXSSL`::
Whether JMX clients connect using SSL/TLS.
Must be either `true` or `false`.
The default is `false`.
The value is used to specify the JVM parameter `-Dcom.sun.management.jmxremote.ssl=$JMXSSL`.
.Enabling JMX in a Kafka Docker container
====
The following example Docker command starts a container using the `debezium/kafka` image with values for the `JMXPORT` and `HOST_NAME` environment variables,
and maps the Docker host's port 9011 to the container's JMX port:
The IP address or resolvable host name of the Docker host,
which JMX uses to construct a URL sent to the JMX client.
A value of `localhost` or `127.0.0.1` will not work.
Typically, `0.0.0.0` can be used.
The value is used to specify the JVM parameter `-Djava.rmi.server.hostname=$JMXHOST`.
`JMXAUTH`::
Whether JMX clients must use password authentication when connecting.
Must be either `true` or `false`.
The default is `false`.
The value is used to specify the JVM parameter `-Dcom.sun.management.jmxremote.authenticate=$JMXAUTH`.
`JMXSSL`::
Whether JMX clients connect using SSL/TLS.
Must be either `true` or `false`.
The default is `false`.
The value is used to specify the JVM parameter `-Dcom.sun.management.jmxremote.ssl=$JMXSSL`.
.Enabling JMX in a Kafka Connect Docker container
====
The following example Docker command starts a container using the `debezium/connect` image with values for the `JMXPORT` and `JMXHOST` environment variables,
and maps the Docker host's port 9012 to the container's JMX port:
[source,shell,options="nowrap"]
----
$ docker run -it --rm --name connect \
-p 8083:8083 -p 9012:9012 \
-e JMXPORT=9012 -e JMXHOST=10.0.1.10 \
-e GROUP_ID=1 \
-e CONFIG_STORAGE_TOPIC=my_connect_configs \
-e OFFSET_STORAGE_TOPIC=my_connect_offsets \
-e STATUS_STORAGE_TOPIC=my_connect_statuses \
--link zookeeper:zookeeper \
--link kafka:kafka \
--link mysql:mysql \
debezium/connect:latest
----
====
[id="using-prometheus-grafana"]
== Using Prometheus and Grafana
The metrics exposed by {prodname} and Kafka can be exported and displayed with https://prometheus.io/[Prometheus] and https://grafana.com/[Grafana].
You can find an example for the required configuration and example dashboards for different connectors in the https://github.com/debezium/debezium-examples/tree/master/monitoring[Debezium examples repository].
[NOTE]
====
These dashboards are not part of {prodname} itself and are maintained on a best-effort basis.