AWS Cloudwatch Metric Stream
AWS Cloudwatch Metric Stream enables customers to send their Cloudwatch metrics to Last9.
Pre-requisites
Obtain the following and copy it to your clipboard from the Home > Integrations > Cloudwatch section.
HTTP Endpoint URL
Username
Password
Setting up required IAM policy
Ensuring your AWS Identity and Access Management (IAM) user account has access permissions is crucial. The following access policy is specifically crafted to enable actions related to creating Kinesis Data Streams and CloudWatch Metric Streams.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"cloudwatch:StartMetricStreams",
"cloudwatch:PutMetricStream",
"cloudwatch:GetMetricStream",
"cloudwatch:GetMetricData",
"cloudwatch:ListMetrics",
"cloudwatch:ListMetricStreams"
],
"Resource": ["*"]
},
{
"Effect": "Allow",
"Action": [
"firehose:PutRecord",
"firehose:CreateDeliveryStream",
"firehose:DescribeDeliveryStream",
"firehose:PutRecordBatch",
"firehose:UpdateDestination",
"firehose:ListDeliveryStreams"
],
"Resource": ["*"]
},
{
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets",
"s3:CreateBucket",
"s3:GetBucketLocation",
"s3:GetObject",
"s3:ListBucket",
"s3:ListBucketMultipartUploads",
"s3:PutObject"
],
"Resource": ["arn:aws:s3:::*"]
},
{
"Effect": "Allow",
"Action": [
"iam:CreateRole",
"iam:CreatePolicy",
"iam:AttachRolePolicy",
"iam:CreatePolicyVersion",
"iam:DeletePolicyVersion",
"iam:PassRole"
],
"Resource": [
"arn:aws:iam::<account_id>:policy/*",
"arn:aws:iam::<account_id>:role/*"
]
},
{
"Effect": "Allow",
"Action": ["logs:CreateLogGroup", "logs:CreateLogStream"],
"Resource": [
"arn:aws:logs:<region>:<account_id>:log-group:*:log-stream:*"
]
}
]
}
Creating an AWS Kinesis Delivery Stream
-
Open the AWS Kinesis homepage (console.aws.amazon.com/kinesis/home)
-
Open the left sidebar (click on the ☰ icon, if it is not expanded already)
-
Click on
Delivery Streams
-
Click on
Create delivery stream
-
Choose
Direct PUT
-
Delivery stream name =
last9-$your_organization_name
-
Set the copied write HTTP Endpoint URL from the Last9 cluster as an HTTP endpoint.
-
Add
username
andpassword
. -
Choose or create an S3 bucket to save data the stream failed to deliver
-
Click on
Create delivery stream
Sending data from Cloudwatch to the delivery stream
-
Open the Cloudwatch console and click on
Metrics -> Streams
-
Click on
Create metric stream
-
Choose
All metrics
to send all Cloudwatch metrics. Optionally, you can also select the metrics you want to stream. You can include or exclude specific namespaces and metrics you want to send by usingSelect metrics
option. -
Ensure that you use the delivery stream created in the earlier step and that the output format is
Opentelemetry 0.7
. -
Enter the Custom Metric stream name as
last9-$your_organization_name
and then click onCreate metric stream
Verification
Once the Cloudwatch metric stream is enabled, it sends metrics with the prefix amazonaws_com_AWS prefix
. They can be
observed in the Hosted Grafana in the Grafana tab in Last9.
Troubleshooting
Please get in touch with us on Discord or Email if you have any questions.