Prometheus remote-write
This guide configures metrics. Replace YOUR_INGEST_KEY with your key on your server, never in a public example.
1. Add remote_write to prometheus.yml
Section titled “1. Add remote_write to prometheus.yml”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: true2. Validate and reload
Section titled “2. Validate and reload”Keep credentials in a protected credentials_file in production. Enable retries for 429 responses, monitor queue age and keep label cardinality bounded.
promtool check config prometheus.yml# Reload using your deployment process, then check remote-write pending and failed samples.See your data
Section titled “See your data”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.
Production checklist
Section titled “Production checklist”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.