Skip to main content

Grafana Loki

Send data to Levitate using Grafana Loki’s recording rules’ remote write feature

Introduction

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

Prerequisites

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

Setup

Grafana Loki to Levitate

The setup is pretty straight forward. Grafana Loki has the required recording rules that are evaluated by the ruler component.

This ruler component has the ability to remote write the declared recording rules as metrics.

We need to configure the ruler component to remote write to Levitate. This can be done as follows.

Update the existing Loki configuration to include the remote write config under the ruler section.

ruler:
...
remote_write:
enabled: true
client:
url: "$levitate_remote_write_url"
basic_auth:
username: "$levitate_remote_write_username"
password: "$levitate_remote_write_password"

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

Find more details on the remote write configurations here

Next steps

Explore metric data using embedded Grafana by querying for the recording rule itself.

Troubleshooting

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