-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend HTTP request node to log detailed timing information #3116
Conversation
Thanks for linking to the previous discussion about this. In that discussion I shared a concern about doing this work:
But there was no further discussion about those concerns - so before we merge this, we need to complete that discussion. Emitting all of these extra metrics for every single request is going to generate a lot of extra metrics messages. Do we have absolute confidence that these metrics are required? Should they be more 'trace' level messages that can be used when debugging an issue? Should there be an option setting to either turn on or off this extra level of message? |
got is using http-timer package to measure the timing of HTTP request. To reproduce the same behaviour on another package, we need to choose a package that can use http-timer package (i.e., one that can get an instance of
Detailed timing information is mostly used for debugging purposes.
|
Commit 490547c adds an option setting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to keep the settings.js file in some sort of structure - would it make sense for this property to be under the existing logging property section ?
In this case, I put this property at the top level as one of the Node Settings since it is a setting for a single node type (just like |
We have no precedent for adding node-specific properties under the logging section. I'm happy to go with this as proposed. Thanks @k-toumura |
As all commits in this PR were made under the JS CLA and we have the green-tick from that bot, we can merge this as-is. |
Proposed changes
The current HTTP request node output the time spent on HTTP requests as a metric log(
node.http request.duration.mills
), but it does not provide a breakdown of the time spent on HTTP request, such as DNS resolution, and TCP connection establishment, which hinders failure analysis.The got package, used in HTTP request node, can obtain these detailed timing information as a result of HTTP requests. This PR use this feature to add a function to output the detailed timing information as a metric log.
An example of metric log is shown below:
Related discussion in PR#2952
Checklist
grunt
to verify the unit tests pass