Skip to content

Latest commit

 

History

History

golang-push

Span profiles with Traces to profiles for Go

This example consists of:

  • The Go Rideshare App
  • Tempo
  • Pyroscope
  • Grafana

The rideshare app generate traces and profiling data that then can be analysed in Grafana. The datasources for Pyroscope and Tempo are provisioned automatically.

Usage

The project can be run locally with the following commands:

# Pull latest pyroscope and grafana images:
docker pull grafana/pyroscope:latest
docker pull grafana/grafana:latest

docker compose up

Using the Explore Profiles app, you can inspect the profiles for different request types:

Explore Profiles screenshot

Navigate to the Explore Tempo page, select a trace and click on a span that has a linked profile:

image

By default, only the root span gets labeled (the first span created locally): such spans are marked with the link icon and have pyroscope.profile.id attribute set to the corresponding span ID. Please note that presence of the attribute does not necessarily indicate that the span has a profile: stack trace samples might not be collected, if the utilized CPU time is less than the sample interval (10ms).

Instrumentation

  • rideshare demo application instrumented with OpenTelemetry: OTel integration . Please refer to our documentation for more details.
  • pyroscope itself is instrumented with opentracing-go SDK and spanprofiler for profiling integration.

Grafana Tempo configuration

Please refer to our documentation for more details.