-`isEnabled()` — returns whether the user has consented to telemetry.
-`initialize()` — sets up the OTel SDK and exporters.
-`getTracer(name)` — returns a `Tracer` or `null` when telemetry is disabled.
-`getMeter(name)` — returns a `Meter` or `null` when telemetry is disabled.
-`shutdown()` — flushes and tears down the SDK.
Two implementations exist:
-**`NodeObservabilityService`** (`src/desktop/observability/`): initializes the
OpenTelemetry Node SDK with OTLP exporters for traces and metrics.
-**`NoopObservabilityService`** (`src/common/observability/`): returns `null` for
all tracers and meters. Used in browser/web environments because browser OTel support
is not yet implemented. Full support will be added if needed.
The service is initialized once at extension startup (`src/desktop/extension.ts`)
and shut down on deactivation.
### Circuit breakers
Both `FallibleSpanExporter` and `FallibleMetricExporter` wrap the OTLP exporters
with a `MaxAttemptsCircuitBreaker`. After 3 consecutive export failures, the circuit
opens and further attempts are silently skipped. This prevents indefinite error
logging when the OTLP endpoint is unreachable (for example, when it is blocked by a customer
firewall).
### OTLP endpoint
By default, signals are exported to the GitLab-hosted OTLP collector. The OTLP endpoint is available on the [`editor-extensions` **Observability > Setup** page](https://gitlab.com/groups/gitlab-org/editor-extensions/-/observability/setup).
The endpoint can be overridden via the `gitlab.telemetry.otlpEndpointUrl` VS Code setting,
which is intended for **local testing only** and should not be set in production
environments.
You can find and add dashboards for visualizing the collected signals in the [`editor-extensions` observability dashboards](https://gitlab.com/groups/gitlab-org/editor-extensions/-/observability/dashboard).
### Resource attributes
The SDK is initialized with the following resource attributes, so signals can be
filtered by extension and environment in the Observability UI: