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
44
votes
9 answers

aws lambda Unable to import module 'lambda_function': No module named 'requests'

I have recently started to use AWS Lambda to use triggers against some python code I have written. I currently have 2 lambda functions, both of which have been created with ZIP files. The second one I created is supposed to test the trigger…
43
votes
1 answer

What is the difference between a CloudWatch Alarm and a CloudWatch Event?

What is the difference between a CloudWatch Alarm and a CloudWatch Event? For me both seem to respond on a certain metric and trigger something on their target? What are important differences?
DenCowboy
  • 13,884
  • 38
  • 114
  • 210
43
votes
7 answers

My AWS Cloudwatch bill is huge. How do I work out which log stream is causing it?

I got a $1,200 invoice from Amazon for Cloudwatch services last month (specifically for 2 TB of log data ingestion in "AmazonCloudWatch PutLogEvents"), when I was expecting a few tens of dollars. I've logged into the Cloudwatch section of the AWS…
42
votes
2 answers

Amazon Cloudwatch Logs Insights parse with regex

I'm trying to extract an ephemeral field with the parse command. Unfortunately, the log format is such that the glob expression is not enough for it, thus I need to use regex. The regex itself is fine, but I just can't make the command to extract…
tnissi
  • 907
  • 1
  • 8
  • 12
42
votes
4 answers

How do you look at console.log output of the amazon lambda function

When you do a console.log('Loading function'); in an amazon lambda function, where does that go? My setup api gateway lambda function nodejs6.10 curl https://n2tredacted.execute-api.us-east-1.amazonaws.com/prod/redactedFunc
39
votes
3 answers

AWS Lambda - CloudWatch Event type

When writing an AWS Java Lambda function that's triggered by Cloudwatch scheduled events, which event object gets passed to the Lambda handler function? For example, for a Lambda function triggered by an S3 event, AWS invokes the function and passes…
Brooks
  • 7,099
  • 6
  • 51
  • 82
37
votes
1 answer

CloudWatch does not aggregate across dimensions for your custom metrics

Reading the docs I saw this statement; CloudWatch does not aggregate across dimensions for your custom metrics That seems like a HUGE limitation right? It would make custom metrics all but useless in my estimation- so I want to confirm I'm…
red888
  • 27,709
  • 55
  • 204
  • 392
37
votes
10 answers

Can AWS CloudWatch alarms be paused/disabled during specific hours?

I want to automatically toggle alarms on/off during specific periods of time so that they do not fire during maintenance windows. I'm doubting that an easy or direct method exists since I could not find such a thing in the documentation. Does anyone…
jmsb
  • 4,846
  • 5
  • 29
  • 38
35
votes
2 answers

Any way to search across all log streams in a cloud watch log group?

In AWS console, I can search for a string in all log streams of a log group? Right now, I have to go inside each log stream and then do search which takes a lot of time, if I want to search across the log streams.
hatellla
  • 4,796
  • 8
  • 49
  • 101
35
votes
2 answers

How to filter CloudWatch Log Insights with ispresent() function

I'm trying to perform a really simple query on the not so new AWS Cloudwatch Log Insights I'm following their documentation to filter my logs using ispresent function. The query is the following: fields @timestamp, status | filter ispresent(status)…
Gustavo Lopes
  • 3,794
  • 4
  • 17
  • 57
34
votes
5 answers

Count unique values in aws cloudwatch metric

I have a set of cloudwatch logs in json format that contain a username field. How can I write a cloudwatch metric query that counts the number of unique users per month?
33
votes
15 answers

Is there a way to generate the AWS Console URLs for CloudWatch Log Group filters?

I would like to send my users directly to a specific log group and filter but I need to be able to generate the proper URL format. For example, this URL…
33
votes
7 answers

AWS::Event::Rule FailedInvocation debug info?

I have a AWS::Event::Rule that routes a S3 put event to a ECS task. I can see the rule is being triggered from the metrics, but also see FailedInvocation on every trigger. I suspect that's a permission / policy issue, but not able to find any debug…
33
votes
5 answers

Invoke AWS Lambda function only once, at a single specified future time

I want to be able to set a time to invoke an AWS Lambda function, then have that function be invoked then and only then. For example, I want my Lambda function to run at 9:00pm on December 19th, 2017. I don't want it to repeat, I don't want it to…
Ethan Harlig
  • 756
  • 1
  • 7
  • 22
32
votes
2 answers

How to query distinct from AWS log insights

I need to query data from lambda using AWS Cloudwatch log insights. The query syntax provide by aws doesn't have distinct. Only support (count_distinct(fieldname)) ref.…