instrumenting application stack in a dynamically scaling environment (dmg212) | aws re:invent 2013

27
Instrumenting your Application Stack in a Dynamically Scaling Environment Mike Fiedler, Datadog November 15, 2013

Upload: amazon-web-services

Post on 12-Jan-2015

279 views

Category:

Technology


3 download

DESCRIPTION

(Presented by Datadog) Gaining visibility into an application stack’s performance is necessary to understand how the stack is running and to configure alerts effectively. Instrumenting each component in the stack to produce metrics provides this insight. In an environment that scales automatically, hosts are being automatically added, removed, and reassigned. Using an automated methodology for instrumentation in these environments can improve results and save you time. This session includes a live demo component to show auto-instrumentation of hosts, graphing, and alerting on metrics.

TRANSCRIPT

Page 1: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

Instrumenting your Application Stack in a

Dynamically Scaling Environment

Mike Fiedler, Datadog

November 15, 2013

Page 2: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

The Past

• Server uptime

• Intertwined applications

• SPOFs

Page 3: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

The Present

• SOA

• Scale or Fail

• Data-driven decisions

Page 4: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

Modern application stack

Page 5: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

Failure is inevitable

Page 6: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

Design to tolerate failure

Page 7: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

Things that produce metrics

business/service Services

• application

• OS

• instances

API-based

• Amazon S3, S*S

• Amazon RDS, Amazon Redshift

• etc.

Users

• RUM

Page 8: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

The Desire

Page 9: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

CPU comparison (hypervisor)

Page 10: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

CPU comparison (Agent)

Page 11: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

My Stack

• HAProxy

• Apache HTTP

• Bottle.py – Custom python webapp

• MongoDB

• Amazon EC2

• Chef

• Datadog

• Users

Page 12: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

Tracking database operations

Page 13: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

Moving up the stack…

Page 14: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

Even higher…

Page 15: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

Using metadata for more flavor

Page 16: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

Replace an instance, keep the metrics

Page 17: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

Enter…

Page 18: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

Aggregating numbers

Page 19: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

Comparing numbers

Page 20: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

My App

from bottle import route

import pymongo

import json

db = pymongo.Connection('mongodb://localhost').test

@route('/insert/:name')

def insert(name):

doc = {'name': name}

db.words.update(doc, {"$inc":{"count": 1}}, upsert=True)

return json.dumps(doc, default=default)

Page 21: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

Add 2 lines and you win!

from bottle import route

import pymongo

import json

from statsd import statsd

db = pymongo.Connection('mongodb://localhost').test

@route('/insert/:name')

@statsd.increment('fullstack.insert')

def insert(name):

doc = {'name': name}

db.words.update(doc, {"$inc":{"count": 1}}, upsert=True)

return json.dumps(doc, default=default)

Page 22: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

Profit!

Page 23: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

Correlation

Page 24: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

Don’t be caught unaware

Page 25: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013
Page 26: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

Question Time!

Page 27: Instrumenting Application Stack in a Dynamically Scaling Environment (DMG212) | AWS re:Invent 2013

We are sincerely eager to hear

your feedback on this

presentation and on re:Invent.

Please fill out an evaluation form

when you have a chance.