-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat: add url to retrying log #55
Conversation
@@ -166,7 +166,7 @@ module.exports = async function (url, options) { | |||
return resolve(response); | |||
} | |||
|
|||
console.error(`Retrying in ${retryOptions.retryInitialDelay} milliseconds, attempt ${attempt - 1} failed (status ${response.status}): ${response.statusText}`); | |||
console.error(`Retrying ${url} in ${retryOptions.retryInitialDelay} milliseconds, attempt ${attempt - 1} failed (status ${response.status}): ${response.statusText}`); |
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.
We actually avoid logging the raw url since it could contain sensitive information. Please redact the sensitive information from the url like this: https://github.com/adobe/asset-compute-commons#examples-2
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.
@jdelbick is there any other way, where we can pass a flag and enable logging or debugging urls?
And let user decide if they want to log or nt
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.
Yes, I would suggest using an environment variable (defaulting to not logging the url).
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.
+1
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.
We do not log URLs on purpose, as they may leak information (eg. in the case of presigned/SAS URLs).
The suggestion here would be to use and environment variable to change the behavior, no-llogging being the default behavior. Logging URLs must be an explicit action.
See #77. With a custom logging option this problem should be solved. |
Note that Also it logs the FetchErrors (e.g. here) which sometimes contain URL as well:
With a custom logging option (#77) in place, there are two options:
But for convenience there could also be a third option:
|
Created #83 |
Log url while retrying.
This will help application to trace which all apis require retry.
Helps in debugging and improving api performance