web: integrate OpenTelemetry client observability packages
Created by: valerybugakov
Context
Add basic configuration of the OpenTelemetry tracing to the web application. Based on prior work. Honeycomb guide.
Changes
-
Removed
ENABLE_MONITORING
env variable in favor ofENABLE_SENTRY
andENABLE_OPEN_TELEMETRY
. Required forstandalone-web-server
in the development environment to avoid accidentally sending telemetry data from the local env. -
Integrated
@opentelemetry
packages and moved them into a separate chunk. Added new script tags required for the new initial chunk. -
Enabled @opentelemetry/instrumentation-fetch.
Note: we won't be collecting data until the backend tunnel PR is merged.
Closes https://github.com/sourcegraph/sourcegraph/issues/39273 Closes https://github.com/sourcegraph/sourcegraph/issues/39281
Test plan
- Checkout to https://github.com/sourcegraph/sourcegraph/pull/39453
- Set
dev-private
site config to useopentelemetry
- Set
observability.client
in the site config. sg start otel
sg start
- Open a web page with API requests.
- See traces logged to Jaeger.