Prerequisite: a metrics API key from Grounds. Ask your Grounds contact for one and say which metrics you need. Keys are issued and scoped by Grounds; there is no self-service.
Endpoint
/v1/metrics/ with a trailing slash is a different route and returns 404.
Authentication
Send your key as a bearer token on every request.string
required
Bearer <your-key>. Keys start with gmk_.Request
The endpoint takes no query parameters and no body. Parameters such as?query= or ?match[]= are ignored: the metrics you receive are fixed by your key.
Response
A successful response is200 OK with Content-Type: text/plain; version=0.0.4; charset=utf-8: the Prometheus text exposition format, the same format a /metrics endpoint or Prometheus federation returns.
- Values are evaluated when you request them. Each value is the latest sample Grounds holds for that series.
- Series without recent data are left out. A series whose newest sample is older than five minutes is not in the response. Treat a missing series as “no data”, not as
0. - Every metric is
untyped. The response has no# HELPlines and no timestamps, so your scraper stamps each sample with its own scrape time. - Responses are never cached. Every response carries
Cache-Control: no-store.
Rate limit
Each key may make 30 requests per minute, counted in fixed one-minute windows. A request over the limit returns429 with a Retry-After header in seconds.
A scrape interval of 15 seconds uses 4 requests per minute. Grounds metrics change slowly, so 30 or 60 seconds is usually enough.
Errors
Error bodies are short plain-text messages, such as
unauthorized, and are not meant to be parsed.
Scrape with Prometheus
- Save your key in
/etc/prometheus/grounds-metrics-key, readable only by the user Prometheus runs as. Prometheus trims surrounding whitespace, so a trailing newline is fine. - Add a scrape job that reads the key from that file:
prometheus.yml
honor_labels: true keeps the labels Grounds sends as they are, as for any federated source.
To confirm it works, open Status → Targets in Prometheus. The grounds target should be UP. If a scrape fails, Prometheus shows the HTTP status there; look it up in Errors.