Slide 1

Slide 1 text

│©2022 VMware, Inc. Observability of Your Application Jonatan Ivanov Tommy Ludwig Marcin Grzejszczak

Slide 2

Slide 2 text

Spring Observability Team Jonatan Ivanov Tommy Ludwig Marcin Grzejszczak

Slide 3

Slide 3 text

Architecture Tea Service Tealeaf Service DB Water Service DB Eureka Eureka

Slide 4

Slide 4 text

DEMO

Slide 5

Slide 5 text

Summary - We’ve managed to correlate - Logs to Traces (and vice versa) - Traces to Metrics (via common tags) - Metrics to Traces (via exemplars) to Logs - The Spring portfolio is instrumented - WebMVC, WebFlux, etc. instrumentation - Third-party libraries are also instrumented - jdbc-observations - OpenFeign - etc.

Slide 6

Slide 6 text

What’s (kind of) new in Micrometer? 1.9.0 - 2022 May - OTLP Registry (OpenTelemetry) - HighCardinalityTagsDetector - Exemplars (Prometheus)

Slide 7

Slide 7 text

Exemplars (Prometheus) “Metadata” that you can attach to your metrics Updated at measurement time (sampled) They are not tags (high cardinality) Usually traceId and spanId Correlate Metrics to Distributed Tracing and Logs Available for Counter and Histogram buckets

Slide 8

Slide 8 text

What’s new in Micrometer? 1.10.0 - 2022 November - Micrometer Tracing (Sleuth w/o Spring deps.) - Micrometer Docs Generator - Micrometer Context Propagation - Observation API (micrometer-core)

Slide 9

Slide 9 text

You want to instrument your application… - Add logs (application logs) - Add metrics - Increment Counters - Start/Stop Timers - Add Distributed Tracing - Start/Stop Spans - Log Correlation - Context Propagation

Slide 10

Slide 10 text

Observation observation = Observation.start("s1",registry); try (Observation.Scope scope = observation.openScope()) { Thread.sleep(1000); // Business logic } catch (Exception exception) { observation.error(exception); throw exception; } finally { // TODO: attach tags (key-value) observation.stop(); } Observation API (Micrometer 1.10)

Slide 11

Slide 11 text

ObservationRegistry registry = ObservationRegistry.create(); registry.observationConfig() .observationHandler(new MeterHandler(...)) .observationHandler(new TracingHandler(...)) .observationHandler(new LoggingHandler(...)) .observationHandler(new AuditEventHandler(...)); Observation observation = Observation.start("s1",registry); // let the fun begin… observation.stop(); Observation API (Micrometer 1.10)

Slide 12

Slide 12 text

Observation.createNotStarted("talk",registry) .lowCardinalityKeyValue("conference", "S1") .highCardinalityKeyValue("speakerId", speakerId) .observe(this::talk); @Observed Observation API (Micrometer 1.10)

Slide 13

Slide 13 text

│©2022 VMware, Inc. Thank You! github.com/jonatan-ivanov/teahouse