OpenObserve
Every template sends telemetry to OpenObserve when
connected, and nothing at all until then (the SDKs aren’t even loaded).
Everything here is on by default; drop it with --without observability
(nest-api) or --without telemetry (the rest).
| Template | Sends |
|---|---|
| nest-api | Traces (HTTP, GraphQL, Prisma, PostgreSQL, Redis, BullMQ jobs), logs with trace ids, runtime, HTTP and queue metrics |
| node-worker | Job traces, Prisma and Redis spans, logs, metrics |
| py-worker | One trace per job, Redis spans, logs, metrics; with Temporal, a span per workflow and activity |
| react-app, react-monorepo | Page views, errors, slow resources, user actions, the signed-in user id, console errors as logs; traceparent on API calls |
Connect a project
Section titled “Connect a project”-
Create an organization for the project in OpenObserve. Its identifier (in the URL and organization settings) is the
ORGeverywhere below. -
Back ends take the organization’s ingestion token (IAM → Ingestion Tokens,
o2oi_…):OPENOBSERVE_URL=https://<your-openobserve>OPENOBSERVE_ORG=<org>OPENOBSERVE_TOKEN=o2oi_…OTEL_SERVICE_NAME=shop-api # one per service: shop-api, shop-worker, …Each service writes to its own stream, named after
OTEL_SERVICE_NAME(override withOPENOBSERVE_STREAM). -
Front ends take a RUM token instead (Ingestion → RUM). It’s write-only and built to ship in a browser bundle; the ingestion token must never go there.
VITE_OPENOBSERVE_URL=https://<your-openobserve>VITE_OPENOBSERVE_ORG=<org>VITE_OPENOBSERVE_CLIENT_TOKEN=rumo…In images, pass all three as build arguments.
-
Allow every front-end origin on the OpenObserve instance: add them to
ZO_CORS_ALLOWED_ORIGINS(comma-separated), or the browser blocks every RUM request. Includehttp://localhost:3000(and friends) if you send telemetry from development.
How the back ends connect
Section titled “How the back ends connect”In order of precedence:
OTEL_SDK_DISABLED=true: off, whatever else is set.OTEL_EXPORTER_OTLP_ENDPOINTset: the standard OpenTelemetry variables (OTEL_EXPORTER_OTLP_HEADERSand friends) are used as-is, for any OTLP backend.OPENOBSERVE_URL,_ORGand_TOKENall set: OTLP over HTTP to<URL>/api/<ORG>/v1/{traces,logs,metrics}, authenticated as<org>:<token>.- Otherwise: off.
APP_ENV becomes the deployment.environment.name of every span, log and
metric, so one organization can hold development, staging and production
apart.
Linking browser clicks to backend traces
Section titled “Linking browser clicks to backend traces”Front ends add a W3C traceparent header to requests for VITE_APP_API_URL,
so a click, its API request and every span below it share one trace. For that
to work:
- the API’s CORS must allow the
traceparentandtracestateheaders (the templates do); - a trace starts once the RUM SDK has finished initialising: the first request or two of a page load (usually the session check) go out without the header.
Browser details
Section titled “Browser details”- Session replay is off (
sessionReplaySampleRate: 0ininitTelemetry); turn it on per project if you need it. Input is masked either way. reportError()sends handled errors; the error boundary uses it.- The signed-in user’s id (only the id) is attached to the session.
- Readable stack traces from minified bundles need source-map upload, an OpenObserve Enterprise feature.