A window into your running agent
Your agent is up. But how do you know it’s healthy? How many requests is it handling? Is it getting slower? Are errors piling up? This release adds a simple answer: a/metrics page. Visit it, and your agent tells you exactly how it’s doing — in a format that Prometheus (a popular monitoring tool) understands.
You don’t need to install anything extra. It’s built in.
What’s new
The /metrics page
Every Bindu agent now has a live stats page. A small piece of code sits in front of every request, quietly counting things. The /metrics endpoint then hands all those numbers over whenever you ask.
Here’s what gets counted:
| Type | What it tells you |
|---|---|
| Counters | Total HTTP requests (split by method, endpoint, and status), completed tasks, and errors |
| Histograms | How long requests and tasks take (bucketed: 0.1s, 0.5s, 1s, 5s, 10s, 30s, 60s) |
| Gauges | How many tasks are running right now, how many requests are in flight |
| Summaries | Size of incoming requests and outgoing responses |
- Counters only go up (e.g. total requests ever).
- Histograms bucket values (e.g. how many requests took under 1 second).
- Gauges go up and down (e.g. active tasks right now).
- Summaries track sizes or averages over time.
Try it in one line
Point Prometheus at your agent
In yourprometheus.yml:
Useful questions, in PromQL
Once Prometheus has the data, you can ask it things:How it fits together
The metrics middleware is placed last in the request pipeline on purpose. That way it sees the complete picture — the full response, its size, everything. The code lives in three small files: one for collecting numbers, one for the middleware, one for the endpoint. Clean and easy to follow.Do I need to do anything?
No. Metrics are on the moment you upgrade. Visit/metrics to see them. Hook up Prometheus whenever you’re ready.