sourcegraph / about

Sourcegraph blog, feature announcements, and website (about.sourcegraph.com)
https://about.sourcegraph.com
90 stars 168 forks source link

Add v2 telemetry infrastructure to about repo #6967

Closed dadlerj closed 1 month ago

dadlerj commented 1 month ago

Thanks for the guidance on this @bobheadxi at https://sourcegraph.slack.com/archives/C05BGNBEPKL/p1716573233789729

This PR adds a new frontend telemetry service at src/telemetry/gqlTelemetryExporter.ts and src/telemetry/index.ts. It also duplicates the existing user and session trackers and cookie helpers, adapted to the new service. It also adds a single hook that records telemetry events on every pageview (again, duplicating what the old v1 telemetry was doing).

Instead of building a pre-rolled TelemetryExporter or TelemetryRecorderProvider, I decided to just do this all in place to start and to determine, based on the level of overlap I see with other marketing-owned subdomains, whether to eventually pull all of that out into a separate package. I suspect I ultimately will.

I will go through the process of updating all event logging/recording sites to use v2 telemetry once this is merged.

netlify[bot] commented 1 month ago

Deploy Preview for sourcegraph ready!

Name Link
Latest commit 08f293880d019c7b405d6c66391d35023f5ad8cc
Latest deploy log https://app.netlify.com/sites/sourcegraph/deploys/6654c837485a280008257f05
Deploy Preview https://deploy-preview-6967--sourcegraph.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

bobheadxi commented 1 month ago

That said, am I the only person who can review this? Do we have other owners of the about site we can pull in?

dadlerj commented 1 month ago

Awesome, thanks @bobheadxi ! Yes, agreed on moving some of this to sourcegraph/telemetry at some point. Especially as we add more sites. I suspect the code for s0, for example, will be 99% identical...

And I've pinged #discuss-marketing for another reviewer