Lambda Promtail to Loki


I’m new to Loki and Promtail. I’m looking for a solution to expose Lambda logs and metrics in Grafana Loki, looking for the Promtail solution (Lambda Promtail client | Grafana Loki documentation).

Basically, it uploads a Lambda with a container image and processes the events sending it to the Loki endpoint.

I don’t know if it would be the best solution for this situation, if anyone in the community has any other solution it would be of great help.

Following the documentation described below, I created it using Terraform, after some tests I decided to remove the S3 Bucket, leaving only CloudWatch Logs > Subscription Filters > Lambda Promtail > Loki. Apparently it worked, I fed the logs from a specific CloudWatch group from a specific Lambda and it arrived at Loki.

In addition to the issue of architecture, if the community has any other way, another point that is the main focus of this topic would be in the following situation:

  • I send a single log event, but in Loki it received more than 100 repetitions as I will detail below:

A single shot (test) from Lambda generated almost 1000 events in Loki as shown in the image below, could you please help?

Made 1 request, providing the key and value.

However, on the Loki panel it shows almost 1000 requests.

Could anyone help us please? Tks