// This assembly is included in the following assemblies:
//
// metrics/assembly_metrics-grafana.adoc

[id='proc-metrics-grafana-dashboard-{context}']

= Enabling the example Grafana dashboards

Set up a Prometheus data source and example dashboards to enable Grafana for monitoring.

NOTE: No alert notification rules are defined.

When accessing a dashboard, you can use the `port-forward` command to forward traffic from the Grafana pod to the host.

For example, you can access the Grafana user interface by:

. Running `kubectl port-forward svc/grafana 3000:3000`
. Pointing a browser to `http://localhost:3000`

NOTE: The name of the Grafana pod is different for each user.

.Procedure

. Access the Grafana user interface using `admin/admin` credentials.
+
On the initial view choose to reset the password.
+
image::grafana_login.png[Grafana login]

. Click the *Add data source* button.
+
image::grafana_home.png[Grafana home]

. Add Prometheus as a data source.
+
* Specify a name
* Add _Prometheus_ as the type
* Specify the connection string to the Prometheus server (http://prometheus-operated:9090) in the URL field

. Click *Add* to test the connection to the data source.
+
image::grafana_prometheus_data_source.png[Add Prometheus data source]

. Click *Dashboards*, then *Import* to open the _Import Dashboard_ window and import the example dashboards (or paste the JSON).
+
image::grafana_import_dashboard.png[Add Grafana dashboard]

After importing the dashboards, the Grafana dashboard homepage presents Kafka and ZooKeeper dashboards.

When the Prometheus server has been collecting metrics for a {ProductName} cluster for some time, the dashboards are populated.

.Kafka dashboard
[caption="Kafka dashboard"]
image::grafana_kafka_dashboard.png[Kafka dashboard]

.ZooKeeper dashboard
[caption="ZooKeeper dashboard"]
image::grafana_zookeeper_dashboard.png[ZooKeeper dashboard]
