# metrik

> Four questions — how many requests, how many errors, how slow, is memory running out — answered by one native binary. The agent costs 106 ns per request.

Page: https://kotlin.website/metrik

## 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

```bash
docker run -p 8080:8080 ghcr.io/youndie/metrik:latest
```

```kotlin
repositories { maven("https://reposilite.kotlin.website/snapshots") }
dependencies { implementation("io.github.youndie.metrik:agent:<VERSION>") }
```

Live at [metrik.kotlin.website](https://metrik.kotlin.website).
