Closed thedodd closed 1 year ago
Thanks for the bug report. The error messages you saw indicate the span is dropped when ended because of the exporter backpressure. We use a bounded channel to send span to span processor so the OOM is not likely to come from there.
I am thinking it may be something inside jaeger exporter. I can dig deeper and see if the OOM can cause by jaeger exporters.
The first step I had in mind is to try to locate the memory leak to a component. Over the weekend I tested some examples with only opentelemetry based on the descriptions above with Valgrind and it didn't report any memory leak. So I feel like I missed something in my setup. The next step is probably to include tracing-opentelemetry
and see if it causes a memory leak.
Curious when you say "collector client can not connect", do you mean the backend latency increased to a crazy high or the client just will encounter something like connection refused
?
Basically just connection refused. In these cases, it is typically due to the collector pods in kubernetes being rescheduled or the like.
As it turns out, it appears as though the issue was closely related to what is described here: https://fly.io/blog/rust-memory-leak/
Thanks for taking a look, looks like it was a mistake on my end.
Over the course of some time, perhaps due to collector maintenance or other circumstances, the OTEL tracing mechanism seems to run into an issue where it goes into a VERY hot loop, spams the following error message to stdout/stderr (
OpenTelemetry trace error occurred. cannot send span to the batch span processor because the channel is full
), and then eventually causes the app to be OOM killed due to excess memory usage.Deps
Initialization
Env
All usage of tracing throughout the app is via function instrumentation:
#[tracing::instrument(...)]
and various calls totracing::debug!/info!/warn!/error!
&c.