I am using Alloy to receive OTLP formatted log messages, works great! But I also want to be able to create labels from that data. For example the OTLP formatted logs have a property called resources.service.name (The JSON looks roughly like -
{
"body": "whatever",
"severity": "INFO",
"flags": 1,
"resources": {
"host.arch": "x86_64",
"service.name": "MyJavaApp",
},
"instrumentation_scope": {
"name": "com.example.Main"
}
}
I’m struggling with creating a loki.process component in my alloy config to create a label from it.
Anyone have any ideas on how one could do that?