// This assembly is included in the following assemblies:
//
// deploying/deploying.adoc

[id='assembly-metrics-{context}']
= Introducing metrics to Kafka

[role="_abstract"]
You can use Prometheus and Grafana to monitor your Strimzi deployment.

You can monitor your Strimzi deployment by viewing key metrics on dashboards and setting up alerts that trigger under certain conditions.
Metrics are available for each of the components of Strimzi.

To provide metrics information, Strimzi uses Prometheus rules and Grafana dashboards.

When configured with a set of rules for each component of Strimzi, Prometheus consumes key metrics from the pods that are running in your cluster.
Grafana then visualizes those metrics on dashboards.
Strimzi includes example Grafana dashboards that you can customize to suit your deployment.

Depending on your requirements, you can:

* xref:assembly-metrics-setup-{context}[Set up and deploy Prometheus to expose metrics]
* xref:proc-metrics-kafka-deploy-options-{context}[Deploy Kafka Exporter to provide additional metrics]
* xref:proc-metrics-grafana-dashboard-{context}[Use Grafana to present the Prometheus metrics]

With Prometheus and Grafana set up, you can use the example Grafana dashboards provided by Strimzi for monitoring.

Additionally, you can configure your deployment to track messages end-to-end by link:{BookURLUsing}#assembly-distributed-tracing-str[setting up distributed tracing^].

NOTE: Strimzi provides example installation files for Prometheus and Grafana.
You can use these files as a starting point when trying out monitoring of Strimzi.
For further support, try engaging with the Prometheus and Grafana developer communities.

.Supporting documentation for metrics and monitoring tools
For more information on the metrics and monitoring tools, refer to the supporting documentation:

* {PrometheusHome}
* {PrometheusConfig}
* {kafka-exporter-project}
* {GrafanaHome}
* link:http://kafka.apache.org/documentation/#monitoring[Apache Kafka Monitoring] describes JMX metrics exposed by Apache Kafka
* link:https://zookeeper.apache.org/doc/current/zookeeperJMX.html[ZooKeeper JMX] describes JMX metrics exposed by Apache ZooKeeper

//what is Consumer lag?
include::modules/con_kafka-exporter-lag.adoc[leveloffset=+1]
//Understanding metrics for Cruise Control
include::modules/con-metrics-cruise-control.adoc[leveloffset=+1]
//Example metrics files
include::assembly-metrics-config-files.adoc[leveloffset=+1]
//How to set up Prometheus
include::assembly_metrics-prometheus-setup.adoc[leveloffset=+1]
//How to add Grafana dashboards
include::modules/proc_metrics-grafana-dashboard.adoc[leveloffset=+1]
