1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-11-23 22:34:47 +02:00

add RegisterSimpleSpanProcessor() modeled on stackdriver code (#213)

* add RegisterSimpleSpanProcessor() modeled on stackdriver code

* update examples
This commit is contained in:
Liz Fong-Jones
2019-10-16 18:13:39 -04:00
committed by rghetia
parent 9f03360a84
commit 75562dd381
5 changed files with 25 additions and 12 deletions

View File

@@ -43,10 +43,7 @@ func initTracer() {
if err != nil {
log.Fatal(err)
}
// Wrap stdout exporter with SimpleSpanProcessor and register the processor.
ssp := sdktrace.NewSimpleSpanProcessor(exporter)
sdktrace.RegisterSpanProcessor(ssp)
exporter.RegisterSimpleSpanProcessor()
// For the demonstration, use sdktrace.AlwaysSample sampler to sample all traces.
// In a production application, use sdktrace.ProbabilitySampler with a desired probability.

View File

@@ -35,10 +35,7 @@ func initTracer() {
if err != nil {
log.Fatal(err)
}
// Wrap stdout exporter with SimpleSpanProcessor and register the processor.
ssp := sdktrace.NewSimpleSpanProcessor(exporter)
sdktrace.RegisterSpanProcessor(ssp)
exporter.RegisterSimpleSpanProcessor()
// For the demonstration, use sdktrace.AlwaysSample sampler to sample all traces.
// In a production application, use sdktrace.ProbabilitySampler with a desired probability.