-
Notifications
You must be signed in to change notification settings - Fork 1
how to monitor metrics
Bryan edited this page Jun 13, 2026
·
1 revision
The daemon can expose local request counters at /metrics. This endpoint is gated by the LODE_FEATURE_METRICS feature flag in src/lode/features.py.
Metrics in src/lode/observability.py counts requests by HTTP method, path, and status. The metric name is loded_requests_total.
Example output:
# HELP loded_requests_total Total local daemon HTTP requests.
# TYPE loded_requests_total counter
loded_requests_total{method="GET",path="/health",status="200"} 1
LODE_FEATURE_METRICS=1 uv run loded --host 127.0.0.1 --port 7979
curl http://127.0.0.1:7979/metricsAdd counters to Metrics in src/lode/observability.py, record them from src/lode/daemon.py, and update tests in tests/test_observability.py. Keep labels low-cardinality because the endpoint is meant for local diagnostics.
| File | Purpose |
|---|---|
src/lode/observability.py |
Metrics storage and rendering. |
src/lode/features.py |
Feature flag gate. |
src/lode/daemon.py |
/metrics endpoint and request recording. |
tests/test_observability.py |
Metrics tests. |