Kest

Search

Search the documentation

Observability

Overview

Know what your application is doing in production, and why.

When something goes wrong at 3 a.m. you need to answer, quickly: is it broken, where, and why? Observability is having the data to answer that without guessing. It rests on four kinds of data, and each answers a different question:

DataLooks likeAnswersKest page
Metricsnumbers over time"Is something wrong? How bad?" (error rate, latency, memory)Metrics
Tracesthe path of one request across services"Where is it slow or failing?"OpenTelemetry, Distributed tracing
Logslines of text"What happened, in detail?"LGTM stack
Errorsgrouped exceptions with stack traces"What crashed, and who was affected?"Error monitoring

Plus two more things that are not data but act on it: health checks (is this instance fit to receive traffic?) and alerts (wake a human when a metric crosses a line).

Loading diagram…

Start small, in this order

  1. Health checks and error monitoring (a few lines each). You learn when it is down and what crashed.
  2. Metrics and the built-in dashboard. You see traffic, errors and latency.
  3. Alerts on error rate and latency (Production rules). You are told instead of having to look.
  4. Logs and traces together in Grafana, the LGTM stack, as soon as you have more than one service or one bug you cannot explain.
// step 1 and 2 in one place
Kest.run<AppModule> { import(SentryModule.forRoot { dsn = System.getenv("SENTRY_DSN") }, MetricsModule.forRoot { jvm = true }) }
app.http(adapter) {
    useHealth("/health/ready") { ormConnections(orm) }
    useMetrics()
    useMetricsDashboard()
}

Words you will meet

  • Instrumentation: code that produces observability data. Kest instruments HTTP, queues, schedules and more for you; you add your own (@Traced, a counter).
  • Collector: a service that receives data from many applications and forwards it to storage (OpenTelemetry Collector, Grafana Alloy).
  • Cardinality: how many different values a label has. Keep it low (Metrics).
  • SLO: a target you promise, such as "99.9% of requests succeed". Alerts are best tied to one.
  • Sampling: keeping only a fraction of traces to save cost.

See Choosing an APM for where to send the data.

Read more