opentelemetry-collector icon indicating copy to clipboard operation
opentelemetry-collector copied to clipboard

tracer newRecordingSpan memory leak

Open PowerSurj opened this issue 11 months ago • 2 comments
trafficstars

Component(s)

No response

What happened?

Description

Observing memory leak

image

image

Steps to Reproduce

dedicated for tracing otelcol pods are running in k8s k8s applications export traces to otlp grpc endpoint collectors perform probabilistic sampling with equalizing mode and export traces to awsxray

otel configuration provided below

Profiles

cpu, memory and goroutines pprof attached

pprof.otelcol-contrib.samples.cpu.001.pb.gz pprof.otelcol-contrib.goroutine.001.pb.gz pprof.otelcol-contrib.alloc_objects.alloc_space.inuse_objects.inuse_space.001.pb.gz

Collector version

0.114.0

Environment information

AWS EKS 1.30 running collectors as containers

OpenTelemetry Collector configuration

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
exporters:
  awsxray:
    index_all_attributes: true
  debug/detailed:
    sampling_initial: 1
    verbosity: detailed
  debug/normal:
    verbosity: normal
processors:
  batch:
    send_batch_max_size: 10000
    timeout: 1s
  memory_limiter:
    check_interval: 1s
    limit_percentage: 75
    spike_limit_percentage: 15
  probabilistic_sampler:
    mode: equalizing
    sampling_percentage: 1
extensions:
  health_check:
    endpoint: 0.0.0.0:13133
  pprof:
    endpoint: localhost:1777
  zpages:
    endpoint: localhost:55679
service:
  extensions:
    - health_check
    - zpages
    - pprof
  telemetry:
    logs:
      level: info
    metrics:
      address: 0.0.0.0:8888
  pipelines:
    traces/awsxray:
      exporters:
        - debug/detailed
        - awsxray
      processors:
        - memory_limiter
        - probabilistic_sampler
        - batch
      receivers:
        - otlp

Log output

no errors in the logs

PowerSurj avatar Dec 10 '24 04:12 PowerSurj

based on the output of the pprof shown here, this looks closely related to https://github.com/open-telemetry/opentelemetry-collector/issues/10858

codeboten avatar Dec 11 '24 23:12 codeboten

I have reviewed this issue and filed https://github.com/open-telemetry/opentelemetry-go-contrib/issues/6446 to go further and fix it in the OpenTelemetry Go SDK Contrib gRPC library.

atoulme avatar Dec 13 '24 07:12 atoulme

@PowerSurj the opentelemetry-go-contrib project has issued a possible fix for this issue. Please see the issue above for a report of the fix. This fix will eventually be applied to this project when they release and we upgrade to the latest opentelemetry-go-contrib project.

atoulme avatar Jan 31 '25 18:01 atoulme

@atoulme thanks for the heads up, i will be able to confirm the fix once it makes downstream to the otel collector contrib release.

PowerSurj avatar Feb 09 '25 12:02 PowerSurj