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/core

Create 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.

DestinationEntry pointPeer 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/prometheusNone
Sentry issues and breadcrumbs@docx-editor.dev/telemetry/sentryYour app's Sentry SDK
Log service over HTTP (Better Stack, Axiom, Datadog Logs)@docx-editor.dev/telemetry and @docx-editor.dev/telemetry/ingestNone
Your own function (Datadog RUM, PostHog, a logger)@docx-editor.dev/telemetryNone
Room telemetry for any Yjs server@docx-editor.dev/telemetry/serveryjs, @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

TaskGuide
Register telemetry in React or VueSet up an editor
Report from server agentsServer agents
Measure collaboration serversCollaboration servers
Review what is sentPrivacy

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, and metricLabels.
  • The package does not control what your Sentry or OpenTelemetry SDK collects. For checks, see Privacy review checklist.

See also