how to monitor microservices

36
Jorge Salamero Sanz @bencerillo @sysdig How to Monitor Microservices

Upload: sysdig

Post on 19-Mar-2017

418 views

Category:

Software


4 download

TRANSCRIPT

Page 1: How to Monitor Microservices

Jorge Salamero Sanz@bencerillo @sysdig

How toMonitor Microservices

Page 2: How to Monitor Microservices

How to Monitor Microservices?

Apps

Infra

Health Checks

JVM/JMXCustom metrics

Metrics Processing Unicorns, rainbows And cute dashboards

Page 3: How to Monitor Microservices
Page 4: How to Monitor Microservices

% whoami

Jorge Salamero Sanz

<[email protected]>

• Working on OSS last 12 years

• Working on monitoring last 3 years

• Containers gamer @sysdig

@bencerillo

@sysdig

Page 5: How to Monitor Microservices

Agenda

• Challenges of container infrastructures

• Traditional monitoring limitations

• Best practices monitoring Microservices

• Sysdig, container native monitoring & troubleshooting

Page 6: How to Monitor Microservices

Breaking traditional model

Microservices and containers break traditional monitoring and troubleshooting models

Page 7: How to Monitor Microservices

Traditional deployment

Full host OS

kernelsystemdsyslogd

App services

MySQLNginx

OpenSSLJava

App A

App B

App C

Ops Devs

Page 8: How to Monitor Microservices

Application workflow

Database App Cache

backend middleware frontend

Page 9: How to Monitor Microservices

The Docker revolution

Servers Virtual Machines Containers

Unit: machine

Orchestration: no

Architecture: monolithic

Unit: machine

Orchestration: externalArchitecture: monolithic

Unit: (micro)service

Orchestration:nativeArchitecture: distributed

Page 10: How to Monitor Microservices

Containerized deployment

Full host OS

kernel

+Docker

MySQL App A

Ops DevOps

Nginx + OpenSSL App B

Java 8.0 build XXX App C

Page 11: How to Monitor Microservices

… but in reality

Database App Cache/Frontend

Computing node

Computing node Computing node

Computing node Computing node

Computing node

Page 12: How to Monitor Microservices

… but in reality

Database App Cache/Frontend

Computing node

Computing node Computing node

Computing node Computing node

Computing node

Page 13: How to Monitor Microservices

Application workflow

Database App Cache

backend middleware frontend

Page 14: How to Monitor Microservices

New organization structures

Page 17: How to Monitor Microservices

1. Metric collection

• We containers, because:

– are simple

– are small

– are isolated

– less dependencies

• … but they are an opaque blackbox

Page 18: How to Monitor Microservices

“Workarounds”

Agent in the Docker container

Agent in the Kubernetes pod

Export metrics through an external agent

App Agent App Agent

App

Agent

App

App

App

1. Complex instrumentation (x2 because just the monitoring) plus service monitoring configuration

2. Limited and pre-established metric collection (Docker API, etc)

Page 19: How to Monitor Microservices

Kernel instrumentation

Kernel

Docker

Container1

Container2

Container3

App Apprkt LXC

Sysdig

Docker

Page 20: How to Monitor Microservices

Why this is cool?

• Just one instrumentation per host:– spawning or destroying a container is instrumentation-less

• Full visibility: all the system calls:– automatic service discovery

– all metrics collection (no filtering)

– application monitoring without instrumentation (magic of

decoding protocols)

Page 22: How to Monitor Microservices

Remember... but in reality:

Database App Cache/Frontend

Computing node

Computing node Computing node

Computing node Computing node

Computing node

Page 23: How to Monitor Microservices

2. Information aggregation

• Infrastructure monitoring should be transparent and

automatic (no instrumentation no configuration)

• You should handle your custom/biz metrics

• All metrics should be tagged automatically

• All metrics should be aggregated and segmented on a

service level basis

Page 24: How to Monitor Microservices

Application workflow

Database App Cache

backend middleware frontend

Page 25: How to Monitor Microservices

Orchestration platforms knows already...

Page 26: How to Monitor Microservices

Demo!

Page 28: How to Monitor Microservices

Real example

https://github.com/kubernetes/kubernetes/issues/14051

Page 29: How to Monitor Microservices

3. Analysis & troubleshooting

• Imagine:

strace + wireshark + htop + lsof + iostat + vmstat + *

• Not available on containers, don’t understand

namespaces

• Metrics and logs can bite your in the ass, system

calls have all the truth

• Infrastructure gets more complex and volatile

Page 30: How to Monitor Microservices

Demo!

Page 32: How to Monitor Microservices

Teams on Microservices

Francesc Zacarias, SRE @ Spotify

Page 33: How to Monitor Microservices

4. Teams by service

• Tags/Metadata from the orchestration platform, eg

Kubernetes:

– namespaces (dev, prod)

– services, deployments, RCs, pods

– custom tags

• ACLs out of the box (dashboards, alerts, etc) on

multi-tenant/PaaS scenarios

Page 35: How to Monitor Microservices

Sysdig

• 100% open-source

• 1M+ downloads

• Host analysis

• sysdig.org

• SaaS & on-prem

• 200+ customers

• Cluster analysis

• Dashboards, alerts,

events, teams

• sysdig.com