Prometheus
Store and query Prometheus metrics with RawTree's native Prometheus endpoints.
Prometheus
RawTree implements Prometheus remote write for ingestion and a Prometheus-compatible HTTP API for queries. Authenticate both with a cluster API key.
Before using these endpoints, open the cluster in the RawTree platform, select Apps, and install Prometheus. Installation enables the endpoints for that cluster. It does not start or resume the cluster, so the cluster must also be available before ingestion or queries can succeed.
Remote write
Configure Prometheus to send samples to RawTree:
remote_write:
- url: https://api.rawtree.com/prometheus/api/v1/write
authorization:
credentials_file: /etc/prometheus/secrets/rawtree-api-keyStore only the API key in /etc/prometheus/secrets/rawtree-api-key, and restrict the file so only the Prometheus process can read it.
The API key's default database is used unless you add ?database=<name> to the URL. RawTree stores Prometheus data in managed prometheus_samples, prometheus_series, and prometheus_metric_metadata tables.
Query API
Use this base URL for a Prometheus-compatible data source:
https://api.rawtree.com/prometheusSend the cluster API key as a bearer token. The supported endpoints are:
| Endpoint | Purpose |
|---|---|
POST /api/v1/write | Prometheus remote write |
GET, POST /api/v1/query | Instant query |
GET, POST /api/v1/query_range | Range query |
GET, POST /api/v1/labels | Label names |
GET, POST /api/v1/label/{label_name}/values | Label values |
GET, POST /api/v1/series | Series metadata |
GET /api/v1/metadata | Metric metadata |
GET /api/v1/status/buildinfo | Compatibility information |
For a non-default database, add database=<name> to the request query string or send x-rawtree-database: <name>.
Verify the connection
After Prometheus has written samples, run an instant query:
curl --get "https://api.rawtree.com/prometheus/api/v1/query" \
-H "Authorization: Bearer $(cat /etc/prometheus/secrets/rawtree-api-key)" \
--data-urlencode 'query=up'A successful response uses the standard Prometheus envelope with "status":"success".