-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Describe the bug
We have the issue with cleaning up the thread context upon certain transport action invocations, the thread context keeps holding the spans from previous invocations, messing up the traces.
To Reproduce
Consider this simple PUT request to create an index:
curl -X PUT -H "Content-Type: application/json" http://localhost:9200/test51 -d '{
"mappings": {
"properties": {
"field": { "type": "date", "format": "epoch_second" }
}
},
"settings": {
"number_of_shards": 2,
"number_of_replicas": 2
}
}'
It generates the following trace:
Now wait just a bit and observe the same trace is growing:
And growing:
The reason for that is that thread context was not cleaned up and the background tasks still picking the last span as the parent, attaching more and more spans to it.
Expected behavior
The thread context must be properly cleaned up.
Plugins
OpenTelementry
Screenshots
If applicable, add screenshots to help explain your problem.
Host/Environment (please complete the following information):
- Any
Additional context
opensearch.experimental.feature.telemetry.enabled: true
telemetry.tracer.sampler.probability: 1.0
telemetry.otel.tracer.span.exporter.class: io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter
telemetry.tracer.enabled: true
telemetry.feature.tracer.enabled: true
CC @Gaganjuneja this is serious one


