Slide 1

Slide 1 text

Microservices Observability

Slide 2

Slide 2 text

About us I am Tiago Angelo Software Engineer at Sensedia Working mostly with: - Java - RESTful APIs - Microservices - Container applications in production @kurtisangelo on Twitter /angelokurtis on GitHub 2

Slide 3

Slide 3 text

whoami! I am Claudio de Oliveira Book Author, Software Architect and Developer @sensedia Spring and Docker enthusiast @claudioed on Twitter /claudioed on Github 3

Slide 4

Slide 4 text

4

Slide 5

Slide 5 text

5 Agenda › Microservices drawbacks › Distributed tracing systems › Spring Cloud Sleuth › Metrics for distributed systems › Kubernetes and Istio

Slide 6

Slide 6 text

6 Glossary › Telemetry How to collect data that will provide observability (sensors) › Observability Monitoring, Alerting and Visualizations, Distributed Tracing and Log Aggregation.

Slide 7

Slide 7 text

MICROSERVICES DRAWBACKS Not all roses 7

Slide 8

Slide 8 text

Fallacies of distributed computing › the network is reliable › latency is zero › bandwidth is infinite 8

Slide 9

Slide 9 text

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 9

Slide 10

Slide 10 text

your system doesn't look like this: 10 service1 service2 service4 service3 frontend DB

Slide 11

Slide 11 text

...it looks more like this: 11 frontend ... Service1 10.0.0.11 service1 10.0.0.34 Service1 10.0.0.36 Service1 10.0.0.23 service1 10.0.0.4 service2 10.0.0.40 Service2 10.0.0.25 Service3 10.0.0.1 service3 10.0.0.17 Service3 10.0.0.7

Slide 12

Slide 12 text

12

Slide 13

Slide 13 text

Network Latency Problems › Which microservice was responsible? › How to find out where the defect is? › How know what is generally happening during a request? 13

Slide 14

Slide 14 text

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 14

Slide 15

Slide 15 text

In the Java World 15 › the distributed tracing systems needs trace and span unique IDs › Tracers are responsible to add that logic to your application › Spring Cloud Sleuth for Java-based Spring applications

Slide 16

Slide 16 text

SPRING CLOUD SLEUTH Services interactions instrumented automatically 16

Slide 17

Slide 17 text

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 17

Slide 18

Slide 18 text

Your log will be like this: 18 Trace id Span id Application name

Slide 19

Slide 19 text

19 Stop talking and show me the code!

Slide 20

Slide 20 text

20

Slide 21

Slide 21 text

21 intro

Slide 22

Slide 22 text

Let’s think a little bit differently... 22 intro

Slide 23

Slide 23 text

Key points for kubernetes › Kubernetes was designed to orchestrate containers and run container across multiple machines Yaml files for deployments and other stuffs 23 intro

Slide 24

Slide 24 text

Pretty Standard Kubernetes yamls 24 intro

Slide 25

Slide 25 text

What about the platform infrastructure for service communications ??? 25 YES!!! intro

Slide 26

Slide 26 text

And... no code changes at all !!!! 26 intro

Slide 27

Slide 27 text

27 intro

Slide 28

Slide 28 text

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

Slide 29

Slide 29 text

Sidecar Pattern 29

Slide 30

Slide 30 text

Sidecar Pattern A service which can enrich the main service with utility tasks. Normally these tasks are cross-cutting and infrastructure related. 30 sidecar-pattern

Slide 31

Slide 31 text

31 sidecar-pattern

Slide 32

Slide 32 text

› Proxying to remote services › Monitoring › Configuring › Telemetry Main Features 32 sidecar-pattern

Slide 33

Slide 33 text

A service mesh is a configurable infrastructure layer for a microservices application. Service Mesh 33 service-mesh

Slide 34

Slide 34 text

34 We choose... ISTIO service-mesh

Slide 35

Slide 35 text

Goal › Service Mesh was designed to be that would handle the service communications 35 service-mesh

Slide 36

Slide 36 text

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 36

Slide 37

Slide 37 text

37 Istio Advantages › Sidecar Proxy › Service Discovery & Load Balancing › Circuit Breaking › Fault Injection › Polyglot (golang, nodejs) it run as a sidecar › Can be used in legacy systems

Slide 38

Slide 38 text

38 Istio Deployment

Slide 39

Slide 39 text

39 istio

Slide 40

Slide 40 text

PILOT Component that programs the Envoy proxies, responsible for service discovery, load balancing, and routing. 40 istio

Slide 41

Slide 41 text

41 MIXER Component responsible for enforcing access control and usage policies across the service mesh and collecting telemetry data from Envoy and other services istio

Slide 42

Slide 42 text

42 ISTIO ADD-ONs Open-Source components which will work together to provide some functionalities istio

Slide 43

Slide 43 text

43 Prometheus Monitoring and Alerting systems toolkit designed to help these tasks for distributed systems. METRICS please, not logging and tracing istio-add-ons

Slide 44

Slide 44 text

Monitoring and troubleshooting microservices-based distributed systems 44 Jaeger istio-add-ons

Slide 45

Slide 45 text

Platform for beautiful analytics and monitoring 45 Grafana istio-add-ons

Slide 46

Slide 46 text

46

Slide 47

Slide 47 text

47

Slide 48

Slide 48 text

48

Slide 49

Slide 49 text

49

Slide 50

Slide 50 text

THANKS! Any questions? You can find us at: @claudioed · [email protected] @kurtisangelo · [email protected] 50