Observability

Logs

Log group Contents

/aws/lambda/actionstools-<env>-api

HTTP requests, view errors, Queued async task … (at DEBUG).

/aws/lambda/actionstools-<env>-worker

Async tasks, stream batches, the cleanup run (… counters removed).

API Gateway execution logs

Not enabled; turn on per stage when debugging routing.

Both Lambda log groups are resources of the stack (ApiLogGroup, WorkerLogGroup), wired to the functions through LoggingConfig. Retention is LogRetentionDays in the Env mapping: 90 days in prod, 14 on stage. Deleting the stack deletes them.

If /aws/lambda/actionstools-<env>-api or -worker already exists (a function was invoked before the log groups were part of the template), the deploy fails with already exists. Delete the group, or import it into the stack, and deploy again.

The root log level is LOG_LEVEL (ERROR in prod, WARNING on stage), set in lambda_handlers.py. Tail both functions at once:

sam logs --stack-name actionstools-prod --profile prod --tail
sam logs --stack-name actionstools-prod --profile prod -n WorkerFunction --filter ERROR -s '1h ago'

Errors

Sentry (Sentry) receives log records at WARNING+ that also pass LOG_LEVEL — so ERROR+ in production — from both functions, tagged with environment = production / staging. Async-task failures carry the message prefix Error when sending notifications in background; stream failures Error when calculating counters.

Metrics worth an alarm

Metric Function Meaning

Errors, Throttles

both

Unhandled exceptions / concurrency limits.

Duration (p99) close to 120 s

API

Slow downstream (internal API, event logger, messaging).

IteratorAge

Worker

The tasks stream is falling behind; counters are stale.

AsyncEventsDropped

Worker

Async tasks discarded after failure or age — notifications lost.

5XXError, Latency

ActionsToolsApi

What users see.