Skip to content

web: add `opentelemetry` `ClientAttributesSpanProcessor`

Administrator requested to merge vb/client-attributes-span-processor into main

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

  1. ENABLE_OPEN_TELEMETRY=true sg start web-standalone
  2. Load the page.
  3. See span attributes in the console.

App preview:

Check out the client app preview documentation to learn more.

Merge request reports

Loading