clux / tempo-otel-example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tempo-otel-example

This example shows a mixture of OpenTelemetry and Prometheus instrumentation in Go.

It includes trace discovery through Logs and Exemplars.

Steps

  1. Install Loki Docker Driver

docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions

  1. Build the application.

./build.sh

  1. Start everything up.

docker-compose up -d

  1. Exercise the application.

curl http://localhost:8000/

  1. (Optional) See OpenMetrics Exemplars.

curl -H 'Accept: application/openmetrics-text' http://localhost:8000/metrics | less

  1. Discover Traces

From Exemplars:

  • Navigate to http://localhost:3000/explore
  • Go to the explore page
  • Choose the Prometheus datasource and execute histogram_quantile(.99, sum(rate(demo_request_latency_seconds_bucket[1m])) by (le))

Exemplars

From Logs:

  • Choose the Loki datasource and execute {container_name="tempo-otel-example_tracing-example_1"} | logfmt | latency > 1s

Loki Derived Fields

About


Languages

Language:Go 92.3%Language:Shell 4.9%Language:Dockerfile 2.8%