You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I register a console exporter and simply execute a call to mongodb when the program starts. I add a setTimeout to wait for some time for the traces to arrive, but they never end up occurring.
However, when running the same code within an HTTP call with Express, the traces are generated perfectly.
Recently I have discovered that mongoDB instrumentation doesn't work when it haven't a parent span, doesn't matter what span type is. I used a manual span to instrument it and suddenly appeared.
That's not limited to mongodb. Most client instrumentations require a parent span. Some instrumentations like ioredis have a config option do change the behavior.
Main idea is that usually a service is triggered via request resulting in some server/consumer span which groups all the client requests. Background activities are quite often not of interest to monitor the service performance and sometimes result in a lot "span noise".
As a result this is not a bug, it was a design decision at instrumentation creation time.
I guess docs could be improved. Also adding a config option would be likely a good enhancement.
Flarna
added
enhancement
New feature or request
and removed
bug
Something isn't working
priority:p2
Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect
labels
Jan 30, 2024
What version of OpenTelemetry are you using?
1.7.0
What version of Node are you using?
20.8.0
What did you do?
I register a console exporter and simply execute a call to mongodb when the program starts. I add a setTimeout to wait for some time for the traces to arrive, but they never end up occurring.
However, when running the same code within an HTTP call with Express, the traces are generated perfectly.
No traces comes to the console.
However executing the mongdb query inside an HTTP handler so many traces appear.
Is this the regular working mode?
The dependencies are:
What did you expect to see?
see the mongodb traces produced
What did you see instead?
Nothing
Additional context
The text was updated successfully, but these errors were encountered: