🔥Prometheus to Levitate

Send data to Levitate using Prometheus Remote Write

We make use of the Prometheus remote-write feature to allow Prometheus to write to an external remote endpoint i.e. Levitate's remote-write endpoint.


Create a Levitate cluster by following Getting Started.

Keep the following information handy after creating the cluster:

  • $levitate_remote_write_url - Levitate's Remote write endpoint
  • $levitate_remote_write_username - Cluster ID
  • $levitate_remote_write_password - Write token created for the cluster

Writing data to Levitate

The information flow is as follows:

Remote Write Metrics to Levitate

Remote Write data to Levitate in addition to writing to your Prometheus

Just update the Prometheus configuration with the following changes for theremote_write:

  - url: "$remote_write_url"
      username: "$remote_write_username"
      password: "$remote_write_password"
    remote_timeout: 60s

After that, restart Prometheus, and data will be written to Levitate.

Using Prometheus Agent mode

With Levitate as Long term storage, you don't really need to store time series in your Prometheus. You can run Prometheus only in agent mode and stream data directly to Levitate.

The agent mode is limited to discovery, scrape and remote write which fits our needs nicely.

Remote Write to Levitate using Prometheus Agent

Remote Write to Levitate using Prometheus Agent

You don't need to have the overhead of running full-fledged Prometheus anymore.

Here is a sample docker-compose.yaml that runs Prometheus in agent mode.

    container_name: prometheus-01
    image: prom/prometheus:v2.39.1
      - 9091:9090/tcp
      - ./prometheus.yaml:/etc/prometheus/prometheus.yaml
      - '--config.file=/etc/prometheus/prometheus.yaml'
      - '--enable-feature=agent'
    network_mode: host
    restart: always

The prometheus.yaml will need to have remote_writesection as follows:

  scrape_interval: 1m
  scrape_timeout: 30s

  - job_name: prometheus-self
    - targets: [""]

  - url: "$remote_write_url"
      username: "$remote_write_username"
      password: "$remote_write_password"
    remote_timeout: 60s


The Levitate Cluster will start showing a summary of ingested samples.

Levitate Cluster's Performance metrics

Levitate Cluster's Performance metrics

Next steps

Create a read token for your Levitate Cluster and follow our guide to Configure Grafana to visualize the time series data getting sent to Levitate.

Scaling Prometheus Remote Write

Read https://last9.io/blog/how-to-scale-prometheus-remote-write/ where we talk about how to scale Prometheus Remote write for Federated clusters considering High Availability requirements.


Please get in touch with us on Discord or Email if you have any questions.

What’s Next