otelpyroscope

package module
v0.0.0-...-a66d95c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

README

OpenTelemetry tracing integration

The package provides means to integrate tracing with profiling. More specifically, a TracerProvider implementation, that annotates profiling data with span IDs: when a new trace span emerges, the tracer adds a span_id pprof tag that points to the span. This makes it possible to filter out a profile of a particular trace span in Pyroscope.

Note that the module does not control pprof profiler itself – it still needs to be started for profiles to be collected. This can be done either via runtime/pprof package, or using the Pyroscope client.

By default, only the root span gets labeled (the first span created locally): such spans are marked with the pyroscope.profile.id attribute set to the 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).

Limitations:

  • Only CPU profiling is fully supported at the moment.

Example

You can find a complete example setup in the Pyroscope repository.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTracerProvider

func NewTracerProvider(tp trace.TracerProvider, options ...Option) trace.TracerProvider

NewTracerProvider creates a new tracer provider that annotates pprof samples with span_id label. This allows to establish a relationship between pprof profiles and reported tracing spans.

Types

type Option

type Option func(*tracerProvider)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL