Slide 1

Slide 1 text

Björn “Beorn” Rabenstein GoDays, Berlin – 2020-01-23 How to instrument Go code in 2020

Slide 2

Slide 2 text

| 2

Slide 3

Slide 3 text

https://peter.bourgon.org/go-best-practices-2016/ | 3

Slide 4

Slide 4 text

https://peter.bourgon.org/go-best-practices-2016/ | 4

Slide 5

Slide 5 text

https://peter.bourgon.org/go-best-practices-2016/ | 5

Slide 6

Slide 6 text

| 6

Slide 7

Slide 7 text

| 7

Slide 8

Slide 8 text

| 8

Slide 9

Slide 9 text

| 9

Slide 10

Slide 10 text

| 10

Slide 11

Slide 11 text

| 11 What Go “built in” “Modern” needs Example Debugging Profiling/Tracing runtime/pprof runtime/trace Logging log Metrics expvar

Slide 12

Slide 12 text

| 12 What Go “built in” “Modern” needs Example Debugging Almost useless… You’ll find one if you really need it. Profiling/Tracing runtime/pprof runtime/trace Distributed tracing opentracing/ opentracing-go Logging log Structured logging go-kit/log Metrics expvar Labeled metrics prometheus/ client_golang

Slide 13

Slide 13 text

| 13 What Go “built in” “Modern” needs Example Debugging Almost useless… You’ll find one if you really need it. Profiling/Tracing runtime/pprof runtime/trace Distributed tracing opentracing/ opentracing-go Logging log Structured logging go-kit/log Metrics expvar Labeled metrics prometheus/ client_golang

Slide 14

Slide 14 text

| 14 https://speakerdeck.com/chimeracoder/building-resilient-services-in-go

Slide 15

Slide 15 text

| 15

Slide 16

Slide 16 text

| 16 Unified instrumentation for metrics, logging, and distributed tracing

Slide 17

Slide 17 text

| 17 https://xkcd.com/927/ One way of doing it

Slide 18

Slide 18 text

| 18 Go!!! Python Java Javascript C# PHP C/C++ … For ALL the languages

Slide 19

Slide 19 text

A rich and universal data model | 19 Metrics are labeled. Logs are structured. OpenTracing.

Slide 20

Slide 20 text

For ALL data collection models | 20 Push vs pull. On prem vs. cloud. Distributed vs. replicated. Location of sampling, aggregation, buffering. Exposition formats. Transport protocols.

Slide 21

Slide 21 text

| 21 https://opentelemetry.io/

Slide 22

Slide 22 text

| 22 https://opentelemetry.io/about/

Slide 23

Slide 23 text

| 23 https://github.com/open-telemetry/opentelemetry-collector

Slide 24

Slide 24 text

| 24

Slide 25

Slide 25 text

| 25 How will I instrument my Go code in 2020? Now what?

Slide 26

Slide 26 text

| 26 Bet on OpenTelemetry as the winner for tracing. Step 1:

Slide 27

Slide 27 text

| 27 Relax! Logs and metrics are the easy part anyway. And not everything is a trace. Step 2:

Slide 28

Slide 28 text

| 28 As always: Take your context into account. (Service mesh? Microservice kit?) Step 3:

Slide 29

Slide 29 text

https://github.com/beorn7/talks beorn@grafana.com