docs/sources/get-started/_index.md
{{< youtube id="1uk8LtQqsZQ" >}}
Loki is a horizontally scalable, highly available, multi-tenant log aggregation system inspired by Prometheus. It's designed to be very cost-effective and easy to operate. It doesn't index the contents of the logs, but rather a set of labels for each log stream. Note that the entire content of the log line is searchable, using labels just makes searching more efficient by narrowing the number of logs retrieved during querying.
Because all Loki implementations are unique, the installation process is different for every customer. But there are some steps in the process that are common to every installation.
To collect logs and view your log data generally involves the following steps:
Next steps: Learn more about the Loki query language, LogQL.
To deploy Grafana Alloy to collect Pod logs from your Kubernetes cluster and ship them to Loki, you can use a Helm chart, and a values.yaml file.
This sample values.yaml file is configured to:
container and pod labels to the logs.local.Install Loki with the Helm chart.
Deploy Grafana Alloy using the Helm chart. Refer to Install Grafana Alloy on Kubernetes for more information.
Create a values.yaml file, based on the following example, making sure to update the value for forward_to = [loki.write.endpoint.receiver]:
alloy:
mounts:
varlog: true
configMap:
content: |
logging {
level = "info"
format = "logfmt"
}
discovery.kubernetes "pods" {
role = "pod"
}
loki.source.kubernetes "pods" {
targets = discovery.kubernetes.pods.targets
forward_to = [loki.write.endpoint.receiver]
}
loki.write "endpoint" {
endpoint {
url = "http://loki-gateway.default.svc.cluster.local:80/loki/api/v1/push"
tenant_id = "local"
}
}
Then install Alloy in your Kubernetes cluster using:
helm install alloy grafana/alloy -f ./values.yaml