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.
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
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.
After that, restart Loki, and data will be written to Levitate.
Find more details on the remote write configurations here
Explore metric data using embedded Grafana by querying for the recording rule itself.