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
Please answer the following questions for yourself before submitting an issue.
I am running the latest version
I checked the documentation and found no answer
I checked to make sure that this issue has not already been filed
I'm reporting the issue to the correct repository
Current Behavior
Trace spans from moleculer don't line up with spans from third-party modules or moleculer spans from remote services (different processes/brokers). For example, the red span in the image below should fully contain the green and purple spans under it.
Expected Behavior
Span times should be as consistent as possible across all modules.
Failure Information
This is caused by clock drift in moleculer's tracing/now.js implementation, which is used to set the startTime of spans. The following code and charts test this behavior and show how much a span could drift compared to Date.now().
Reproduce code snippet
constnow=require("./src/tracing/now");// Output CSV for analysisconsole.log(`"Time elapsed (ms)","Drift (ms)"`);conststartTime=Date.now();console.log(`0,${now()-startTime}`);setInterval(()=>{consttime=Date.now();console.log(`${time-startTime},${now()-time}`);},5e3);
Here are charts from two sample runs:
20 minutes, 25 ms drift
60 minutes, 42 ms max drift
Context
Moleculer version: master
NodeJS version: 12.21.0
Operating System: macOS 10.15.7
The text was updated successfully, but these errors were encountered:
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Current Behavior
Trace spans from moleculer don't line up with spans from third-party modules or moleculer spans from remote services (different processes/brokers). For example, the red span in the image below should fully contain the green and purple spans under it.
Expected Behavior
Span times should be as consistent as possible across all modules.
Failure Information
This is caused by clock drift in moleculer's
tracing/now.js
implementation, which is used to set thestartTime
of spans. The following code and charts test this behavior and show how much a span could drift compared toDate.now()
.Reproduce code snippet
Here are charts from two sample runs:
20 minutes, 25 ms drift
60 minutes, 42 ms max drift
Context
The text was updated successfully, but these errors were encountered: