Hello everyone,
I’m trying to add some custom labels (hostname and application component) to Loki, which is configured as a Datasource in Grafana.
The data flux is like this:
Open Telemetry Agent on host (ex host 221) has receiver logs, exporter another Open Telemetry Collector (For simplicity, let’s call it Otel DC), this one has as receiver the Open Telemetry agent (localhost:port) and as exporter another Open Telemetry Collector (which is Otel Main). This main collector finally has as reciver multiple Otel Collectors and as exporter Loki.
So it’s like this:
Otel Agent → Otel DC → Otel Main → Loki
In Otel agent i added some informations that helps us identify the host, which are added using the following processor:
Configure your Loki and define, which resource attributes will be indexed as a Loki labels with default_resource_attributes_as_index_labels config option:
At the “base” level, like read/write/backend and, after restarting it, there was no changes sadly, tried inside the loki block as well, no changes again.
P.s. i can share the yaml if needed, and right now we’re using the deploymentMode as SimpleScalable
Hello again!
Just to correct my last post, it was my fault that there was wrong indentation on the yaml.
It works if it’s inserted into the loki block, like this: