Kafka

  • By Canonical Data Platform
Channel Revision Published Runs on
3/stable 123 24 May 2023
Ubuntu 22.04
3/edge 123 23 May 2023
Ubuntu 22.04
juju deploy kafka --channel 3/stable
Show information

Platform:

Ubuntu
22.04

Enable Monitoring

The Charmed Kafka Operator comes with the JMX exporter. The metrics can be queried by accessing the http://<unit-ip>:9101/metrics endpoints.

Additionally, the charm provides integration with the Canonical Observability Stack.

Deploy cos-lite bundle in a Kubernetes environment. This can be done by following the deployment tutorial. Since the Charmed Kafka Operator is deployed on a machine environment, it is needed to offer the endpoints of the COS relations. The offers-overlay can be used, and this step is shown in the COS tutorial.

Switch to COS K8s environment and offer COS interfaces to be cross-model related with Charmed Kafka VM model:

# Switch to Kubernetes controller, for the cos model.
juju switch <k8s_controller>:<cos_model_name>

juju offer grafana:grafana-dashboard grafana-dashboards
juju offer loki:logging loki-logging
juju offer prometheus:receive-remote-write prometheus-receive-remote-write

Switch to Charmed Kafka VM model, find offers and relate with them:

# We are on the Kubernetes controller, for the cos model. Switch to mysql model
juju switch <machine_controller_name>:<kafka_model_name>

juju find-offers <k8s_controller>:

A similar output should appear, if k8s is the k8s controller name and cos the model where cos-lite has been deployed:

Store      URL                                        Access  Interfaces
k8s        admin/cos.grafana-dashboards               admin   grafana_dashboard:grafana-dashboard
k8s        admin/cos.loki-logging                     admin   loki_push_api:logging
k8s        admin/cos.prometheus-receive-remote-write  admin   prometheus-receive-remote-write:receive-remote-write
...

Consume offers to be reachable in the current model:

juju consume k8s:admin/cos.prometheus-receive-remote-write
juju consume k8s:admin/cos.loki-logging
juju consume k8s:admin/cos.grafana-dashboards

Now, deploy grafana-agent (subordinate charm) and relate it with Charmed Kafka, later relate grafana-agent with consumed COS offers:

juju deploy grafana-agent
juju relate kafka:cos-agent grafana-agent
juju relate grafana-agent grafana-dashboards
juju relate grafana-agent loki-logging
juju relate grafana-agent prometheus-receive-remote-write

After this is complete, Grafana will show the new dashboards: Kafka Exporter and allows access for Charmed Kafka logs on Loki.


Help us improve this documentation

Most of this documentation can be collaboratively discussed and changed on the respective topic in the doc category of the Charmhub forum. See the documentation guidelines if you’d like to contribute.

Last updated a month ago. Help improve this document in the forum.