How to dynamically set service_name for Loki #35883
Replies: 1 comment
-
Hey! The The config for processors part will look like:
Additionally, you use otlphttp exporter to send data to Loki. Loki hints ( |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I'm using the below configuration file for OpenTelemetry
Everything works fine, service_name is set as
log-generator
, but when I changevalue
tofrom_attribute: record.extra.service
, then Loki doesn't get expected service name (it becomes unknown_service).My log statement looks like this:
Everything works fine with the
service.name
set aslog-generator
. However, when I attempt to change the value tofrom_attribute: record.extra.service
, Loki no longer receives the expected service name (it gets set tounknown_service
).Additionally, this nested
from_attribute
doesn't seem to work for other processors either. For example, if I setfrom_attribute: record
, the entire record is sent to Loki, butfrom_attribute: record.extra.service
is ignored.Does the OpenTelemetry Collector support handling nested JSON in the
from_attribute
directive?Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions