opentelemetry-go-instrumentation icon indicating copy to clipboard operation
opentelemetry-go-instrumentation copied to clipboard

Kafka topic names are wrong, likely memory re-use issue

Open skandragon opened this issue 8 months ago • 2 comments

Describe the bug

Kafka topic names look mangled, possible buffer / memory re-use issue

We publish on these four topics:

telemetry-stats-metrics
telemetry-stats-logs
telemetry-stats-spans
graph-db-updates

We also consume from the graph-db-updates topic in the same container.

However, we are seeing these topic names in the traces exported via auto-instrumentation:

graph-db-updateslogsics
graph-db-updatesmetrics
graph-db-updateslogs
graph-db-updateslogsics
graph-db-updatesmetrics
telemetry-stats-logsics

From my C coding days, I suspect this is copying into a buffer that already has content, or some other sort of improper re-use of memory. It looks like overall the buffer may start with something and then the end of that name sticks around forever.

Environment

  • OS: Kubernetes (linux)
  • Go Version: 1.23.x and 1.24.x
  • Version: ghcr.io/open-telemetry/opentelemetry-go-instrumentation/autoinstrumentation-go:v0.21.0
  • Using Kafka mod: github.com/segmentio/kafka-go v0.4.47

To Reproduce

I'm not sure how to reproduce this behavior, as I have not nailed down the smallest example that will cause this problem to occur.

Expected behavior

Topic names should match what I am using.

Additional context

None.

skandragon avatar Mar 04 '25 20:03 skandragon