Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS: Is it possible to monitor an external service?

With CloudWatch you can monitor applications running on AWS. Is it also possible to monitor an external service?

For example, I have a REST API and I want to get notified once that API is not accessible anymore. Does AWS offer you a monitoring tool for that purpose?

like image 956
thadeuszlay Avatar asked Jun 21 '18 11:06

thadeuszlay


People also ask

Which is used to monitor services in AWS?

Monitoring your AWS resources and applications is easy with CloudWatch. It natively integrates with more than 70 AWS services, such as Amazon EC2, Amazon DynamoDB, Amazon S3, Amazon ECS, Amazon EKS, and AWS Lambda.

How do I monitor my AWS resources?

Finally, to monitor your resources in a single view, use Amazon CloudWatch Dashboards to create customized views of the critical resource and application measurements and alarms for your AWS resources. Through Automatic Dashboards, get aggregated views of the health and performance of all AWS resources.

Which AWS service can be used to monitor and EC2 instance?

You can monitor your instances using Amazon CloudWatch, which collects and processes raw data from Amazon EC2 into readable, near real-time metrics.

Which service can AWS customers use to monitor AWS services and resources?

Amazon CloudWatch is a monitoring and management service that provides data and actionable insights for AWS, hybrid, and on-premises applications and infrastructure resources.


Video Answer


3 Answers

Not Cloudwatch just by itself, but you can use a combination of Cloudwatch and Lambdas to do what you're asking. You can use cloudwatch events to run lambdas on a schedule, something like once every 5 mins.

CloudwatchEvents -> HealthCheck Lambda -> Cloudwatch Custom Metrics

Your lambda can then ping the API you're monitoring the health of, and either send its status to cloudwatch as a custom metric; or potentially if your lambda throws an error when the API fails, the lambda error metric which is already in cloudwatch becomes your API failure metric

Once the metric exists in cloudwatch, either as a custom metric or the lambda metric by proxy, you're able to do usual cloudwatch things like alarms and notifications.

like image 58
RaGe Avatar answered Oct 17 '22 14:10

RaGe


Now there is a simple way to monitor external resources - CloudWatch Synthetics. Just create a canary to regularly monitor a website, API or even validate a multi-step UI flow.

Read more in the docs: CloudWatch > Using Synthetic Monitoring

like image 3
ksp Avatar answered Oct 17 '22 13:10

ksp


Amazon CloudWatch supports custom metrics generated by your applications and services that you do not run on AWS. In this way, CloudWatch can be an integrated storage and aggregation point, allowing you to monitor all of the metrics that you collect, and track on a single platform.

There might be more than one way to reach your goal by using the AWS CLI, an API/SDK, or the CloudWatch collectd plugin etc. I'd recommend you take a look at these links for more details: link-1, link-2, link-3, link-4

like image 2
kahveci Avatar answered Oct 17 '22 13:10

kahveci