guac icon indicating copy to clipboard operation
guac copied to clipboard

Set user agent for collector calls to "GUAC"

Open lumjjb opened this issue 2 years ago • 6 comments

It will be useful for debugging and also to determine if services are being clobbered to attribute to our collectors.

This can probably be implemented by setting the "User Agent" request header for requests with a user agent of "GUAC-collector vX-hash" or something.

This should cover, all collectors that connect to services (oci, deps.dev, osv.dev, github, etc.)...

The priority should be on:

  • [x] deps.dev
  • [x] osv.dev
  • [x] oci
  • [x] gcs
  • [x] github
  • [ ] git

(in that order, since they are most likely to be hit more)

lumjjb avatar Apr 21 '23 19:04 lumjjb

As an additional item, it's helpful for debugging to encode the version into the string.

jchestershopify avatar Apr 21 '23 20:04 jchestershopify

updated comment to include verison and maybe commit hash

lumjjb avatar Apr 21 '23 20:04 lumjjb

Am I understanding this correctly that we want the HTTP requests, originating from various collectors or even certifiers, to the GUAC graphql server (API) with User-Agent header set?

And the goal is to enable the ability to get stats on the graphql server to understand usage patterns, volume, help t-shooting...etc.?

sunnyyip avatar Apr 27 '23 15:04 sunnyyip

Updated top comment with status after #781 has now merged.

https://github.com/google/osv-scanner/pull/357 was just merged, so that one can be done next.

I didn't see an easy way to set it for the plain git collector, need to look a little deeper there.

jeffmendoza avatar May 01 '23 21:05 jeffmendoza

Osv.dev now done, checklist in top comment updated. We can probably remove the priority label and v0.1 milestone, and keep this around in case we want to address plain git in the future.

jeffmendoza avatar May 04 '23 17:05 jeffmendoza

Will look at #781 to understand the changes that need to be implemented for git.

arorasoham9 avatar Jun 08 '23 21:06 arorasoham9