Skip to main content

Self-hosted Loki

Loki is a log aggregation system inspired by Prometheus. Unlike other logging systems, Loki indexes metadata about the logs as a set of labels, but does not index the contents. Log data is compressed and stored in chunks in an object store. For development or proof of concept, log data can be storage on the filesystem.

A typical Loki-based logging stack consists of three parts. An Agent, like Promtail or Grafana Agent scrapes logs and pushes the streams to Loki, which stores the logs and processes queries that are displayed by Grafana.

This guide describes how to deploy Loki with Helm on CoreWeave cloud. In this example, the logs are stored in container storage. An object storage backend should be configured for production use, as described in the Loki documentation.

Install Loki

In a terminal, add the Grafana repository, then pull version 0.56.3 of the Loki Helm chart.

$ helm repo add grafana https://grafana.github.io/helm-charts
$ helm pull --version 0.56.3 --untar --untardir . grafana/loki-distributed

Change to loki-distributed, then download values-tenant.yaml from CoreWeave's documentation GitHub repository.

$ cd loki-distributed
$ curl https://raw.githubusercontent.com/coreweave/doc-examples/main/kubernetes/metrics/loki/values-tenant.yaml -o values-tenant.yaml

Deploy the Helm chart.

$ helm upgrade --install -f values-tenant.yaml loki .

See the Loki documentation for more information about how to configure Grafana to visualize Loki log data.