Version: v0.0.0-...-d79950a Latest Latest

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

Go to latest
Published: May 16, 2020 License: GPL-3.0 Imports: 5 Imported by: 0


How to view collected traces


  • Docker (For Jaeger image)
  • Go 1.11+ (For execution traces collected by pprof)

Using Jaeger

Tracing is disabled by default, to enable, you can use the option --enable-tracing. Jaeger endpoint can be configured with the --tracing-endpoint option and defaults to

Run Jaeger:

$ docker run -d --name jaeger   -e COLLECTOR_ZIPKIN_HTTP_PORT=9411   -p 5775:5775/udp   -p 6831:6831/udp   -p 6832:6832/udp   -p 5778:5778   -p 16686:16686   -p 14268:14268   -p 9411:9411   jaegertracing/all-in-one:1.6

This will start the UI at http://localhost:16686

Using the Go tool

Tracing is disabled by default, to enable, you can use the option --enable-tracing. Run the application using the --pprof option to enable pprof (for trace collection).

To collect traces for 5 seconds:

$ curl http://localhost:6060/debug/pprof/trace?seconds=5 -o trace.out

View the trace with:

$ go tool trace trace.out
2018/05/04 10:39:59 Parsing trace...
2018/05/04 10:39:59 Splitting trace...
2018/05/04 10:39:59 Opening browser. Trace viewer is listening on

How to collect additional traces

We use the OpenCensus library to create traces. To trace the execution of a p2p message through the system, we must define spans around the code that handles the message. To correlate the trace with other spans defined for the same message, use the context passed inside the Message struct to create a span:

var msg p2p.Message
var mySpan *trace.Span
msg.Ctx, mySpan = trace.StartSpan(msg.Ctx, "myOperation")

Another example on how to define spans can be found here:



Package tracing sets up jaeger as an opentracing tool for services in Prysm.



This section is empty.


This section is empty.


func Setup

func Setup(serviceName, processName, endpoint string, sampleFraction float64, enable bool) error

Setup creates and initializes a new tracing configuration..


This section is empty.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to