Telemetry
Send anonymous diagnostics and metrics from editors and collaboration servers to OpenTelemetry, Prometheus, Sentry, or your own logger.
@docx-editor.dev/telemetry is available in version 2.29.0 and later.@docx-editor.dev/telemetry sends anonymous diagnostics and metrics from editors, collaboration clients, and collaboration servers to your monitoring tools.
Install telemetry
Install the package and the engine:
npm install @docx-editor.dev/telemetry @docx-editor.dev/coreCreate one client and register its module in the editor:
import { createTelemetry, consoleExporter } from '@docx-editor.dev/telemetry';
export const telemetry = createTelemetry({ exporters: [consoleExporter()] });
// Pass telemetry.module in the editor's modules list.Editor apps also need @docx-editor.dev/react or @docx-editor.dev/vue. For registration, consent, and areas, see Set up an editor.
Choose an exporter
Exporters decide where data goes. The package sends nothing without one.
| Destination | Entry point | Peer dependency |
|---|---|---|
| OpenTelemetry (OTLP backends such as Datadog, Grafana, Honeycomb, New Relic) | @docx-editor.dev/telemetry/otel | @opentelemetry/api |
| Prometheus scrape endpoint | @docx-editor.dev/telemetry/prometheus | None |
| Sentry issues and breadcrumbs | @docx-editor.dev/telemetry/sentry | Your app's Sentry SDK |
| Log service over HTTP (Better Stack, Axiom, Datadog Logs) | @docx-editor.dev/telemetry and @docx-editor.dev/telemetry/ingest | None |
| Your own function (Datadog RUM, PostHog, a logger) | @docx-editor.dev/telemetry | None |
| Room telemetry for any Yjs server | @docx-editor.dev/telemetry/server | yjs, @docx-editor.dev/pro |
| Room telemetry for Hocuspocus | @docx-editor.dev/telemetry/hocuspocus | @hocuspocus/server 4.6 or later |
Metrics use the OpenTelemetry model. Prometheus names replace dots with underscores and add units: docx_editor.collab.room.load.duration becomes docx_editor_collab_room_load_duration_seconds. Add @docx-editor.dev/pro for review and collaboration.
Choose a setup guide
| Task | Guide |
|---|---|
| Register telemetry in React or Vue | Set up an editor |
| Report from server agents | Server agents |
| Measure collaboration servers | Collaboration servers |
| Review what is sent | Privacy |
Limits
- Built-in diagnostics hold codes, booleans, bucketed sizes and counts, and timings. They exclude document text, file names, part names, author names, font names, room names, and exception messages.
- You control identifiers you add in
attributes,resource, andmetricLabels. - The package does not control what your Sentry or OpenTelemetry SDK collects. For checks, see Privacy review checklist.