Section 3 · Cloud logs

Collect specific AWS log types using the Lambda agent.

Estimated time: 1 min

AWS logs: Lambda

AWS logs Lambda architecture: Specific log types trigger Lambda to forward to Grafana Cloud Logs

Complexity: Simple | Infrastructure: Serverless | Latency: Event-driven

This is the Logs with Lambda method, which deploys the Lambda Promtail function. The docs recommend it for ALB, CloudFront, and CloudTrail logs stored in S3. You deploy a Lambda function that triggers on events. When the logs are available, Lambda adds labels and forwards them to Grafana Cloud Logs.

Log types collected with Lambda

Log typeKey insights
ALB access logsRequest latency, targets, status codes
CloudFront logsEdge locations, cache hits
CloudTrailAPI activity, audit
CloudWatch LogsApplication events
VPC Flow LogsNetwork traffic
Kinesis Data StreamsStreamed log records

Considerations

  • Event-driven and automatic
  • Serverless, with no infrastructure to manage
  • Labels and relabeling configured through environment variables
  • Cost that scales with log volume

Documentation

View the AWS Lambda logs documentation.