Skip to content

Prometheus remote-write

This guide configures metrics. Replace YOUR_INGEST_KEY with your key on your server, never in a public example.

Merge into your configuration and preserve existing scrape jobs. job becomes the service fallback. The endpoint accepts remote-write 1.x and 2.0 Snappy protobuf; change protobuf_message to io.prometheus.write.v2.Request only on a compatible Prometheus version. Do not send text exposition to this route.

global:
external_labels:
env: "production"
scrape_configs:
- job_name: "my-service"
static_configs:
- targets: ["127.0.0.1:9090"]
remote_write:
- url: https://otlp.siteqwality.com/api/v1/write
protobuf_message: prometheus.WriteRequest
authorization:
credentials: "YOUR_INGEST_KEY"
send_exemplars: true
queue_config:
max_samples_per_send: 1000
retry_on_http_429: true

Keep credentials in a protected credentials_file in production. Enable retries for 429 responses, monitor queue age and keep label cardinality bounded.

Terminal window
promtool check config prometheus.yml
# Reload using your deployment process, then check remote-write pending and failed samples.

Open Logs, Traces or Metrics. New data usually shows up within a minute, and a page that says it is waiting for data switches to your data on its own. Nothing arriving? See what each status code means in failure handling.

Store the key in your platform secret mechanism, rotate it when exposed and remove test keys. Set a stable service.name and deployment.environment.name; avoid user IDs or unbounded values in metric labels. Prefer a persistent queue, bounded retries and exporter failure monitoring. Review redaction and processors before increasing traffic.