Prometheus · API Governance Rules
Prometheus API Rules
Spectral linting rules defining API design standards and conventions for Prometheus.
10 Rules
error 5
warn 5
Rule Categories
prometheus
Rules
error
prometheus-base-path-v1
Operational endpoints MUST be served under the /api/v1 base path.
$.paths[*]~
warn
prometheus-operation-id-kebab-case
operationId MUST be kebab-case (e.g. query-range, get-status-config).
$.paths.*.*.operationId
error
prometheus-summary-required
Every operation MUST carry a summary.
$.paths.*.*
warn
prometheus-summary-sentence-case
Operation summary should start with a capitalised verb (sentence case), not Title Case.
$.paths.*.*.summary
error
prometheus-tags-required
Every operation MUST be tagged. Prometheus groups operations by tag (query, metadata, targets, rules, status, admin, remote, otlp, notifications, features).
$.paths.*.*
warn
prometheus-tag-vocabulary
Operation tags should come from the Prometheus tag vocabulary.
$.paths.*.*.tags[*]
error
prometheus-200-required
Every operation MUST document a 200 response.
$.paths.*.*.responses
error
prometheus-json-only
Prometheus only emits application/json. Responses MUST advertise the JSON media type.
$.paths.*.*.responses.200.content
warn
prometheus-time-params-numeric-or-rfc3339
time / start / end parameters accept either Unix seconds (number) or RFC3339 (string), so they MUST be typed string (Prometheus serialises both as strings on the query string).
$.paths.*.*.parameters[?(@.name == 'time' || @.name == 'start' || @.name == 'end')].schema.type
warn
prometheus-match-array-param
match[] selector parameters MUST accept multiple values (style: form, explode: true).
$.paths.*.*.parameters[?(@.name == 'match[]')]