17
SERVER MONITORING 101

Server Monitoring 101

Embed Size (px)

Citation preview

Page 1: Server Monitoring 101

SERVER MONITORING 101

Page 2: Server Monitoring 101

WHAT WE ARE GOING TO DISCUSS TODAY

Why we need monitoring

What do we monitor

Different monitoring services

Cloudwatch

Datadog

Demo

Page 3: Server Monitoring 101

WHY NEED MONITORING?We need to make sure our application

Does not FAIL Makes our users HAPPY

That means:

• Application is working properly

• Customers getting what they want

• The responses are not slow

• Not getting errors

Page 4: Server Monitoring 101

WHY NEED MONITORING?We need some indicators that we can measure

1200 1230 1300 1330 1400 1430 15000

20406080

100

CPU Utilization

Server 1 Server 2 Server 3

1200 1230 1300 1330 1400 1430 15000

200400600800

Error Counts

Server 1 Server 2 Server 3

About what?WEB DB

Cloud Resources

Application

So that we can- Know about how our application is performing

- Get alert if something goes wrong

- Take steps necessary to prevent failure- Improve user experience- Realize trends of resource utilization

Page 5: Server Monitoring 101

WHAT DO WE MONITOR

InfrastructureApp

Availability

Logs

System info

Exceptions/ Errors

Events (404)

Servers (Web, DB)

CPU Utilization

Cloud storage

Notification Services

Disc Storage

Data Transfer

Load Balancer

Response time

Response status

Request count

Latency

Others Read/Write Latency

Page 6: Server Monitoring 101

AVAILABLE SERVICES

And many more …

Cloudwatch

Page 7: Server Monitoring 101

AMAZON CLOUDWATCH

- Collect and track metrics

- Collect and monitor log files

- Set alarms based on defined thresholds

- Automatic scaling

Monitoring service for AWS resources- Elastic Load Balancers- EC2 instances- RDS instances- EBS volumes- Route53 health checks- DynamoDB tables- SNS topics- SQS queues

What it does

Page 8: Server Monitoring 101

CLOUDWATCH LOGS SETUPDocumentation URL: http://amzn.to/2d3AXsI

Install Agent

sudo yum update –ysudo yum install -y awslogs

Configure settings

sudo vim /etc/awslogs/awscli.conf##### configure the settings belowregion = region = ap-northeast-1# configure following if required, or just use IAM role # aws_access_key_id = <YOUR ACCESS KEY># aws_secret_access_key = <YOUR SECRET KEY>

sudo vim /etc/awslogs/awslogs.conf##### configure the settings below[/usr/local/jetty/logs/app.log]datetime_format = %b %d %H:%M:%Sfile = /usr/local/jetty/logs/app.logbuffer_duration = 5000log_stream_name = {instance_id}initial_position = start_of_filelog_group_name = demo-app-logs

{ "Version": "2012-10-17", "Statement": [

{ "Effect": "Allow", "Action": [

"logs:CreateLogGroup”,

"logs:CreateLogStream”,

"logs:PutLogEvents", "logs:DescribeLogStreams" ], "Resource": [

"arn:aws:logs:*:*:*" ]

} ]

}

Policy required for the IAM role

Page 9: Server Monitoring 101

CLOUDWATCH LOGS SETUPDocumentation URL: http://amzn.to/2d3AXsI

Start Agent

sudo service awslogs startsudo chkconfig awslogs on

We are almost there!

Page 11: Server Monitoring 101

DATADOGSimilar to Cloudwatch Infrustructure Monitoring As A Service and it’s Open Source!

Can manage a variety of stacks from different infrastructure platformsAnd brings the data in one place

Even brings data from other Monitoring services Cloudwatch

Page 12: Server Monitoring 101

DATADOGAPI Support

Can get performance metrics data using the API

Python

Ruby Shell

Can even get embeddable graph metrics through API calls

There are Community Libraries availableFor other languages (C#, Go, Java etc)Documentation URL: http://bit.ly/2gc0KjK

Documentation URL: http://bit.ly/2g8uuw5

Page 13: Server Monitoring 101

DATADOG INSTALLATIONYou need to create AWS IAM Role for cross account access:

Documentation URL: http://bit.ly/2fT6PRb

Refer to documentation for required policy.

Page 14: Server Monitoring 101

DATADOG AGENT INSTALLATIONOne Step Install

DD_API_KEY=xxx bash -c "$(curl -L https://raw.githubusercontent.com/DataDog/dd-agent/master/packaging/datadog-agent/source/install_agent.sh)”

Step by step

Page 15: Server Monitoring 101

DATADOG SLACK INTEGRATION

Install Datadog app in Slack

Page 16: Server Monitoring 101

DATADOG SLACK INTEGRATIONGet the service hook URL from Slack andingrate from Datadog admin panel.

Page 17: Server Monitoring 101

DEMO