tom-pytel opened a new pull request #52:
URL: https://github.com/apache/skywalking-nodejs/pull/52


   I don't think I've seen this mechanism in the other agents but I was asked 
to implement this. A cold start is when an instance is spun up to serve an 
request, for this reason the response time of the endpoint includes the spinup 
time of the instance, which is not ideal. This PR detects this condition and 
marks spans to which it applies.
   
   Cold start detection is as follows: First span to run within 1 second of 
skywalking init is considered a cold start. This span gets the tag 'coldStart' 
set to 'true'. This span also optionally gets the text '<cold>' appended to the 
endpoint name if env var SW_COLD_ENDPOINT is set to 'true' or config option 
'coldEndpoint', the default is off (normal endpoint names). A dummy span 
running first due to ignore is considered a valid first run and eats the cold 
start.
   
   The metrics of the endpoint was cold-started do not change (much) so this 
tag is not for the endpoint itself but for analysis of spans upstream which 
will be significantly slower due to the cold start. The visual part via 
'coldEndpoint' is more for quick visual analysis in the trace view.
   
   The target environment for this was Azure Functions which we are working on 
now but the mechanism is general so it should apply in any environment where 
instances are spun up on demand. Performance-wise it is just a flag check so 
impact should be non-existant.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to