Hello, guys! I searched the entire Internet to find the answer to the following question:
How to include full log error message in alert notification using Loki as Datasource.
For example, I have the following query:
count_over_time({app=“some-application”} |= ERROR
[1s])
And I want if the last value of this request is more than zero, send a notification including the FULL log on which the alert was triggered(example: ; ERROR 1 — [ctor-http-nio-2] c.c.m.d.e.a.s.MarketDataEventSender : Error market data event sender [error occurred in message handler [org.springframework.integration.amqp.outbound.AmqpOutboundEndpoint@361a6caf] )
And unfortunately, I didn’t find anything about this. Please, help me. Where I can find a step-by-step guide or some documentation about this, or you can write now how to do it.
I would be very grateful for a detailed answer. Thank you in advance!
I don’t think this is supported, but there is a workaround. When creating a rule you can supply labels in annotations, and you can manipulate LogQL to put the entire log line into a label. See Add log message in alert · Issue #5844 · grafana/loki · GitHub for an example.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.