Search code examples
google-cloud-platformstackdriver

Collecting client side browser metrics with Stackdriver?


I have seen some solutions for capturing client-side errors and reporting them to Stackdriver.

Does anybody know if it's possible to utilize Stackdriver in some way to collect page load timing metrics and report those? I couldn't find any example of how I might be able to do that in the documentation.


Solution

  • I believe a better approach is to send these information to your back end and have it forward them to stackdriver.

    Otherwise, you have to either share credentials to the client to allow them to hit the stackdriver endpoint or open them as public. These are both horrible as someone could start hammering our logging and hide info/increase cost for you.

    If you still want to go the "client logging directly" way, it's simply hitting the monitoring.googleapis.com endpoint with authenticated calls (here the auth is the hard part).