Loki
This destination is for self hosted loki instances.
If you use grafana cloud managed loki, follow the instructions in the Grafana Cloud Loki page.
Configuring the Loki Destination
In order to add a new loki destination, insert the loki backend URL into Odigos UI.
Connection Settings
To send logs to Loki, you need to configure the Loki URL in the Odigos UI. This destination is for self hosted Loki instances, so you will need to have a Loki instance running and accessible from the k8s cluster running odigos.
The URL should be in the format http://<loki-host>:<loki-port>/loki/api/v1/push
.
- If scheme is not provided, it defaults to
http
. - If port is not provided, it defaults to
3100
. - If path is not provided, it defaults to
/loki/api/v1/push
.
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
Adding a Destination to Odigos
Odigos makes it simple to add and configure destinations, allowing you to select the specific signals [traces/logs/metrics] that you want to send to each destination. There are two primary methods for configuring destinations in Odigos:
- Using the UI
To add a destination via the UI, follow these steps:- Use the Odigos CLI to access the UI: Odigos UI
odigos ui
-
In the left sidebar, navigate to the
Destination
page. -
Click
Add New Destination
-
Select
Loki
and follow the on-screen instructions.
- Using kubernetes manifests
Save the YAML below to a file (e.g., destination.yaml
) and apply it using kubectl
:
kubectl apply -f destination.yaml
apiVersion: odigos.io/v1alpha1
kind: Destination
metadata:
name: loki-example
namespace: odigos-system
spec:
data:
LOKI_LABELS: <Labels>
LOKI_URL: <Endpoint>
destinationName: loki
signals:
- LOGS
type: loki