Skip to main content

Grafana Loki

Send data to Last9 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. Last9's remote-write endpoint.

Prerequisites

Create a Last9 cluster by following Getting Started.

Keep the following information handy after creating the cluster:

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

Setup

Grafana Loki to Last9

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 Last9. 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 Last9.

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.