Skip to content

Latest commit

 

History

History
85 lines (51 loc) · 1.77 KB

README.md

File metadata and controls

85 lines (51 loc) · 1.77 KB

prometheus-exemplar

A random duration response app to test Grafana LGTM stack.

Installation

  • git clone code
git clone [email protected]:grafanafans/prometheus-exemplar.git
cd prometheus-exemplar
  • start app
docker-compose up -d

stop app

docker-compose down

How to test

use wrk to send requests

wrk http://localhost:8080/v1/books
wrk http://localhost:8080/v1/books/1

Then visit http://localhost:3000 page to see demo app dashboard.

All in one with Grafana

Add data sources

add Mimir

Add exemplar configuration:

mimir-exemplar

Notes:

add Tempo

add Loki with Derived fields

  • HTTP URL:http://lb.com/logs
  • Regex:(?:traceID|trace_id|TraceID|TraceId)=(\w+)
  • NOTICE: Regex can be modified according to your own TraceID characters.

Image_20220802143410

Query exemplar metrics

query mimir with tempo

In "Explore" module, when you query metrics by Mimir:

histogram_quantile(0.95, rate(http_durations_histogram_seconds_bucket{}[1m]))

then open the "Exemplars" flag, it shows a green exemplar point, then click "Query with Tempo" to jump to Tempo Explore.

metric+tempo1

query loki with tempo

{app="exemplar-demo"} |= `traceID`  

click "Tempo" to jump to Tempo Explore. log+trace