Monitoring redpanda inside Kubernetes #2759
rauanmayemir
started this conversation in
Flight Rules
Replies: 1 comment
-
This is a great piece @rauanmayemir !!! Very cool |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Redpanda has great tooling when it comes to monitoring your cluster with Grafana and Prometheus.
However, it requires knowing your observability stack and being able to configure prometheus which I don't. I wanted something simple that will just show me the metrics, graphs, and whatnot.
Let's assume that we already have Redpanda up and running under
redpanda-ns
namespace, and jump in to setting up our monitoring.Prometheus Operator
We're going to use Prometheus Operator. One would think that using a k8s operator complicates the stack, not simplifies it. But to me it turned out to be a very simple and robust solution once you grasp the concept of service monitors.
Installing the operator is just a one-yamler bundle with all the stuff, but for some reason it inconveniently installs everything in the default namespace, so unless it doesn't bother you we're going to patch it to use a
monitoring-ns
namespace instead (we need to create it ourselves).Let's also create a service account and a cluster role:
I just digged all the parameters from somewhere, our agent might need less permissions.
Prometheus instance
Prometheus operator operates prometheuses, and we need an actual Prometheus instance that's going to collect the metrics.
This will create a prometheus deployment and a dedicated service in case we want to use separate instances for our workloads.
Service Monitor
Now we need to tell our prometheus to start monitoring Redpanda.
The important part here is setting the right namespace and labels selectors, we assume that the cluster is called
redpanda
.Grafana
Data is being collected in prometheus, now we need to show it in Grafana.
First, we create a prometheus datasource and set its http url to
http://prometheus-redpanda.monitoring-ns:9090
.Then we generate a grafana dashboard:
The dashboard will show the state of the Redpanda cluster, but frankly I don't understand most of the graphs because they're all about low-level maintenance.
We want something higher-level and also monitor our actual data: topics, partitions, etc.
Kminion
Kminion is a prometheus exporter that we need to install and operate separately, but the value it gives is so worth it.
Let's customize helm values and set our brokers and sasl config:
Here's the part where we finally enjoy the help of the prometheus operator.
We created one more service monitor that will use the same prometheus instance. And since we already have it as datasource in Grafana, we just need to install dashboards to visualize the data collected by kminion. Fortunately, all the dashboards are published to the official grafana registry.
Kminion gives us full observability into our cluster and data. We could get realtime telemetry by enabling end-to-end testing where kminion would periodically produce and consume messages measuring the latency and uptime, but for some reason it didn't work for me. As I don't have much need for it yet, I tabled the idea to tinker it in future.
Beta Was this translation helpful? Give feedback.
All reactions