Send to OpenTelemetry
Record editor metrics and traces through your own OpenTelemetry SDK, for Grafana, Datadog, Honeycomb, or any OTLP backend.
@docx-editor.dev/telemetry is available in version 2.29.0 and later.Register the exporter
Add otelExporter() to the client, then register telemetry.module as Set up an editor shows:
import { createTelemetry } from '@docx-editor.dev/telemetry';
import { otelExporter } from '@docx-editor.dev/telemetry/otel';
export const telemetry = createTelemetry({ exporters: [otelExporter()] });Connect your SDK
Your app supplies the OpenTelemetry SDK. You can create the exporter before the SDK starts. Measurements reach the SDK after it registers.
| Option | Default |
|---|---|
meterProvider | The global provider, read at each use |
tracerProvider | The global provider, read at each use |
parentContext | None: each span it starts is a root span |
scope | @docx-editor.dev/telemetry |
The telemetry resource option adds attributes to events, not metrics. Set service.name on your SDK to populate the Prometheus job label.
Interpret spans and metrics
| Signal | Behavior |
|---|---|
| Document open and save | A docx_editor.document.open or docx_editor.document.save span, with error status when the operation is rejected. |
| Other events | Added to the active span. With no active span, each failure creates a short span. |
| Histograms | Bucket bounds match the bands in Metrics. OTLP receivers add unit suffixes, so Prometheus names match that reference. |
Limits
- In development, the exporter warns once if no SDK is registered.
- Some SDK instrumentations add the user agent or page URL. See Privacy review checklist.