Monitoring And Alerts
Monitoring on Klok has three layers. Each is the natural next step from the one before, and you only go further when you need to.
| Layer | Where | Answers |
|---|---|---|
| Simple alerts | klok.dev | "Tell me when this integration fails, hangs or does not run" |
| Advanced monitoring | OpenSearch Dashboards, https://logs.klok.dev |
Any search over every log field, dashboards, and monitors you build yourself |
| Platform reachability | Uptime Kuma | Whether the platform answers from the outside at all |
All three read the same thing: the log events every Klok route writes, and the transaction Klok builds from them per correlation id (Logging, Tracing, And Correlation). Because every service logs alike, the same kinds of alert fit every integration; Alerting By Integration Pattern says which fit where.
What there is today
- Run → Logs in klok.dev lists the failed and the hung transactions of tenant klok as they happen, and Kloker analyses each failure and mails the analysis to the people of the failed route's project. See Logs.
- Platform monitors. The platform's own monitors are kept in Git (
klok-environment-setup, roleopensearch_alerting) and mail the platform admins. The first watches the services' console logs for a lost broker connection, which the integration logs cannot show, because they travel over the broker. - OpenSearch Dashboards holds every log event and transaction of tenant klok for 30 days, and the console logs of the pods. Every person signs in with their own Klok account: a tenant's developers and admins see the whole tenant's logs, and people with access to some domains see those domains. Finding And Searching Logs In OpenSearch Dashboards shows how to sign in and find what you look for.
- Uptime Kuma watches the platform from the outside and alerts the platform admins when it does not answer.
What is coming
The next part of Klok's logging (KLK001 part 3, designed in klok/integration-solutions,
solutions/KLK001_platform_logging/design-alerting.md) brings:
- Simple alerts in klok.dev, next to what they watch: a file flow, an integration project's routes, a solution, a transaction. You will pick a template (Failures, Hung, Did not run, Slow, Expected files and others), each with defaults, or tell Kloker in plain words what you want to hear about. Klok will check them itself on a schedule against the logs and mail the people of the integration at once; Kloker's analysis of a failure will follow in the same alert.
- The step from simple to advanced. Each alert in klok.dev will show the log query it runs and open it in Dashboards, and this guide will walk you from that query to a monitor of your own, built by hand in Dashboards.
Which layer to use
- Start in klok.dev. Most integrations need two or three alerts: that something failed, that something hung, and that something did not run when it should have.
- Go to OpenSearch Dashboards when you need what a template cannot say: several conditions together, a trend, a dashboard for a team, a search across many integrations, or an alert on a field no template uses.
- Leave reachability to the platform: Uptime Kuma is not for single integrations.
A monitor without an owner becomes noise. Before you add one, decide who acts on it and what they do.