AWS CloudWatch logs
A CloudWatch subscription filter sends each new log event to a Firehose stream, and Firehose delivers it to Flowhawk's HTTP endpoint. Nothing runs in your account besides those two AWS services.
What you get
- AWS logs in Logs, next to your traces and metrics, searchable with the same query language (
severity>=WARN service=checkout "timeout"), grouped into patterns or followed live. - A log line that names a request path joins the business flow of that route, so a failing checkout shows its platform logs on the checkout flow's page.
- A line that carries a trace id opens its trace.
- Alert on any search with Alert on this, and let the agent read these logs when it investigates an incident.
Lambda's START, END and REPORT lines are dropped, so you see your function's own logs.
Set it up
First create an ingest key: in the app, open Settings > API keys and pick Services. In the examples below, KEY stands for that key. Keep it out of your repository, like any other secret.
- Create an Amazon Data Firehose stream with source Direct PUT and destination HTTP endpoint:
- HTTP endpoint URL:
https://api.flowhawk.dev/v1/logs/firehose - Access key: your ingest key
- Content encoding: GZIP
- Buffer size: 1 MiB
- HTTP endpoint URL:
- Create an IAM role that lets CloudWatch Logs write to the stream (
firehose:PutRecordandfirehose:PutRecordBatch), trusted bylogs.amazonaws.com. - Subscribe each log group to the stream:
aws logs put-subscription-filter --log-group-name /aws/lambda/checkout \ --filter-name flowhawk --filter-pattern "" \ --destination-arn arn:aws:firehose:REGION:ACCOUNT:deliverystream/flowhawk-logs \ --role-arn arn:aws:iam::ACCOUNT:role/CWLtoFirehose
The same steps, with your workspace's address filled in, are in the app under Settings > Integrations > Log drains.
What arrives
| CloudWatch | In Flowhawk |
|---|---|
| Log group | The service, from its last part: /aws/lambda/checkout is checkout. Add ?service=name to the endpoint URL to name it yourself |
| Log event | One line. JSON events (Lambda Powertools, pino, structlog) keep their level, trace id and fields |
| Lambda platform lines | Dropped |
Common questions
What does this cost on the AWS side?
Firehose charges per GB it delivers. A filter pattern on the subscription sends only the lines you want.
Can I send traces from Lambda?
Yes, with the OpenTelemetry Lambda layer for your language, exporting OTLP to https://ingest.flowhawk.dev with the header Authorization: Bearer KEY (Sending data).