Questions tagged [amazon-cloudwatch]

Amazon CloudWatch provides monitoring for AWS cloud resources and the applications customers run on AWS. Use this tag when asking about CW features such as metrics or alarms. Use amazon-cloudwatchlogs instead when asking about log groups, log streams, and metric filters.

From the web site:

Developers and system administrators can use it to collect and track metrics, gain insight, and react immediately to keep their applications and businesses running smoothly. Amazon CloudWatch monitors AWS resources such as Amazon EC2 and Amazon RDS DB instances, and can also monitor custom metrics generated by a customer’s applications and services.

Usage Guidance

  • Use this tag when asking about CW metrics or CW alarms, the CW API, etc.
  • Do not use this tag when asking only about log groups, log streams, metric filters, etc; use instead.
  • Use both if asking about both (for example, if asking about a CW Logs metric filter that aggregates in a CW custom metric that triggers a CW alarm)

Resources

4155 questions
17
votes
1 answer

How to set Lambda alarm for specific Lambda using CloudFormation?

This is the structure of CloudFormation Alarm from AWS document. Type: "AWS::CloudWatch::Alarm" Properties: ActionsEnabled: Boolean AlarmActions: - String AlarmDescription: String AlarmName: String ComparisonOperator: String …
17
votes
3 answers

AWS CloudWatch Alarms to multiple EC2 instances

I'm wanting to apply a CloudWatch alarm to stop instances which aren't being used in our pre-production environment. We often have instances being spun up, used and then left turned on which is really starting to cost us a fair amount of money.…
Adam W.
  • 193
  • 1
  • 2
  • 8
16
votes
2 answers

Terraform AWS CloudWatch log group for ECS tasks/containers

I'm trying to create an AWS ECS task with Terraform which will put logs in a specific log group on CloudWatch. The problem is that container definition is in the JSON file and there is no way for me to map the CloudWatch group name from .tf file to…
16
votes
1 answer

Count Array Length in JSON Message Object with Amazon Cloudwatch Logs Insights

Is there any way to get the length of an array found in a JSON object parsed by cloud watch log insights? For example, when sending a JSON object of the following structure to log insights: { names: ['john', 'doe', 'joe', 'schmoe'] } it gets…
16
votes
3 answers

Where to find CloudFormation log stream

I used this CloudFormation template to create a stack: https://fwd.aws/mDMrd One of the steps failed, and the status reason given is: Failed to create resource. See the details in CloudWatch Log Stream: 2019/07/01/[$LATEST]fa6e... My problem is…
A.R.
  • 1,888
  • 2
  • 14
  • 22
16
votes
4 answers

Can I get information about AWS Lambda request IDs, e.g. the trigger?

In my logs I find START RequestId: 123a1a12-1234-1234-1234-123456789012 Version: $LATEST for every invocation of AWS lambda. Is it possible to get more information about a request, e.g. what triggered it?
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
16
votes
1 answer

send notification alert when AWS Lambda function has an error

I have a AWS Lambda function running some process in my infrastructure. The Lambda is triggered every 8 hours using a CloudWatch rule. I am trying to raise a notification if any error happens into the Lambda process. I tried to use SES but that…
16
votes
2 answers

Monitoring memory usage in AWS CloudWatch for Windows instance

By default, memory usage isn’t monitored by CloudWatch. So I tried to add it to my Windows instance in AWS using these instructions. This is what I did: I created a user named custom-metrics-user. Then I stored the access and secret key. I created…
prudhvi
  • 1,141
  • 6
  • 23
  • 46
15
votes
2 answers

Is there a way to paginate AWS CloudWatch Logs Insights

is there a way to paginate AWS CloudWatch Logs Insights? Thank you. I was thinking something like below but that doesn't work fields @message | page 2 | limit 20 EDIT: I am currently accessing the logs via the Logs Insight In my app, I am…
15
votes
1 answer

How to send alert based on log message on CloudWatch

I have a lambda that sends to STDERR when a given operation fails, something like: async function handler(event, context) { const success = do() if (success) { return { statusCode: 200 } } console.error('Failed :(') return {…
Amanda Ferrari
  • 1,168
  • 5
  • 17
  • 30
15
votes
2 answers

AWS Lambda schedule a delayed execution to run once

I have an API Gateway with Lambdas behind, for some of the endpoints I want to schedule an execution in the future, to run once, for example the REST call was made at T time, I want that lambda to schedule an execution ONCE at T+20min. The only…
e-nouri
  • 2,576
  • 1
  • 21
  • 36
15
votes
2 answers

AWS CodeCommit: Repository Notifications vs Repository Triggers

Notifications: https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-repository-email.html Triggers: https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-notify.html The official document states that for CodeCommit repository…
15
votes
3 answers

How to debug failed fargate task initialization

I have a fargate task which I have scheduled to run with CloudWatch Event rules, and output a timestamp to a database on a successful run. It also outputs a logfile to CloudWatch for every time it runs. However, there was 1 time where the log file…
15
votes
1 answer

How to download complete AWS CloudWatch log

QUESTION SUMMARY How to download a complete log from CloudWatch using CLI tools? The log that I download is incomplete. I know this because if I reverse the order, using --start-from-head, I get new content. Not just reversed-order. RESEARCH I am…
P i
  • 29,020
  • 36
  • 159
  • 267
15
votes
5 answers

How to get metrics data from aws cloudwatch to csv

i have been working on project, and i want to export metrics data from cloudwatch like CPU Utilization and Network Out data, is there any way to get that data? and convert it to csv?
RyanBesari
  • 171
  • 1
  • 1
  • 3