最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

spring boot - how to add custom label to loki log - Stack Overflow

programmeradmin7浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论