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
We've rolled out our use in production! With that, we've noticed that there are duplicate trace ids and trace parent id combinations. Our logs show that this is happening with incoming requests that do not have a traceparent header and they are on separate hosts. Our current configuration creates launches 20 hosts with 36 workers all around the same time. This is happening for .003 % of requests over a 4 hour period, but still concerning.
I suspect the math.randomseed seed is not sufficiently random to prevent the same seed from being used in different hosts.
Returns the elapsed seconds from the epoch for the current time stamp from the Nginx cached time (no syscall involved unlike Lua's date library).
The PID across our hosts will be fairly similar values as they all launch from the same state.
Launching multiple hosts with x many workers creates a x many second window where the random generator can be seeded the same between host. In my case with 36 workers per host, there's a 36 second window
Some improvements/fixes that would help with this issue:
Use higher resolution timestamp e.g. ngx.now (Something with nano seconds?)
Leverage host level random generator as the seed
Expose ability to set math.randomseed for utility module
The text was updated successfully, but these errors were encountered:
We've rolled out our use in production! With that, we've noticed that there are duplicate trace ids and trace parent id combinations. Our logs show that this is happening with incoming requests that do not have a traceparent header and they are on separate hosts. Our current configuration creates launches 20 hosts with 36 workers all around the same time. This is happening for .003 % of requests over a 4 hour period, but still concerning.
I suspect the
math.randomseed
seed is not sufficiently random to prevent the same seed from being used in different hosts.opentelemetry-lua/lib/opentelemetry/util.lua
Line 4 in f72ebd3
Problems I see with using
ngx.time() + ngx.worker.pid()
:Some improvements/fixes that would help with this issue:
The text was updated successfully, but these errors were encountered: