Loki
Configuring the Loki backend (Self-Hosted)
Getting Started
These instructions are for the self hosted Loki instance. If you need a managed service, please follow the instructions on the Grafana Cloud Loki page.
This destination is for self hosted Loki instances.
Loki Labels
Loki labels are used to “index” logs and allow efficent filtering in the Grafana UI. You can read more about them here.
You can configure your grafana cloud loki labels in the Labels
multi-input config option in the destination page in the Odigos UI.
- Labels should be names of opentelemetry resource attribute or log record attribute keys that you want to index, for example:
"k8s.namespace.name"
. - To avoid performance issues, it is recommended to limit the number of labels to a reasonable amount.
- Use only low cardinality values. e.g. use only opentelemetry attributes for which you expect a small number of unique values like
http.response.status_code
but notnetwork.peer.address
. - If the label is not present in a log record, it will be ignored.
- The default labels if not set are:
k8s.container.name, k8s.pod.name, k8s.namespace.name
Configuring Destination Fields
- LOKI_URL
string
: Endpoint. If scheme is not provided, it defaults tohttp
. If port is not provided, it defaults to3100
. If path is not provided, it defaults to/loki/api/v1/push
.- This field is required
- Example:
http://<loki-host>:<loki-port>/loki/api/v1/push
- LOKI_LABELS
string[]
: Labels. use these OpenTelemetry resource attributes as loki labels for each log record- This field is required and defaults to
["k8s.container.name", "k8s.pod.name", "k8s.namespace.name"]
- This field is required and defaults to
Adding Destination to Odigos
There are two primary methods for configuring destinations in Odigos:
Using the UI
Use the Odigos CLI to access the UI
Click on Add Destination
, select Loki
and follow the on-screen instructions
Using Kubernetes manifests
Save the YAML below to a file (e.g. loki.yaml
)
Apply the YAML using kubectl