Skip to main content

How we monitor our own Kratix instance

· 6 min read
Derik Evangelista
Engineer @ Syntasso

Most platform dashboards I see answer the question "Is the cluster healthy?", which is a useful question, but it is not the one our users often ask. A developer who requested a database does not care about controller memory. They care whether the database turned up.

So when we rebuilt the dashboard we use to run our own Kratix platform, we started from that question instead: is the platform delivering? This post walks through what we measure, why, how it reaches us in Slack, and where it will not fit your setup. The dashboard itself is at the end for you to import.

Example of the Kratix monitoring dashboard

Anything other than zero needs someone​

The summary row holds six tiles: Promises unavailable, requests not delivered, workloads not written, Destinations not ready, failed pipelines, and GitOps not ready.

They are each a count of things that are broken for a user at this moment. None of them is a rate, a percentage or a threshold someone has to interpret. Zero is green. Anything else means a person should look.

We applied the same thinking to empty panels. A table with no rows is ambiguous: is it healthy, or is the query broken? Ours say "Everything requested has been delivered" or "No failed pipeline runs" when there is nothing to show. A blank panel shouldn't be mistaken for good news.

The rows follow a request, not the architecture​

Below the top row, the dashboard is ordered by the journey a request takes through Kratix. If a tile is red, you read downwards until you find the stage where the request stopped.

StageWhat we watchWhy
Promisekratix_promise_status, by Available and ReconciledAn unavailable Promise blocks every request for it
PipelineFailed Jobs named kratix-*, and init containers that ended with anything but CompletedEach pipeline step is an init container, so this names the step that stopped the run and why
Workkratix_work_status where Ready is not TrueThe request was made but its output has not reached every Destination
Schedulingkratix_workplacement_outcomes_total by resultUnscheduled means no Destination matches the request's selectors
State storekratix_workplacement_status and kratix_workplacement_writes_totalScheduled is not the same as written
GitOpsFlux gotk_resource_info and reconcile duration on the Destination clustersKratix can write perfectly and nothing gets applied

The last row is the one people tend to leave out. Kratix's job ends when a document lands in the state store, but the user's request is not finished until the GitOps agent on the Destination applies it. Since a platform team owns that whole path, the dashboard covers it.

Where we could, the panel also says what to do next. The failed pipelines table includes the kubectl logs command for the Job it lists.

Kratix itself comes last​

Manager restarts, reconcile errors and manager memory sit at the very bottom, in a row called "Kratix".

That ordering is deliberate. Controller health is a cause, and the rows above it are the effects. If every request is delivered, a blip in reconcile errors is a curiosity. If requests are stuck, this row tells you whether Kratix is the reason. Only one of its panels is coloured: manager restarts, because each restart pauses every Promise and request until the manager is back.

Anything deeper lives on a separate "Kratix internals" dashboard, linked from the top. So does the question of who changed what, which belongs to the SKE platform audit dashboard.

Slack notifications tell us when to open the dashboard​

We use Grafana alert rules, evaluated every five minutes and sent to one Slack channel. The rules live in git and are applied by the Grafana operator, which makes them read-only in the Grafana UI.

The rules read the same telemetry as the dashboard. A Kratix manager restart, a failed Job, a controller panic, a crash-looping pod and an OOM kill each produce a message that names the cluster, the namespace and the thing that broke, with a link to silence it. When the alert clears, Slack says so and says how long it lasted. Not every top-row tile is an alert today. The alerts tell us something happened, and the dashboard shows where in the request's journey it happened.

Example of the alerts triggered by our dashboard

Where this may not work for you​

The Grafana dashboard was built for our environment: one platform cluster, one worker cluster, a handful of Destinations. Consider the following if you want to import our dashboard directly:

  • Our Destinations run Flux. The GitOps row and the "GitOps not ready" tile read Flux's gotk_* metrics. On Argo CD they will show nothing, and the tile will show a green zero that means "no data", not "healthy". wap the queries for argocd_app_info or remove the row.
  • We run kube-state-metrics or cAdvisor. Kratix reports Promises, Works, WorkPlacements and Destinations. Everything about pipelines, restarts and memory comes from the cluster's own metrics.
  • Our metrics have the cluster label. Every query filters on it, and both dropdowns are built from it. Grafana Cloud's Kubernetes integration adds it for us. A self-hosted Prometheus may call it something else.
  • We are running at a small scale. This is monitoring for our soak test envrionment which has a lot of change, but not a lot of volume. The tables list one row per undelivered Work or unwritten WorkPlacement. That is readable with tens of requests. With thousands, a single bad Destination fills the page, and you will want to group by Promise or Destination first

Final thoughts​

The queries are the least interesting part of this dashboard. What made it useful was deciding who it is for and what they are asking. Ours is for the team running Kratix, and the question is whether the people using the platform got what they asked for. That is treating the platform as a product in a very small, practical form: measure the promise you made to your users before you measure your own machinery.

Both our Kratix platform overviews and Kratix internals dashboards are here. Import it, pick your metrics datasource and platform cluster, and then change it. Your top row should hold the things that need someone on your platform, and they will not be exactly the same as ours. If you find a measure we are missing, we would like to hear about it.