1 of 56

Building scalable OSS observability on AWS with Mimir, Loki, Tempo, and Pyroscope

TRACK 01 - SESSION 02

Suraj Nath

Sr. Software Engineer, Grafana Labs

All about LGTM Stack

2 of 56

👋�“Hello world”

3 of 56

4 of 56

It’s a log line

We all started our programming journey with a log line…

5 of 56

6 of 56

Logging is the Hammer

Very versatile tool, you can get things done if you know how to use your hammer…

7 of 56

hammer will get it done but sometimes a screwdriver or nail gun works better…

It’s one tool, In our toolbox…

8 of 56

The observability toolbox

Traces

Metrics

Logs

Profiles

9 of 56

Utilizing the full Observability toolkit

How do I:

Find a needle in a haystack with log queries?

How do I:

Find where latency and errors originate across many services with traces?

How do I:

Find anomalies in metrics trends?

How do I:

Find root causes of issues at the code level with profiling

10 of 56

Utilizing the full Observability toolkit

How do I:

Find a needle in a haystack with log queries?

How do I:

Find where latency and errors originate across many services with traces?

How do I:

Find anomalies in metrics trends?

How do I:

Find root causes of issues at the code level with profiling

11 of 56

Observability challenges to tackle

How do I:

Find a needle in a haystack with log queries?

How do I:

Find where latency and errors originate across many services with traces?

How do I:

Find anomalies in metrics trends?

How do I:

Find root causes of issues at the code level

12 of 56

Open source time series database

High availability

Horizontal scalability

Native multi-tenancy

Durable storage

Fast query performance

Production-proven dashboards,�alerts, and runbooks

Prometheus and OpenTelemetry* metrics compatible

13 of 56

14 of 56

Observability challenges to tackle

How do I:

Find a needle in a haystack with log queries?

How do I:

Find where latency and errors originate across many services with traces?

How do I:

Find anomalies in metrics trends?

How do I:

Find root causes of issues at the code level

15 of 56

Loki

16 of 56

17 of 56

18 of 56

Announced!

0.0

2018

LogQL v2

2.0

2020

2021

2022

New TSDB index

Line-based deletes

Scale scale scale…

Custom retention

Write ahead log

Out-of-order support

Production ready

1.0

2019

19 of 56

The Grafana Loki team trying desperately to finish Loki 3.0 �(a giant electromechanical Norse god Loki). �Photorealistic digital art

20 of 56

How do I:

Find a needle in a haystack with log queries?

How do I:

Find where latency and errors originate across many services with traces?

How do I:

Find anomalies in metrics trends?

How do I:

Find root causes of issues at the code level

Observability challenges to tackle

21 of 56

22 of 56

23 of 56

24 of 56

{ resource.service = "A" } > { resource.service = "B" }

What traces go first through service A

through service B?

then

{ resource.service = "A" } >> { status = error } | select(resource.service)

What traces go first through service A

have errors?

then

Show me the services where those errors occur

25 of 56

{resource.service = "server" && span.target = "/account"} >> { status = error }

26 of 56

Observability challenges to tackle

How do I:

Find a needle in a haystack with log queries?

How do I:

Find where latency and errors originate across many services with traces?

How do I:

Find anomalies in metrics trends?

How do I:

Find root causes of issues at the code level

27 of 56

Grafana Pyroscope

28 of 56

Profiling

Profiling is the analysis of code execution by collecting stack traces samples, and a set of function calls that lead to resource consumption.

29 of 56

Stacktrace samples

Resource usage

Call stacks

30 of 56

Reading a flame graph

Execution path that leads to a function

github.com/grafana/loki/logql/syntax.ParseMatchers

Inner function calls made

31 of 56

Continuous profiling

Profiling applications continuously solves the problem of collecting a profile at the right time.

By collecting profiles all the time (continuously) and saving them in a database.

32 of 56

Resource usage over time

Query

From profiling to continuous profiling

33 of 56

Scalable, multi-tenant, and cloud native

Helm, Kubernetes service discovery.

Cloud native

Scalable and efficient

Horizontally scalable, object storage, and multi-tenant

Integrated

Built in the same spirit as Mimir, Loki, and Tempo and integrated with Grafana

34 of 56

Language support

35 of 56

Easy to get started

36 of 56

Silos are “okay” at start…

but connected tools are better

Error logs pinpoint user issue

Traces

Metrics

Logs

Unexpected cpu spike

Profiles

Anomalous span reveals error cluster

Code level root cause

37 of 56

Metrics/Logs: CPU spike and OOM root cause with profiling

38 of 56

Metrics/Tracing: CPU spike/latency root cause with profiling

39 of 56

Tracing: Span latency root cause with profiling

40 of 56

From metrics to traces

41 of 56

From metrics to traces

42 of 56

From logs to traces

43 of 56

From logs to traces

44 of 56

...and from traces to logs

45 of 56

Utilizing the full Observability toolkit

How do I:

Find a needle in a haystack with log queries?

How do I:

Find where latency and errors originate across many services with traces?

How do I:

Find anomalies in metrics trends?

How do I:

Find root causes of issues at the code level with profiling

46 of 56

Intro to mltp demo (sorry, no live demo today)

Scan for demo repo

47 of 56

48 of 56

49 of 56

50 of 56

51 of 56

Grafana + AWS

52 of 56

Grafana + AWS

53 of 56

Grafana + AWS

54 of 56

Grafana + AWS

55 of 56

That’s all folks 👋

Questions?

56 of 56

Slides: https://suraj.dev/talks