qcon london 2017 - monitoring serverless architectures by rafal gancarz

66
MONITORING SERVERLESS ARCHITECTURES

Upload: opencredo

Post on 11-Apr-2017

122 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

MONITORING SERVERLESS

ARCHITECTURES

Page 2: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Your Manager

CAN YOU HELP WITH SOME PRODUCTION PROBLEMS?

Page 3: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

(CC) Rachel Gardner

Page 4: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

Rafal GancarzLead Consultant @ OpenCredo

@RafalGancarz

Page 5: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

WHAT IS SERVERLESS?

Page 6: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

(CC) theaucitron

Page 7: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Cloud-native

Page 8: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

PaaS?

Page 9: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Serverless ≠ FaaS

FaasServerless

Page 10: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Managed runtime

Page 11: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

WHY SERVERLESS?

Page 12: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

(CC) snapp3r

Page 13: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Availability

Page 14: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Scalability

Page 15: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Economy

Page 16: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Time to market

Page 17: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Security

Page 18: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Operability

Page 19: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

SERVERLESS BUILDING BLOCKS

Page 20: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

AWS Lambda

Java, C#, NodeJS, Python

sync & async invocation

1 million invocations and 400k GB-s free per month

$0.20 per 1 million requests and ~$6.65 for 400k GB-s thereafter

Page 21: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

AWS API Gateway

security, caching, throttling

functions as API implementations

1 million requests free per month

$3.50 per 1 million requests and $0.09/GB (for the first 10 TB, then cheaper)

Page 22: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

AWS DynamoDB

document and key-value

function as triggered procedures

25 GB of storage and 25 units of read capacity each month for free (~200k requests per month)

$0.25 per GB/month and $0.0065 per hour for 10 units of write capacity (36k writes/hour) or 50 units of read capacity (180k reads/hour)

Page 23: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

AWS S3

durable, available and scalable

functions as content processors

5 GB of storage and 15 GB of data transfer out to Internet each month for free

$0.03 per TB/month and $0.09 per GB data transfer out to Internet

Page 24: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

AWS SNS

pub-sub, push notifications

functions as destinations

1m publishes, 1m mobile push notifications, 1k emails, 100k HTTP notifications and 1 GB of data transfer out each month for free

$0.50 per 1m publishes, $0.60 per 1m HTTP notifications and $0.09 per GB data transfer out to the Internet

Page 25: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

AWS Kinesis Streams

pub-sub, persistent

functions as consumers

no free tier

$0.015 per shard/hour, $0.014 per 1m PUT payload units (25KB) + extended retention charges

data transfer is free

Page 26: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Other AWS servicesSQS

Redshift

IoT

ElastiCache

CognitoSES

RDS

ElasticSearch

EMR

Batch

Route53CloudFront

Greengrass Button

Step Functions

Page 27: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

(CC) Grégoire Lannoy

MONITORING

Page 28: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

AWS CloudWatch

scalable, managed

real-time monitoring

metrics, logs, alarms, events

Page 29: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

(CC) Jérôme S

METRICS

Page 30: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

CloudWatch Metrics

retention: 1m (15 days), 5m (63 days), 1h (15 months)

basic monitoring (1m/5m) is free

10 metrics and 1 million API requests for free each month

$0.30 per metric/month for the first 10k metrics ($0.02 for metrics over 1M)

$0.01 for 1000 API requests

Page 31: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

AWS Lambda

Invocations

Errors

Dead Letter Errors

Duration

Throttles

Page 32: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

AWS API Gateway

4XX Error

5XX Error

Cache Hit Count

Cache Miss Count

Count

Integration Latency

Latency

Page 33: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

AWS DynamoDB

Provisioned Capacity Units Read/Write Consumed Capacity Units Read/Write Online Index Consumed Capacity/Progress/Throttling Returned Bytes Returned Item Count Returned Records Count (Streams) Successful Request Latency Errors System/User Conditional Check Failed Requests Throttled Events Read/Write/Requests

Page 34: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

AWS S3

Bucket Size Bytes (daily)

Number Of Objects (daily)

All Requests

Get/Put/Delete/Head/Post/List Requests

Bytes Downloaded/Uploaded

Errors 4XX/5XX

First Byte Latency

Total Request Latency

Page 35: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

AWS SNS

Number Of Messages Published

Publish Size

Number Of Notifications Delivered

Number Of Notifications Failed

SMS Success Rate

Page 36: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Custom Metrics

function

Lambda

CloudWatchSDK

Page 37: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Estimated Billing

Total Estimated Charges

Estimated Charges (per service)

Page 38: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

(CC) Kevin Dooley

DASHBOARDS

Page 39: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

CloudWatch Dashboards

metrics, alarms, static text

3 dashboards (up to 50 metrics) per month for free

$3 per dashboard per month

Page 40: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

ALERTING(CC) Martin Abegglen

Page 41: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

CloudWatch Alarms

watches metrics over time

can trigger a function via SNS

10 alarms per month for free

$0.10 per alarm per month

Page 42: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Serverless Alerting

function

alarm topic

email

SMS

channel

metric

condition

Page 43: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

LOGGING

(CC) Mari Smith

Page 44: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

CloudWatch Logs

ingests and stores application logs

configurable retention period

5 GB data ingestion and 5 GB archived storage per month for free

$0.5985 per GB ingested per month

$0.0315 per GB archived per month

Page 45: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Log Collection

log groupLambda

stdout

functionstderr

Page 46: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Log Filtering

log group metric alarm

filter condition

Page 47: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Log Streaming

log group

function Elastic Search

stream function

Page 48: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Log Browsing

log group

Elastic Search

function

JSONKibana

+ Bunyan CLI

Bunyan

Page 49: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

EVENTS

(CC) JD Hancock

Page 50: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

CloudWatch Events

stores & streams application events

$1 per 1 million custom events

Page 51: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Custom Events

functionSDK

event rule function

Page 52: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

DynamoDB dynamic capacity

function

SDK

event

metrics

table

Page 53: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

HEALTH CHECKS

(CC) Rosmarie Voegtli

Page 54: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Route53 Health Checks

monitors HTTP(S) endpoints

50 AWS endpoint checks per month for free

$0.50 per health check per month

$1 per feature (HTTPS, string matching, fast interval, latency) per month

Page 55: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Health Checks

health check

metric alarm

api function table

Page 56: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

TRACING

(CC) Ozzy Delaney

Page 57: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

AWS X-Ray

collects transaction traces

support for Lambda coming soon

100k traces recorded and 1 million traces retrieved/scanned free per month

$5 per 1 million traces recorded and $0.50 per 1 million traces retrieved/scanned per month

Page 58: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

AUDITING

(CC) The Steve

Page 59: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

AWS CloudTrail

audits all console, API, SDK activity

first copy of management event free

additional copies $2 per 100k events

$0.10 per 100k data events

Page 60: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

THE FUTURE

(CC) matt northam

Page 61: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Total Visibility

Page 62: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Monitoring as a Service

Page 63: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Monitoring not only for Operations

Page 64: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Application <-> Monitoring

metrics events logs

feedback

Application Services

Monitoring Services

Page 65: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

@RafalGancarz

Monitoring as the enabler for the new functionality

Page 66: QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz

(CC) Alan Turkus

QUESTIONS?

@RafalGancarz