Before you start
Have the following information ready:- Your app’s App-level Push API key. To find it, open the API keys settings page, or navigate to your organization settings and select Dev zone > API keys.
- The AWS region where you want to deploy the stack
What the template creates
The CloudFormation template creates the following resources:- An S3 bucket to store records that fail to deliver, with a 30-day lifecycle expiration and a retain-on-delete policy.
- An IAM role that allows Amazon Data Firehose to write failed records to the S3 bucket.
- A Firehose delivery stream that sends metrics to the AppSignal endpoint over HTTPS.
- An IAM role that allows CloudWatch Metric Streams to write to the Firehose delivery stream.
- A CloudWatch metric stream that exports metrics in OpenTelemetry 1.0 format.
CloudFormation template
Copy the following template and save it asappsignal-cloudwatch-metrics.yaml:
YAML
Deploy the stack
- Open the AWS CloudFormation console.
- Select Create stack and choose With new resources (standard).
- Under Specify template, select Upload a template file and upload
appsignal-cloudwatch-metrics.yaml. - Select Next.
- Enter a stack name, for example
appsignal-cloudwatch-metrics. - For AppLevelPushApiKey, enter your app’s App-level Push API key.
- Select Next twice, then check I acknowledge that AWS CloudFormation might create IAM resources and select Submit.
Filter specific AWS services
By default, the template streams metrics from all AWS services in the account. To stream only specific services, addIncludeFilters to the CloudWatchMetricStream resource:
YAML
Verify the deployment
- In the AWS Console, search for “CloudFormation” and select Stacks. Open your stack and select the Resources tab to confirm all resources show CREATE_COMPLETE.
- In the AWS Console, search for “CloudWatch”. In the left sidebar, go to Metrics > Streams and confirm the metric stream status is Running.
- In the AWS Console, search for “Firehose”. Open the delivery stream and use the Test with demo data function to verify connectivity.
- In AppSignal, open your app’s dashboard and check that CloudWatch metrics appear on your custom dashboard.
Multi-region deployments
The template deploys all resources in a single AWS region. If you run workloads in multiple regions, deploy a separate copy of this stack in each region. This keeps data transfer within each region and avoids cross-region transfer fees.Clean up
To remove all resources created by this template, delete the stack in the CloudFormation console. The S3 bucket for failed deliveries has aDeletionPolicy of Retain, so it is kept when the stack is deleted to avoid losing any failed delivery records. Failed delivery records in the bucket are automatically deleted after 30 days by the lifecycle rule. You can delete the bucket manually once you no longer need it.