youndie@kotlin.website:~/src$ cat metrik/README.md

metrik

kotlin/native · ktor · compose · mcp
Monitoring for Ktor services in one native binary. The agent costs 106 nanoseconds per request and a UDP packet a minute; percentiles are merged across instances rather than averaged, and every chart carries the deploy markers that explain it.

Why it exists

A Prometheus, a Grafana and a time-series database is a lot of moving parts to answer four questions. metrik answers them from one binary and one SQLite file, with no scrape configuration and no service discovery — and writes to Telegram when the answers get worse.

What you get

  • An agent that costs the monitored service 106 nanoseconds per request and one UDP packet a minute. Aggregation happens in-process; nothing is scraped.
  • Percentiles merged, not averaged. Three instances reporting p99 of 100 ms, 100 ms and 400 ms do not have a service p99 of 200 ms — that number means nothing. Exponential histograms are merged and the quantile read from the result.
  • Route templates as labels (/users/{id}), so cardinality stays bounded instead of growing one series per user.
  • Deploy markers on every chart, because "worse" is only actionable with "worse after what".
  • Alerts on error rate, latency, memory and silence, with hysteresis and a cooldown.
  • Three ways to read it: a Compose Multiplatform dashboard, a terminal client, and an MCP endpoint for an agent.

Install

docker run -p 8080:8080 ghcr.io/youndie/metrik:latest
repositories { maven("https://reposilite.kotlin.website/snapshots") }
dependencies { implementation("ru.workinprogress.metrik:agent:<VERSION>") }

Live at metrik.kotlin.website.