Sazabi
Log sourcesSend to an endpoint

Prometheus

Run an OpenTelemetry Collector with a prometheus receiver and otlphttp exporter to forward Prometheus metrics to Sazabi as searchable log records.

About

Forward Prometheus metrics into Sazabi as searchable log records. Because Prometheus does not speak OTLP natively, the OpenTelemetry Collector acts as an intermediary: it scrapes your Prometheus server using the prometheus receiver and forwards the scraped data to Sazabi over OTLP/HTTP.

Each scraped data point becomes a log record with structured fields including the metric name, type, and value. Labels are preserved as record attributes. Histograms and summaries include count, sum, min, and max.

Prerequisites

  • OpenTelemetry Collector Contrib distribution. The standard Core distribution does not include the prometheus receiver.
  • A running Prometheus server (default: localhost:9090).
  • Your Sazabi intake URL, shown above — open the log source and copy the Intake URL from its setup screen (the public key is embedded in the URL).

Set up in the dashboard

Configure the Collector

Create or update your Collector configuration to add the prometheus receiver and the otlphttp/sazabi exporter:

otelcol-contrib.yaml
receivers:
  prometheus:
    config:
      scrape_configs:
        - job_name: sazabi
          scrape_interval: 30s
          static_configs:
            - targets: ["localhost:9090"]

exporters:
  otlphttp/sazabi:
    metrics_endpoint: https://<your intake host>/v1/metrics
    headers:
      Authorization: "Bearer <SAZABI_PUBLIC_KEY>"

service:
  pipelines:
    metrics:
      receivers: [prometheus]
      exporters: [otlphttp/sazabi]

Replace <your intake host> with the hostname from your intake URL shown above (the metrics_endpoint key takes the full metrics URL, including the /v1/metrics path). This Collector config also sets a Bearer header; supply your project public key from Settings > Public keys for <SAZABI_PUBLIC_KEY> — this matches the in-product setup snippet. The key is also embedded in your intake URL hostname, so the header is redundant when you use the full keyed URL, but harmless.

Update targets to point at your actual Prometheus server if it is not running on localhost:9090. Adjust scrape_interval to match your Prometheus scrape configuration.

Restart or redeploy the Collector

After saving the configuration, restart the Collector process or roll the deployment so it picks up the new pipeline.

Set up with the CLI

You can also register the Prometheus log source with the Sazabi CLI (installed and authenticated — see CLI reference).

Registering the source mints the same intake URL the dashboard shows above (the public key is embedded in its hostname):

sazabi log-sources create prometheus --mode connectionless

The command prints the intake URL for the new source — copy the whole URL and point your sender at it using the configuration shown above. Run sazabi log-sources get <log-source-id> at any time to reprint the endpoint, or sazabi log-sources list to see every log source in the project.

Verify

After the Collector restarts, wait for at least one scrape cycle (30 seconds with the default interval above). Open the Intake page in the Sazabi dashboard and confirm records from the Prometheus source appear. Start a thread and search for one of your metrics by name to confirm individual data points are queryable.

Troubleshooting

No records after restarting — Check Collector logs for TLS, DNS, or authentication errors on otlphttp/sazabi. Confirm the Authorization: Bearer header uses your project public key (from Settings > Public keys), not a Sazabi secret key.

Scrape errors — If the Collector cannot reach the Prometheus server, check that targets points to the correct host and port and that no firewall blocks the connection.

Metrics rejected or missing — Confirm the metrics_endpoint key uses the full metrics URL ending in /v1/metrics, as shown above.

Collector Core vs Contrib — The prometheus receiver is only available in the Contrib distribution. If you see unknown receiver type: prometheus, switch to the Contrib binary or Docker image.

Further reading