I'm working on SpringBoot + Kotlin and I want to add the label I want when I send logs to Loki through the OpenTelemetry Collector and set the value. Please refer to this repository because there are settings where I connect spring boot, hotel collector, and loki.
I want to make sure that the produce
function receives jobId
as a parameter, and the value received as a parameter is added to the jobId
under the attribute
field of the loki log in the image below.
In this way, my purpose is to quickly scratch the log of the produce
function executed with a specific jobId
.
Loki Log Image
I wish I could set the field directly with setAttribute
through this.logger.info
or add labels inside the function without any special settings through reflections or something like that...
I'd really appreciate it if you could tell me how to achieve what I want. Thank you.