I have a java web application running on Tomcat deployed on an EC2 instance. Is there any way I can monitor/set alarms for when the web application goes down or stops responding? Essentially what I would like to do is to check if a HTTP request to the web app responds with status 200. If it does not respond with 200 (for a few times) then it should raise an alarm and send an e-mail to some ops people.
I know there are third party options like Nagois / uptimerobot that I could use but I wanted to know if there are any AWS offerings for this? Is it possible to set up such automated monitoring using AWS Cloud Watch? I could not find a way to do this based on what I read up about Cloud Watch. If this isn't the sort of thing Cloud Watch can handle, then is there another AWS service suited for this?
I think Port Monitoring Feature is available under AWS Beanstalk.
You can consider checking this http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.healthstatus.html
Ashutosh,
Ec2 is an IAAS service from AWS and you will not have an AWS offering to monitor your Tomcat server. However, you have custom-built solutions, which I think you are not looking for here.
However, if you are using an Application Load balancer or Beanstalk you get options to trigger alarms.
Yes , you can achieve it through a cloudwatch . collect your logs with a cloudwatch agent and upload it on cloudwatch logstream. below is the reference url for configuring cloudwatch agent.
https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Install-CloudWatch-Agent.html
After that with "create matrix filter" you can set up an email trigger as per your requirements.
https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/MonitoringPolicyE
https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Counting404Responses.htmlxamples.html
Related
I installed managed Anthos on a GKE cluster. Anthos Service Mesh is working and is displaying my API. Thanks to that Services that are in Monitoring automatically detect my API. This is great as it enables me to easily set SLOs and Error Budget for my API.
However I would like to be able to easily set SLOs for individual endpoints in my api. Services(in Monitoring) detect only my API and not the endpoints within my API(my API is one pod/container + sidecar). I tried to add endpoints to Services in Monitoring but it looks like it is only possible to add Kubernetes Objects there.
Is there a way to use Services in Monitoring with endpoints? Is the only way to do so to break endpoints to separate microservices?
You can monitor your endpoints using Cloud Endpoints with OpenAPI, which allows you to monitor the health of APIs you own by using the logs and metrics Cloud Endpoints maintains for you automatically. When users make requests to your API, Endpoints logs information about the requests and responses and also tracks three of the four golden signals of monitoring: latency, traffic, and errors. These usage and performance metrics help you monitor your API.
The following URL Configuring Cloud Endpoints has the configuration process for Cloud Endpoints. Use this URL Monitoring your API as a reference on the monitoring process for your API, and this last URL for the Cloud Endpoint’s overview.
I was wondering if anyone could advise the "best" (I know that's subjective, but meaning "best" as in least amount of work/steps) to trigger sending an E-mail from Amazon AWS. The Message body with contain dynamic variables/data from my App (Spring boot) so I will have to wire that in somehow, and it should be triggered from within my Application whenever it finishes processing some data, since my app reads .CSV data.
I cannot use JavaMail/Jakarta to send e-mail from within app as all Containers I have have blocked ports
Preferably using some type of AWS service since I'm already hosting this app on AWS ECS cluster
I would like to do it programmatically:
AWS provides Amazon Simple Email Service (SES) which is:
is an email platform that provides an easy, cost-effective way for you to send and receive email using your own email addresses and domains.
To use that, you would add SES permissions to your ECS tasks role. This way, you don't need to hard-code any AWS credentials into your application, as they will be automatically obtained by AWS SDK when interacting with SES.
AWS also provides AWS SDK for java. Using the SDK you can send emails using SES as shown in the example Send an email using the AWS SDK for Java.
If you want to send an email from a Spring Boot app, then use the Simple Email Service Java V2 API. There is an AWS Java V2 tutorial that shows how to build a Spring BOOT app that uses various AWS Services to analyze photos located in an Amazon S3 bucket. This app uses the SES Java V2 API to send a report that contains the details of the Amazon Rekognition service that analyzes the photos.
Is there anyway to Query AWS Service Status e.g. if Kinesis Stream is Up or not, or S3 Storage Service is available or not ? And on the basis of status, I want to execute certain CURL commands ?
I am looking to get a status for below services and then use it in our custom StatusPage
S3
API Gwy
Kinesis
SQS
Route53 + Cloudfront
I know there is statuspage for AWS Services but not sure how to use it programmatically and publish a CURL command.
The Service Health Dashboard is usually delayed and not very useful for real-time monitoring of AWS health status.
Instead, you could use AWS Health from your account, which provides much more up-to-date events. What's more you can setup automated notifications and response to any issues detected as described in:
Monitoring AWS Health events with Amazon CloudWatch Events
I am planning to deploy ELK to monitor my application running in AWS. My apps are using AWS xray for trace data. I am reading the doc about elastic APM to see how to ingest AWS xray to elasticsearch but I can't find any solution.
I have read the agent doc https://www.elastic.co/guide/en/apm/agent/nodejs/3.x/intro.html but xray is not listed as supported framework. Does this mean I need to build a xray agent and send the trace data to APM server? Or is there an easier way to do that?
Suppose multiple aws services are running (like EC2,S3) and If someone changes the configuration of these services , I want to know immediately and want to pull the updated configuration. So how can i listen to these services to pull configuration immediately . I went through couple of options like aws SNS and all. But i don't want to implement this using any aws services for this.
I am using spring boot application. Any help is appreciated , Thanks in advance.
The two services you should be interested in are:
AWS CloudTrail:
AWS CloudTrail is an AWS service that helps you enable governance, compliance, and operational and risk auditing of your AWS account. Actions taken by a user, role, or an AWS service are recorded as events in CloudTrail. Events include actions taken in the AWS Management Console, AWS Command Line Interface, and AWS SDKs and APIs.
AWS Config:
AWS Config provides a detailed view of the configuration of AWS resources in your AWS account. This includes how the resources are related to one another and how they were configured in the past so that you can see how the configurations and relationships change over time.
You can also configure Amazon CloudWatch Events rules that trigger when a particular API call is made (eg when a user changes some configuration). This could trigger a notification, a Lambda function, etc.
See:
Creating a CloudWatch Events Rule That Triggers on an AWS API Call Using AWS CloudTrail - Amazon CloudWatch Events
How to monitor AWS account activity with Cloudtrail, Cloudwatch Events and Serverless