Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Overriding httpclient - Rhino JS

ven
Bronze 1
Bronze 1

Is there a way to override httpclient in Rhino JS? We want to log start time, end time, total response time and request object for all the JS calls made from Javascript call out. Right now we are adding calls to a custom function inside javascript which captures this information. However, this is  not a reliable solution as developer may forget to make this function call and we should repeat the logic to capture these metrics in every proxy/sharedflow. Wondering if we can either:

1. Override httpclient method in Rhino JS so that these are logged always, just by using the overriden method

OR

Does gcp already log every log that goes out of javascript call out. I did not notice any significant logs that have this information in GCP. 

Looking for your suggestions here.

0 1 221
1 REPLY 1