Logs
Lambda logs are structured JSON and are exported to Grafana Loki through the OpenTelemetry collector layer.
Emitting
Use the shared logging package from libs/logging:
import { Logger, TraceUtils } from '../../../libs/logging'
const traceContext = TraceUtils.extractTraceContext(event, context)
const logger = new Logger(traceContext)
logger.info('leadsInboundHeyflowQueue.handle - Init', { requestId, origin })
logger.error('handle - BadRequest', new Error('BadRequest'), { requestId })TraceUtils.extractTraceContext attaches trace metadata so Loki logs can be correlated with Tempo spans by traceId and spanId.
Lambda log format
Default logging config is inherited from serverless.common.yml:
provider:
logs:
lambda:
logFormat: JSON
applicationLogLevel: INFO
systemLogLevel: INFO
logRetentionInDays: 30leads overrides retention to 90 days. The collector's telemetryapi receiver captures Lambda platform logs and function logs.
Loki queries
By service and environment:
{ service_name = "drive-api-leads", deployment_environment = "prod" } |= "BadRequest"By trace id:
{ trace_id = "<tempo-trace-id>" }The collector drops ADOT boot noise and Node DeprecationWarning entries through filter/logs in collector.yaml.