sourcegraph / sourcegraph-public-snapshot

Code AI platform with Code Search & Cody
https://sourcegraph.com
Other
10.12k stars 1.29k forks source link

Cody gateway: Add reliable enterprise actor ID logging to Cody gateway events #61987

Open dadlerj opened 7 months ago

dadlerj commented 7 months ago

Cody gateway provides anonymous logging of requests to BigQuery. One of the metadata fields in that payload is X-Sourcegraph-Actor-UID, but we have seen that it's not always populated (per this comment) and have heard that the method of population is not always reliable (per this comment).

While each request from users connected to dotcom already populates the dotcom user ID in the Identifier metadata field, we don't have reliable user-level metrics for enterprise instances. It would be great to have a unique, anonymous identifier for individual users on ent instances. Basically—can we get the actor ID to populate reliably (whatever that means)?

dadlerj commented 7 months ago

See this thread for an example of where this would prove valuable: being able to determine LLM cost per user per month by Pro vs. Free vs. Enterprise more accurately.