-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
area:tracePart of OpenTelemetry tracingPart of OpenTelemetry tracingbugSomething isn't workingSomething isn't workingpkg:APIRelated to an API packageRelated to an API package
Milestone
Description
We are using Open Telemetry in a reverse Proxy at scale and seeing memory leak.
func InitTracing(serviceName string, collectorEndpoint string, sample float64) (func(), error) {
tc := propagation.TraceContext{}
// Register the TraceContext propagator globally.
otel.SetTextMapPropagator(tc)
// Create and install Jaeger export pipeline.
return jaeger.InstallNewPipeline(
jaeger.WithCollectorEndpoint(collectorEndpoint),
jaeger.WithProcess(jaeger.Process{
ServiceName: serviceName,
Tags: []label.KeyValue{
label.String("exporter", "jaeger"),
},
}),
jaeger.WithSDK(&sdktrace.Config{DefaultSampler: sdktrace.TraceIDRatioBased(sample)}),
)
}
This is how I am initiating tracer.
if cfg.TracingEnabled {
// Initialize tracing and set global tracer
flush, err := tracing.InitTracing("odnd", cfg.TracingCollectorEndpoint, cfg.TracingSampleValue)
if err != nil {
proxyLogger.Error("Failed to initialize tracing collector", logger.Error(err))
}
if flush != nil {
defer flush()
}
}
This is how it is used to create a global tracer.
tc := otel.GetTextMapPropagator()
ctx := tc.Extract(originalReq.Context(), originalReq.Header)
tracer := otel.Tracer(tracing.TracerName)
tracingCtx, span := tracer.Start(ctx, "serveHTTP", trace.WithSpanKind(trace.SpanKindServer))
originalReq = originalReq.WithContext(tracingCtx)
defer span.End()
That's how we are creating a span and then few more child spans are created. But we are seeing this
It goes up as we add more spans and off course that impacts GC and CPU usage on node. Can someone please have a look and let me know if i am doing something wrong in code or it's related to lib??
Metadata
Metadata
Assignees
Labels
area:tracePart of OpenTelemetry tracingPart of OpenTelemetry tracingbugSomething isn't workingSomething isn't workingpkg:APIRelated to an API packageRelated to an API package
Type
Projects
Status
Closed
