Task · GRE-0002

Recognise Powertools Logger output in a CloudWatch Lambda logs to Loki example

Description

Many customer Lambdas already log through the Powertools for AWS Lambda Logger, whose JSON output has fixed keys (level, service, cold_start, function_name, function_request_id, xray_trace_id, correlation_id). A CloudWatch Logs subscription to Loki example should detect that format and map it without a parse stage: service to a label (low cardinality), level to detected_level, and function_request_id, xray_trace_id, correlation_id and cold_start to structured metadata. That makes Powertools users’ logs queryable immediately and gives a trace-to-logs link on xray_trace_id. No CloudWatch-to-Loki example exists yet; this is a requirement on it, not a standalone example.

Acceptance Criteria

Definition of Done

View the source file on GitHub