Skip to content

Commit

Permalink
[hotrod] Reduce span exporter's batch timeout to let the spans be exp…
Browse files Browse the repository at this point in the history
…orted sooner (#4518)

In HotROD appbatching is not required it should export traces asap so
BatchTimeOut value can be lowered from 5sec solves the issue
Resolves jaegertracing/jaeger-ui#1180

Signed-off-by: GLVS Kiriti <[email protected]>
  • Loading branch information
GLVSKiriti authored Jun 8, 2023
1 parent c582d89 commit 557bb1c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/hotrod/pkg/tracing/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"os"
"strings"
"sync"
"time"

"github.com/opentracing/opentracing-go"
"go.opentelemetry.io/otel"
Expand Down Expand Up @@ -62,7 +63,7 @@ func Init(serviceName string, exporterType string, metricsFactory metrics.Factor
rpcmetricsObserver := rpcmetrics.NewObserver(metricsFactory, rpcmetrics.DefaultNameNormalizer)

tp := sdktrace.NewTracerProvider(
sdktrace.WithBatcher(exp),
sdktrace.WithBatcher(exp, sdktrace.WithBatchTimeout(1000*time.Millisecond)),
sdktrace.WithSpanProcessor(rpcmetricsObserver),
sdktrace.WithResource(resource.NewWithAttributes(
semconv.SchemaURL,
Expand Down

0 comments on commit 557bb1c

Please sign in to comment.