API reference · v0.1.0
Metrics HTTP API
Prometheus-compatible query and ingestion API. Configure path_prefix to prepend a common prefix to data routes. Generated from the OpenAPI 3.1 document shipped with the server.
Base URLs
Writers serve every
/write route and readers serve every /read route. The operator creates a Service for each, named after the Metrics resource. Any writer accepts any write and forwards it to the owning shard, so plain round-robin load balancing is enough. Authentication
Requests use HTTP basic auth. Each NamespaceAuthentication grants one username
read or write on one namespace, with the password held in a Secret. Probes and self-metrics are unauthenticated.Namespaces
Data is partitioned into tenant namespaces, and every data route carries one as
/read/ns/{namespace} or /write/ns/{namespace}. A Prometheus data source pointed at http://metrics-reader.telemetry:8080/read/ns/default works unchanged.Errors and backpressure
Errors use the Prometheus error envelope with a 4xx or 5xx status. When object storage falls behind, writers reject new batches with
429 and a Retry-After header; configure your agent to retry them.Base URLs
- writer
- http://metrics-writer.telemetry:8080
- reader
- http://metrics-reader.telemetry:8080
Endpoints15
- GET
/read/ns/…/api/v1/query - POST
/read/ns/…/api/v1/query - GET
/read/ns/…/api/v1/query_range - POST
/read/ns/…/api/v1/query_range - GET
/read/ns/…/federate - GET
/read/ns/…/api/v1/label/{name}/values - GET
/read/ns/…/api/v1/labels - GET
/read/ns/…/api/v1/metadata - GET
/read/ns/…/api/v1/series - POST
/read/ns/…/api/v1/series - POST
/write/ns/…/api/v1/write - POST
/write/ns/…/v1/metrics - GET
/-/healthy - GET
/-/ready - GET
/metrics
Error · 400
{
"status": "error",
"errorType": "bad_data",
"error": "parse error: unexpected \"}\" in label matching"
}Resource
query
PromQL evaluation with standard Prometheus response envelopes.Instant query
GET
Evaluates a PromQL expression at a single timestamp, defaulting to now. Returns the standard Prometheus /read/ns/{namespace}/api/v1/query{status, data} envelope.Path parameters
- Configured tenant namespace
namespacestringrequired
Query parameters
- PromQL expression
querystringrequired - Evaluation timestamp: Unix seconds or RFC 3339
timestring
Responses
200Prometheus instant-query responseapplication/json›ApiEnvelope
dataobjectrequired- Prometheus response status (
statusstringrequiredsuccessorerror).
400Invalid queryapplication/json›ErrorEnvelope
errorstringrequirederror_typestring | nullstatusstringrequired
401Authentication required404Unknown namespace422Query failed during evaluationapplication/json›ErrorEnvelope
errorstringrequirederror_typestring | nullstatusstringrequired
Request
curl -G http://metrics-reader.telemetry:8080/read/ns/default/api/v1/query \
-u reader:$PASSWORD \
--data-urlencode 'query=sum by (job) (rate(http_requests_total{status=~"5.."}[5m]))'Response · 200
{
"status": "success",
"data": {
"resultType": "vector",
"result": [
{
"metric": {
"job": "api"
},
"value": [
1791464400,
"0.0213"
]
}
]
}
}Instant query (form)
POST
Evaluates a PromQL expression at a single timestamp, defaulting to now. Returns the standard Prometheus /read/ns/{namespace}/api/v1/query{status, data} envelope.Path parameters
- Configured tenant namespace
namespacestringrequired
Form fields
application/x-www-form-urlencoded- PromQL expression
querystringrequired - Evaluation timestamp: Unix seconds or RFC 3339
timestring
Responses
200Prometheus instant-query responseapplication/json›ApiEnvelope
dataobjectrequired- Prometheus response status (
statusstringrequiredsuccessorerror).
400Invalid queryapplication/json›ErrorEnvelope
errorstringrequirederror_typestring | nullstatusstringrequired
422Query failed during evaluationapplication/json›ErrorEnvelope
errorstringrequirederror_typestring | nullstatusstringrequired
Request
curl -X POST "http://metrics-reader.telemetry:8080/read/ns/default/api/v1/query" \
-u reader:$PASSWORD \
--data-urlencode 'query=sum by (job) (rate(http_requests_total{status=~"5.."}[5m]))'Response · 200
{
"status": "success",
"data": {
"resultType": "vector",
"result": [
{
"metric": {
"job": "api"
},
"value": [
1791464400,
"0.0213"
]
}
]
}
}Range query
GET
Evaluates a PromQL expression from /read/ns/{namespace}/api/v1/query_rangestart to end every step. Returns a Prometheus matrix.Path parameters
- Tenant namespace. A
namespacestringrequiredNamespaceAuthenticationfor this database must grant the caller access to it.
Query parameters
- PromQL expression
querystringrequired - Unix seconds or RFC 3339
startstringrequired - Unix seconds or RFC 3339
endstringrequired - Seconds or a Prometheus duration such as
stepstringrequired15s
Responses
200Prometheus range-query responseapplication/json›ApiEnvelope
dataobjectrequired- Prometheus response status (
statusstringrequiredsuccessorerror).
400Invalid queryapplication/json›ErrorEnvelope
errorstringrequirederror_typestring | nullstatusstringrequired
422Query failed during evaluationapplication/json›ErrorEnvelope
errorstringrequirederror_typestring | nullstatusstringrequired
Request
curl -G http://metrics-reader.telemetry:8080/read/ns/default/api/v1/query_range \
-u reader:$PASSWORD \
--data-urlencode 'query=sum by (job) (rate(http_requests_total{status=~"5.."}[5m]))' \
--data-urlencode 'start=2026-10-08T12:00:00Z' \
--data-urlencode 'end=2026-10-08T13:00:00Z' \
--data-urlencode 'step=30s'Response · 200
{
"status": "success",
"data": {
"resultType": "matrix",
"result": [
{
"metric": {
"job": "api"
},
"values": [
[
1791460800,
"0.0198"
],
[
1791460830,
"0.0213"
]
]
}
]
}
}Range query (form)
POST
Evaluates a PromQL expression from /read/ns/{namespace}/api/v1/query_rangestart to end every step. Returns a Prometheus matrix.Path parameters
- Tenant namespace. A
namespacestringrequiredNamespaceAuthenticationfor this database must grant the caller access to it.
Form fields
application/x-www-form-urlencoded- PromQL expression
querystringrequired - Unix seconds or RFC 3339
startstringrequired - Unix seconds or RFC 3339
endstringrequired - Seconds or a Prometheus duration such as
stepstringrequired15s
Responses
200Prometheus range-query responseapplication/json›ApiEnvelope
dataobjectrequired- Prometheus response status (
statusstringrequiredsuccessorerror).
400Invalid queryapplication/json›ErrorEnvelope
errorstringrequirederror_typestring | nullstatusstringrequired
422Query failed during evaluationapplication/json›ErrorEnvelope
errorstringrequirederror_typestring | nullstatusstringrequired
Request
curl -X POST "http://metrics-reader.telemetry:8080/read/ns/default/api/v1/query_range" \
-u reader:$PASSWORD \
--data-urlencode 'query=sum by (job) (rate(http_requests_total{status=~"5.."}[5m]))' \
--data-urlencode 'start=2026-10-08T12:00:00Z' \
--data-urlencode 'end=2026-10-08T13:00:00Z' \
--data-urlencode 'step=30s'Response · 200
{
"status": "success",
"data": {
"resultType": "matrix",
"result": [
{
"metric": {
"job": "api"
},
"values": [
[
1791460800,
"0.0198"
],
[
1791460830,
"0.0213"
]
]
}
]
}
}Federate
GET
Prometheus federation endpoint. Returns the latest sample of each matching series in text exposition format./read/ns/{namespace}/federatePath parameters
- Tenant namespace. A
namespacestringrequiredNamespaceAuthenticationfor this database must grant the caller access to it.
Query parameters
- Series selectors
match[]array of stringrequired
Responses
200Prometheus text expositiontext/plain
Request
curl -G http://metrics-reader.telemetry:8080/read/ns/default/federate \
-u reader:$PASSWORD \
--data-urlencode 'match[]=up{job="api"}'Response · 200
# TYPE up untyped
up{instance="10.0.4.12:9100",job="api"} 1 1791464400000Resource
metadata
Series, label, and metadata discovery.List label values
GET
Returns the values of one label. Use /read/ns/{namespace}/api/v1/label/{name}/values__name__ to list metric names.Path parameters
- Tenant namespace. A
namespacestringrequiredNamespaceAuthenticationfor this database must grant the caller access to it. - Label name
namestringrequired
Query parameters
- Series selector. Repeat to match the union of several selectors.
match[]array of string - Start of the range, inclusive. RFC 3339 timestamp or Unix seconds, optionally fractional.
startstring - End of the range, inclusive. RFC 3339 timestamp or Unix seconds, optionally fractional.
endstring
Responses
200Label valuesapplication/json›ApiEnvelope
dataobjectrequired- Prometheus response status (
statusstringrequiredsuccessorerror).
Request
curl -G http://metrics-reader.telemetry:8080/read/ns/default/api/v1/label/job/values \
-u reader:$PASSWORD \
--data-urlencode 'start=2026-10-08T12:00:00Z' \
--data-urlencode 'end=2026-10-08T13:00:00Z'Response · 200
{
"status": "success",
"data": [
"api",
"gateway",
"node-exporter"
]
}List label names
GET
Returns label names, optionally restricted to series matching /read/ns/{namespace}/api/v1/labelsmatch[] within a time range.Path parameters
- Tenant namespace. A
namespacestringrequiredNamespaceAuthenticationfor this database must grant the caller access to it.
Query parameters
- Series selector. Repeat to match the union of several selectors.
match[]array of string - Start of the range, inclusive. RFC 3339 timestamp or Unix seconds, optionally fractional.
startstring - End of the range, inclusive. RFC 3339 timestamp or Unix seconds, optionally fractional.
endstring
Responses
200Label namesapplication/json›ApiEnvelope
dataobjectrequired- Prometheus response status (
statusstringrequiredsuccessorerror).
Request
curl -G http://metrics-reader.telemetry:8080/read/ns/default/api/v1/labels \
-u reader:$PASSWORD \
--data-urlencode 'start=2026-10-08T12:00:00Z' \
--data-urlencode 'end=2026-10-08T13:00:00Z'Response · 200
{
"status": "success",
"data": [
"__name__",
"instance",
"job",
"status"
]
}Metric metadata
GET
Returns type, help, and unit metadata recorded from remote write and OTLP ingest./read/ns/{namespace}/api/v1/metadataPath parameters
- Tenant namespace. A
namespacestringrequiredNamespaceAuthenticationfor this database must grant the caller access to it.
Query parameters
- Restrict metadata to one metric name.
metricstring - Maximum number of results to return.
limitintegerMinimum 0
Responses
200Metric metadataapplication/json›ApiEnvelope
dataobjectrequired- Prometheus response status (
statusstringrequiredsuccessorerror).
Request
curl -G http://metrics-reader.telemetry:8080/read/ns/default/api/v1/metadata \
-u reader:$PASSWORD \
--data-urlencode 'limit=10'Response · 200
{
"status": "success",
"data": {
"http_requests_total": [
{
"type": "counter",
"help": "Total HTTP requests.",
"unit": ""
}
]
}
}Find series
GET
Returns the label sets of series matching at least one /read/ns/{namespace}/api/v1/seriesmatch[] selector.Path parameters
- Tenant namespace. A
namespacestringrequiredNamespaceAuthenticationfor this database must grant the caller access to it.
Query parameters
- Series selectors
match[]array of stringrequired - Start of the range, inclusive. RFC 3339 timestamp or Unix seconds, optionally fractional.
startstring - End of the range, inclusive. RFC 3339 timestamp or Unix seconds, optionally fractional.
endstring
Responses
200Matching seriesapplication/json›ApiEnvelope
dataobjectrequired- Prometheus response status (
statusstringrequiredsuccessorerror).
Request
curl -G http://metrics-reader.telemetry:8080/read/ns/default/api/v1/series \
-u reader:$PASSWORD \
--data-urlencode 'match[]=up{job="api"}' \
--data-urlencode 'start=2026-10-08T12:00:00Z' \
--data-urlencode 'end=2026-10-08T13:00:00Z'Response · 200
{
"status": "success",
"data": [
{
"__name__": "up",
"job": "api",
"instance": "10.0.4.12:9100"
}
]
}Find series (form)
POST
Returns the label sets of series matching at least one /read/ns/{namespace}/api/v1/seriesmatch[] selector.Path parameters
- Tenant namespace. A
namespacestringrequiredNamespaceAuthenticationfor this database must grant the caller access to it.
Form fields
application/x-www-form-urlencoded- Series selectors
match[]array of stringrequired - Start of the range, inclusive. RFC 3339 timestamp or Unix seconds, optionally fractional.
startstring - End of the range, inclusive. RFC 3339 timestamp or Unix seconds, optionally fractional.
endstring
Responses
200Matching seriesapplication/json›ApiEnvelope
dataobjectrequired- Prometheus response status (
statusstringrequiredsuccessorerror).
Request
curl -X POST "http://metrics-reader.telemetry:8080/read/ns/default/api/v1/series" \
-u reader:$PASSWORD \
--data-urlencode 'match[]=up{job="api"}' \
--data-urlencode 'start=2026-10-08T12:00:00Z' \
--data-urlencode 'end=2026-10-08T13:00:00Z'Response · 200
{
"status": "success",
"data": [
{
"__name__": "up",
"job": "api",
"instance": "10.0.4.12:9100"
}
]
}Resource
ingest
Remote write and OTLP. Samples are routed per routing epoch to their storage shard.Remote write
POST
Prometheus remote write 1.0 and 2.0 (Snappy-compressed protobuf), including native histograms. With stock Prometheus, set /write/ns/{namespace}/api/v1/writequeue_config.retry_on_http_429: true so backpressure is retried.Path parameters
- Tenant namespace. A
namespacestringrequiredNamespaceAuthenticationfor this database must grant the caller access to it.
Request body
application/x-protobufprometheus.WriteRequest (1.0, default) or io.prometheus.write.v2.Request when the content type carries proto=io.prometheus.write.v2.Request. Both carry native histograms.Raw payload in the content type sent. See the request example.
Responses
204Write accepted; 2.0 requests also receive X-Prometheus-Remote-Write-{Samples,Histograms,Exemplars}-Written headers400Invalid remote-write requestapplication/json›ErrorEnvelope
errorstringrequirederror_typestring | nullstatusstringrequired
415Unsupported remote-write protobuf messageapplication/json›ErrorEnvelope
errorstringrequirederror_typestring | nullstatusstringrequired
Request
curl -X POST "http://metrics-writer.telemetry:8080/write/ns/default/api/v1/write" \
-u writer:$PASSWORD \
-H 'Content-Type: application/x-protobuf' \
-H 'Content-Encoding: snappy' \
--data-binary @payload.pbOTLP metrics
POST
OTLP/HTTP /write/ns/{namespace}/v1/metricsExportMetricsServiceRequest as protobuf or JSON, optionally gzip-encoded. Exponential histograms are stored as native histograms.Path parameters
- Tenant namespace. A
namespacestringrequiredNamespaceAuthenticationfor this database must grant the caller access to it.
Request body
application/jsonapplication/x-protobufContent-Encoding: gzip.Responses
200OTLP metrics accepted400Invalid OTLP requestapplication/json›ErrorEnvelope
errorstringrequirederror_typestring | nullstatusstringrequired
Request
curl -X POST "http://metrics-writer.telemetry:8080/write/ns/default/v1/metrics" \
-u writer:$PASSWORD \
-H 'Content-Type: application/json' \
--data-binary @- <<'EOF'
{
"resourceMetrics": [
{
"resource": {
"attributes": [
{
"key": "service.name",
"value": {
"stringValue": "api"
}
}
]
},
"scopeMetrics": [
{
"metrics": [
{
"name": "http_requests_total",
"sum": {
"isMonotonic": true,
"aggregationTemporality": 2,
"dataPoints": [
{
"asInt": "1027",
"timeUnixNano": "1791464400000000000"
}
]
}
}
]
}
]
}
]
}
EOFResource
operations
Probes and self-monitoring.Liveness
GET
Returns /-/healthy200 while the process is running. Use it as the Kubernetes liveness probe; it is unprefixed and not namespace-scoped.Responses
200Process is healthy
Request
curl http://metrics-reader.telemetry:8080/-/healthyReadiness
GET
Returns /-/ready200 once every storage shard assigned to this pod is open, and 503 while shards are still being acquired or handed off. Use it as the readiness probe.Responses
200Server is ready503Assigned shards are not ready
Request
curl http://metrics-reader.telemetry:8080/-/readySelf metrics
GET
Prometheus exposition of the server's own metrics: ingest, query, SlateDB, cache, and shard ownership./metricsResponses
200Server metricstext/plain
Request
curl http://metrics-reader.telemetry:8080/metricsResponse · 200
# HELP telemetry_ingest_samples_total Samples accepted.
# TYPE telemetry_ingest_samples_total counter
telemetry_ingest_samples_total 1.0274e+07