metriclens is a zero-config, drop-in observability layer for Compose-based development environments, automatically discovering Prometheus metrics and surfacing live charts and instrumentation issues without requiring Prometheus or Grafana.
The example project runs metriclens alongside two instrumented services generating live traffic:
git clone https://github.com/tyshkovskii/metriclens.git
cd metriclens/example/basic
docker compose up --buildOpen http://localhost:9999. You'll see both services discovered and scraped, with:
- Raw metrics — every metric with its help text, type, and labels, updated live.
- Panels — charts built automatically from metric types: rates for counters, current values for gauges, latency percentiles for histograms.
- Quality warnings — missing
HELPorTYPE, counters not named*_total, labels that look high-cardinality.
Published Docker images are available on Docker Hub.
Add one service to your existing docker-compose.yml:
services:
metriclens:
image: tyshkovskii/metriclens:latest
ports:
- "9999:9999"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:rometriclens finds the other services in your Compose project on its own, locates their metrics endpoints (it tries common ports and paths like /metrics), and starts scraping.
Pin a version from the Docker Hub tags page if you want repeatable environments.
Usually none is needed. If metriclens can't find a service's metrics endpoint, point it at the right port with a label:
services:
api:
labels:
metriclens.port: "8080"
metriclens.path: "/metrics"To hide a service from metriclens, label it metriclens.exclude: "true".
On the metriclens container itself you can tune two environment variables: metriclens_SCRAPE_INTERVAL (default 5s) and metriclens_RETENTION (default 15m, metrics are kept in memory only).
