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.


Recommended