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
20
votes
1 answer

How to pass values to a Lambda function in CloudWatch?

What's the best way to wrap functions in a way that handles a ping from a CloudWatch timer? For example, take the lambda function below: export const fn = (event, context, callback) => { const { year, make, model, } = event.queryStringParameters …
20
votes
2 answers

AWS Cloudwatch logs with Docker Container - NoCredentialProviders: no valid providers in chain

My docker-compose file: version: '2' services: scraper: build: ./Scraper/ logging: driver: "awslogs" options: awslogs-region: "eu-west-1" awslogs-group: "doctors-logs" awslogs-stream:…
19
votes
8 answers

How do I set up CloudWatch to detect when an EC2 instance goes down?

I've got an app running on AWS. How do I set up Amazon CloudWatch to notify me when the EC2 instance fails or is no longer responsive? I went through the CloudWatch screens, and it appears that you can monitor certain statistics, like CPU or disk…
ccleve
  • 15,239
  • 27
  • 91
  • 157
19
votes
2 answers

AWS CloudWatch Logs Insights alarms

Is it possible to set alarms based on CloudWatch Logs Insights queries? In this page it says the following: In addition, you can publish log-based metrics, create alarms, and correlate logs and metrics together in CloudWatch Dashboards for complete…
19
votes
2 answers

AWS cloudwatch is truncating logs

I have created an API using AWS api gateway. Under stages the "Log full requests/responses data" checked and "Enable CloudWatch Logs" is also checked. When i look at the logs in cloudwatch i see some of the logs are "TRUNCATED". In-fact all of the…
LP13
  • 30,567
  • 53
  • 217
  • 400
19
votes
5 answers

How to keep desired amount of AWS Lambda function containers warm

On my project there is REST API which implemented on AWS API Gateway and AWS Lambda. As AWS Lambda functions are serverless and stateless while we make a call to it, AWS starts a container with code of the Lambda function which process our call.…
Hleb
  • 7,037
  • 12
  • 58
  • 117
19
votes
2 answers

What does ingestion time mean in CloudWatch

In the structure of an event of Cloudwatch : 'events': [ { 'logStreamName': 'string', 'timestamp': 123, 'message': 'string', 'ingestionTime': 123, 'eventId': 'string' }, …
JavaQueen
  • 1,155
  • 2
  • 19
  • 44
19
votes
6 answers

how to connect a cloudwatch alarm to a lambda function

How do you connect an aws cloud watch alarm to a lambda function invocation? I am programmatically adding a cloud watch alarm to the ELBs that we create as part of a cloud formation stack via AWS CloudFormation Templates. I want to have the alerts…
18
votes
2 answers

AWS CloudWatch agent shows "cwoc_status": "stopped"

I have installed AWS CloudWatch agent on my EC2 instance and configured with the amazon-cloudwatch-agent-config-wizard. The AWS credentials are stored in .aws/credentials and picked up by the wizard during configuration. Now I am checking the status…
Alessandro Baffa
  • 1,127
  • 3
  • 11
  • 25
18
votes
3 answers

How to Configure CloudWatch Lambda Insights in Terraform

I need to enable "CloudWatch Lambda Insights" for a lambda using Terraform, but could not find the documentation. How I can do it in Terraform? Note: This question How to add CloudWatch Lambda Insights to serverless config? may be relevant.
onkami
  • 8,791
  • 17
  • 90
  • 176
18
votes
2 answers

Display empty bin as a zero value in AWS Log Insights graph

With this count query by bin: filter @message like / error / | stats count() as exceptionCount by bin(30m) I get a discontinuous graph, which is hard to grasp: Is is possible for AWS Cloudwatch Log Insights to consider the empty bin as zero count…
pba
  • 700
  • 8
  • 18
18
votes
2 answers

Why does AWS Cloudwatch use an Evaluation Range when determining alarm state with missing data points?

From the docs: No matter what value you set for how to treat missing data, when an alarm evaluates whether to change state, CloudWatch attempts to retrieve a higher number of data points than specified by Evaluation Periods. The exact number of…
user3658800
  • 446
  • 3
  • 12
18
votes
1 answer

What is the difference between a Log Group and a Log Stream?

I'm trying to setup Amazon Cloud Watch as a remote logging destination for some C# applications I am working on. One thing that is not clear to me is the difference between a Log Group and a Log Stream and how they should be used? I have a number…
Eric Anastas
  • 21,675
  • 38
  • 142
  • 236
17
votes
1 answer

Why Memory Utilization of EC2 instance is not default metric of Amazon CloudWatch?

Three Amazon CloudWatch default metrics of EC2 instance are: CPU Disk I/O Data transfer Memory Utilization of EC2 instance is custom metric. I don't know why because Memory Ultilization is one of the very important metrics need to be…
Dat Ho
  • 975
  • 1
  • 7
  • 9
17
votes
3 answers

AWS Lambda Python 3.7 runtime exception logging

Unhandled exceptions thrown while using the Python 3.7 runtime do not seem to be logged to CloudWatch as they are in Python 3.6. How can you setup the logger in Python 3.7 to capture this information? Also posted on AWS forum To replicate: 1.…
DJeppson
  • 173
  • 1
  • 6