web: add `opentelemetry` `ClientAttributesSpanProcessor`
Created by: valerybugakov
Context
This PR adds a simple span processor that adds attributes useful for every span created by the client application.
export enum ClientAttributes {
LocationHref = 'window.location.href',
LocationPathname = 'window.location.pathname',
LocationSearch = 'window.location.search',
AppVersion = 'app.version',
BrowserName = 'browser.name',
}
Closes https://github.com/sourcegraph/sourcegraph/issues/40562
Test plan
ENABLE_OPEN_TELEMETRY=true sg start web-standalone
- Load the page.
- See span attributes in the console.
App preview:
Check out the client app preview documentation to learn more.