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
10
votes
0 answers

Adding custom variable in cloudwatch agent config

I have the following config that I generate as part of user data for my EC2 instance { "agent": { "run_as_user": "root" }, "logs": { "logs_collected": { "files":…
user_mda
  • 18,148
  • 27
  • 82
  • 145
10
votes
2 answers

Cloudwatch Alarm across all dimensions based on metric name for custom metrics

We are publishing custom Cloudwatch metrics from our service and want to set up alarms if the value for a metric name breaches a threshold for any dimension. Here are the metrics we are publishing: Namespace=SameName, MetricName=Fault,…
10
votes
1 answer

CloudWatch Insights Query - How to get a single count from counts

I have a log file which contains playerId values, some players have multiple entries in the file. I want to get an exact distinct count of to unique players, regardless of if they have 1 or multiple entries in the log file. Using the query below it…
10
votes
3 answers

Looking for a good way to monitor ECS deploy failure notification?

I am deploying services to ECS fargate behind ALB. During deployment, ALB sends health check to the service and if there are 3 consecutive failure health checks, ECS will destroy the new deployed service and keep the old version of the container. I…
Joey Yi Zhao
  • 37,514
  • 71
  • 268
  • 523
10
votes
2 answers

How to query AWS CloudWatch logs using AWS CloudWatch Insights?

I have a lot of AWS Lambda logs which I need to query to find the relevant log stream name, I am logging a particular string in the logs, Which I need to do a like or exact query on. The log format is something like this - Request ID =>…
10
votes
4 answers

How to start the cloudwatch agent in container?

From the docker hub there is an image which is maintained by amazon. Any one know how to configure and start the container as I cannot find any documentation
forum.test17
  • 2,119
  • 6
  • 30
  • 62
10
votes
3 answers

AWS CloudWatch Agent not starting

I have an Ubuntu EC2 instance. I manually created the following basic CloudWatch Agent config file in: /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json { "metrics": { "metrics_collected": { "collectd": {}, …
Stephen Walsh
  • 815
  • 4
  • 18
  • 34
10
votes
3 answers

Update existing Log Group using CloudFormation

I have a lambda which has a log group, say LG-1, for which retention is set to Never Expire (default). I need to change this Never Expire to 1 month. I am doing this using CloudFormation. As the log group already exists, when I am trying to deploy…
10
votes
1 answer

AWS Clouwatch logs agent (awslogs) going crazy and writing GBs to log file

I have had the problem several times on my production machine, it seems like for whatever reason, the AWS log agent gets desynchronized and starts writing like crazy to the log file the following error messages 2018-09-03 17:51:17,251 -…
Cyril Duchon-Doris
  • 12,964
  • 9
  • 77
  • 164
10
votes
6 answers

How do I prevent the Amazon cloudwatch agent from not working?

I'm trying to add aws cloudwatch agent to see additional metrics using tutorial A brief review of what I did: Create IAM role and attach to EC2 instance doc (NOTE: I do not use Parameter Store just for communication between EC2 and…
Bogdan Dubyk
  • 4,756
  • 7
  • 30
  • 67
10
votes
1 answer

How to specify SQS message attributes when used as CloudWatch Events target?

I want to use AWS CloudWatch Events to send a message to SQS on a predefined schedule. The message body is irrelevant, but it does require several message attributes. While creating this Events rule in CloudFormation I could not find any…
Evgeny
  • 6,533
  • 5
  • 58
  • 64
10
votes
1 answer

Allowing CloudWatch Alarm to send to SNS in other account

I have a SNS topic in account "A", which is a trigger of a Lambda function in that same account. This Lambda function sends a message to a private Slack channel. This works fine, as long as the CloudWatch alarm is in the same account (Account…
Fransurbo
  • 357
  • 2
  • 13
10
votes
2 answers

Is it possible to rename an AWS CloudWatch Log Group?

I have created an AWS CloudWatch log group with a name which was not very future proof. Is it possible to rename such a log group? I could find no option to do this via the CloudWatch console. I guess an alternative would be to export the content of…
10
votes
4 answers

CloudWatch logs acting weird

I have two log files with multi-line log statements. Both of them have same datetime format at the begining of each log statement. The configuration looks like this: state_file = /var/lib/awslogs/agent-state [/opt/logdir/log1.0] datetime_format =…
10
votes
2 answers

Can I restrict CloudWatch Actions based on Resource or Condition?

I am trying to restrict CloudWatch Actions to a certain VPC or Resource. Can I do that?. Following is the policy { "Sid": "AllowCloudWatchActions", "Effect": "Allow", "Action": [ "cloudwatch:DescribeAlarms", …