Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for...

43
Microservices Observability Cláudio E. de Oliveira [email protected] +55 19 3705-5775

Transcript of Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for...

Page 1: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

Microservices Observability

Cláudio E. de Oliveira

[email protected]+55 19 3705-5775

Page 2: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

AGENDA

Microservices Drawbacks

Kubernetes

Open Tracing

Spring Cloud Sleuth

Service Mesh

ISTIO

1

2

3

4

5

6

Page 3: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

Modelo de apresentaçãoSensedia 2017

Barack Obama

[email protected]+55 19 3705-5775

Agenda

📑 Microservices Drawbacks

📑 Kubernetes

📑 Open Tracing

📑 Spring Cloud Sleuth

📑 Service Mesh

📑 ISTIO

Page 4: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

whoami!I am Claudio de OliveiraBook Author, Software Architect and Developerwork @sensediaAPIs, Spring and Docker enthusiast@claudioed on Twitter/claudioed on Githubhttp://claudioed.tech

Page 5: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...
Page 6: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

Glossary› Telemetry

How to collect data that will provide observability (sensors)

› ObservabilityMonitoring, Alerting and Visualizations, Distributed Tracing and Log Aggregation.

Page 7: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

MICROSERVICES DRAWBACKS

Page 8: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

Fallacies of distributed computing

› the network is reliable

› latency is zero

› bandwidth is infinite

Page 9: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

Microservices Drawbacks

› How microservices connect each other› Network Latencies can be a bottleneck› Network can be unreliable› Control the UP and Running instances› It increase the non-functional requirements

Page 10: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

your system doesn't look like this:

service1

service2

service4

service3DB

Page 11: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

...it looks more like this:

frontend ...Service1

10.0.0.11

service110.0.0.34

Service110.0.0.36

Service110.0.0.23

service110.0.0.4

service210.0.0.40

Service210.0.0.25

Service310.0.0.1

service310.0.0.17

Service310.0.0.7

Page 12: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

Network Latency Problems

› Which microservice was responsible?› How to find out where the defect is?› How know what is generally happening

during a request?

Page 13: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...
Page 14: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

Introducing Kubernetes

Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications.

Page 15: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

Kubernetes Architecture Diagram

Page 16: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

“Kubernetes was designed to orchestrate containers and run container across multiple machines.

Page 17: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

Now we are ready to talk aboutObservability...

Page 18: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

The OpenTracing standard

› Cloud Native Computing Foundation (CNCF)

› it standardizes the instrumentation of applications for distributed tracing

› its says a trace tells the story of a transaction

› while a span represents a single call

› distributed tracing systems collect and organize all this information in a nice interface and Zipkin is one of them

Page 19: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

We need to emit some events or data to someone collect...

Page 20: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

SPRING CLOUD SLEUTHServices interactions

instrumented automatically

Page 21: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

Features

› Adds trace and span ids to the SLF4J Mapped Diagnostic Context (MDC)

› Automatically instruments common ingress and egress points from Spring applications (servlet filter, rest template, feign client)

› just add spring-cloud-sleuth-zipkin dependency and the service will generate and send traces to Zipkin via HTTP

Page 22: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

Ways to emit data

Popularized by Netflix OSS and Spring CloudSpring Framework enable it in Spring BootAll these features works only in JVM languages

Page 23: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...
Page 24: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

Let’s think a little bit differently...

Page 25: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

What about the platform infrastructure for service communications ???

Page 26: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

ISTIO

Page 27: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

But before, we need to learn some new concepts...

Page 28: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

SidecarPattern

Page 29: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

SidecarPatternA service which can enrich the main service with utility tasks. Normally these tasks are cross-cutting and infrastructure related.

Page 30: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

Sidecar Pattern

Page 31: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

A service mesh is a configurable infrastructure layer for a microservices application.

ServiceMesh

Page 32: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

Goal

› Service Mesh was designed to be that would handle the service communications.

Page 33: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

This approach can give us some advantages

› We can take off some responsibilities from our microservices

› Ribbon, Hystrix, Metrics and Tracer (OSS)› The platform can provide it for us.› Polyglot

Page 34: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

Service Mesh Features

› Sidecar Proxy› Service Discovery & Load Balancing› Circuit Breaking› Fault Injection› Can be used in legacy systems

Page 35: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

Istio Deployment

Page 36: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...
Page 37: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

PILOTComponent that programs the Envoy proxies, responsible for service discovery, load balancing, and routing.

Page 38: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

MIXERComponent responsible for enforcing access control and usage policies across the service mesh and collecting telemetry data from Envoy and other services

Page 39: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

ISTIO ADD-ONsOpen-Source components which will work together to provide some additional functionalities

Page 40: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

Prometheus Grafana Jaeger

Open Source

Page 41: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

Demo Time

Page 42: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

Use Case - Architecture Diagram

Page 43: Microservices Observability - Amazon Web Services · Kubernetes is an open-source system for automating deployment, scaling, and management ... Kubernetes Architecture Diagram ...

Cláudio E. de Oliveira

[email protected]+55 19 3705-5775

Obrigado!