- Create a log source
- Set up an S3 bucket for failed deliveries
- Set up an IAM role for Data Firehose
- Create a Firehose delivery stream
- Set up an IAM role for CloudWatch
- Create a CloudWatch log subscription
- Your log source’s API key. If you do not have a log source yet, create a new log source first.
- AWS account ID
- AWS region
- S3 bucket name for failed delivery storage
- Data Firehose stream name
- IAM role name for the S3 bucket
- IAM role name for the CloudWatch subscription
Create a log source
Create a log source before proceeding. See Logging configuration for instructions.Set up an S3 bucket for failed deliveries
Amazon Data Firehose requires an S3 bucket to store records that fail to deliver. Create an S3 bucket through the AWS Console or CLI before proceeding, you can’t create a Firehose delivery stream without one.Set up an IAM role for Data Firehose
Create an IAM role that allows Data Firehose to write to the S3 bucket and, optionally, to CloudWatch Logs for delivery error logging. Use the following trust policy:See Adding IAM identity
permissions
for instructions on creating inline policies for IAM roles.
<AWS_ACCOUNT_ID>— your AWS account ID.<AWS_REGION>— the region your Firehose stream will run in.<FIREHOSE_S3_BUCKET>— the S3 bucket you created in the previous step.<FIREHOSE_LOG_GROUP>— the log group Firehose uses for its own delivery error logs (separate from the log group you want to stream to AppSignal). AWS uses the convention/aws/kinesisfirehose/<FIREHOSE_STREAM_NAME>, so decide your Firehose stream name now — you’ll reuse it in the next step. If you don’t plan to enable error logging on the Firehose stream, you can omit thelogs:PutLogEventsstatement entirely.
See Controlling access with Amazon Data
Firehose
for more on the permissions Data Firehose requires.
Create a Firehose delivery stream
- Open the Amazon Data Firehose console and select Create Firehose stream.
- Select Direct PUT as the source.
- Select HTTP Endpoint as the destination.
- Under “Transform records”, leave data transformation turned off.
- Enter the following URL as the HTTP endpoint URL:
- Enter your AppSignal log source API key from creating a log source as the Access key. This is an AppSignal key, not an AWS access key.
- Under “Content encoding”, enable GZIP.
- Under “Backup settings”, select the S3 bucket you created in the previous step.
- Under “Advanced settings > Service access”, select Choose existing IAM role and choose the IAM role you created in the previous step.
- (Optional) Under “Advanced settings > Amazon CloudWatch error logging”, enable error logging to use the
logs:PutLogEventspermission you granted in the previous step. - Use the same Firehose stream name you referenced when setting up the IAM role, then select Create Firehose stream.
DeliveryToHttpEndpoint.Success climb on the Firehose stream’s Monitoring tab.
Set up an IAM role for CloudWatch
Create an IAM role that allows CloudWatch to send logs to the Firehose delivery stream. Use the following trust policy:See Adding IAM identity
permissions
for instructions on creating inline policies for IAM roles.
<AWS_REGION>, <AWS_ACCOUNT_ID>, and <FIREHOSE_DELIVERY_STREAM> with your own values.
Create a CloudWatch log subscription
- In the CloudWatch console, navigate to the log group whose logs you want to stream.
- Open the Subscription filters tab.
- Select Create Amazon Data Firehose subscription filter.
- Choose the Firehose delivery stream from step 4 and the IAM role from step 5.
- Enter a Subscription filter name and select Start streaming.
- Open your Firehose stream’s Monitoring tab and check
DeliveryToHttpEndpoint.Success. The value should stay near 1; a drop or zero indicates AppSignal is rejecting records. - Check the S3 failure bucket from step 2. Failed records land there, and each object contains the rejection reason.
- If records are failing with an authorization error, verify that the Access key on the Firehose stream matches your AppSignal log source API key.