Skip to content

docs(rivetkit): add actor tracing docs - #5734

Open
eersnington wants to merge 1 commit into
stack/feat-rivetkit-forward-otel-sdk-warnings-to-the-pino-logger-vmosovzzfrom
stack/docs-rivetkit-add-actor-tracing-docs-mqqwnuwl
Open

eersnington wants to merge 1 commit into
stack/feat-rivetkit-forward-otel-sdk-warnings-to-the-pino-logger-vmosovzzfrom
stack/docs-rivetkit-add-actor-tracing-docs-mqqwnuwl

Conversation

@eersnington

@eersnington eersnington commented Sep 15, 2026

Copy link
Copy Markdown
Member

this stack is a bit chonky to review so I've scoped down a lot of things.

a rundown of what i'm shipping with this otel stack:

  • changes to how ray ID gets passed on within guard service
  • traces for actions, http handlers and sqlite operations
  • traces for actor-to-actor calls
  • linked scheduled actions and queue messages
  • actor logs with ray and trace IDs (pino)
  • otel sdk warnings and errors through from core to pino
  • export to an OTLP backend

not within this stack

  • workflows support (will be up next if this looks good cause it's another 800+ loc PR)
  • rust sdk support
  • websocket traces support (req another migration too to ActionRequest type)
  • wasm runtime support
  • native effect tracing support

and regarding this pr, i'm hosting the docs here (@NathanFlurry made a lot of changes as per our last call). lmk if you're picky about anything and want more things changed.

https://docs-otel-e2e.eers.dev/actors/docs/general/tracing/

diagrams added
image

image

notes for @MasterPtato or anyone puling this to staging.
tracing is feature flagged with the traces endpoint env var. if that's not set, it's disabled.

OTEL_SERVICE_NAME=<val>
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://collector:4318/v1/traces
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf 
# or grpc

you can technically read the "Quickstart" within the docs and should be able to configure it within the cloud. if anything is unclear in that, lmk, I'll fix things up.

and also this #5729 bumps the internal schema version from 1 to 2 to store ray ID and tracecontext to the schedules and queues table.

@the-company-company the-company-company Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 2 medium · 🔵 1 low

Reviewed commit 5d35d78.

Comment thread docs/content/docs/general/tracing.mdx
Comment thread docs/content/docs/general/tracing.mdx
Comment thread examples/docs/general-tracing/caller-ray-id.ts Outdated
@claude

claude Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Code Review

This is a docs-only PR (tracing documentation, sidebar entry, and small CLAUDE.md/testing.md reference bullets). Most of the new content checks out accurately against the actual implementation — span names, span kinds, attribute names, ray-ID validation rules, and NAPI telemetry sink wiring all matched the code in rivetkit-rust/packages/rivetkit-core/src/telemetry/. Two issues found:

1. Sampling env vars are documented but not honored by the native exporter

File: docs/content/docs/general/tracing.mdx (~line 174)

The docs state that OTEL_TRACES_SAMPLER / OTEL_TRACES_SAMPLER_ARG configure sampling for RivetKit's native OTLP exporter. However, rivetkit-rust/packages/rivetkit-core/src/telemetry/export.rs only reads OTEL_EXPORTER_OTLP_TRACES_PROTOCOL/OTEL_EXPORTER_OTLP_PROTOCOL, OTEL_SDK_DISABLED, and OTEL_TRACES_EXPORTER=none — the SdkTracerProvider::builder()...build() call never invokes .with_sampler(...). A user setting these env vars to reduce sampling in production (e.g. traceidratio at 0.1) will silently get 100% sampling of RivetKit's automatic actor/SQLite/queue spans instead, which could cause unexpected trace volume/cost. Worth either wiring up sampler support or correcting the docs to note these vars only apply to a separately configured JS OTel SDK, not RivetKit's built-in exporter.

2. Ray-ID diagram caption text is mispositioned

File: docs/content/docs/general/tracing.mdx (~line 153)

In the inline SVG diagram, the two caption <text> elements ("Same ray ID across this work" / "ray ID: my-rivet-ray-id") live inside <g transform="translate(40 20)"> at local x=20 (absolute x=60), but the dashed "ONE RAY ID" box they annotate is a sibling <g> starting at absolute x=420. Rendered, the captions land ~360px to the left of the box, under the unrelated "Caller" node rather than near the highlighted region — confusing for a reader trying to follow the diagram.


Generated by Claude Code review.

@eersnington
eersnington force-pushed the stack/feat-rivetkit-forward-otel-sdk-warnings-to-the-pino-logger-vmosovzz branch from a550f80 to e34c47e Compare September 16, 2026 01:18
@eersnington
eersnington force-pushed the stack/docs-rivetkit-add-actor-tracing-docs-mqqwnuwl branch from 5d35d78 to 6c2a881 Compare September 16, 2026 01:18

@the-company-company the-company-company Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found

Reviewed commit 6c2a881.

@eersnington
eersnington force-pushed the stack/docs-rivetkit-add-actor-tracing-docs-mqqwnuwl branch from 6c2a881 to d18e8f9 Compare September 16, 2026 17:51
@eersnington
eersnington force-pushed the stack/feat-rivetkit-forward-otel-sdk-warnings-to-the-pino-logger-vmosovzz branch from e34c47e to 0f3841f Compare September 16, 2026 17:51

@the-company-company the-company-company Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 1 medium-severity finding

Reviewed commit d18e8f9.

Comment thread docs-internal/engine/rivetkit-telemetry.md
@eersnington
eersnington force-pushed the stack/feat-rivetkit-forward-otel-sdk-warnings-to-the-pino-logger-vmosovzz branch from 0f3841f to c2a3397 Compare September 16, 2026 18:08
@eersnington
eersnington force-pushed the stack/docs-rivetkit-add-actor-tracing-docs-mqqwnuwl branch from d18e8f9 to 45ae99c Compare September 16, 2026 18:08

@the-company-company the-company-company Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found

Reviewed commit 45ae99c.

@eersnington
eersnington force-pushed the stack/feat-rivetkit-forward-otel-sdk-warnings-to-the-pino-logger-vmosovzz branch from c2a3397 to e10de14 Compare September 16, 2026 18:16
@eersnington
eersnington force-pushed the stack/docs-rivetkit-add-actor-tracing-docs-mqqwnuwl branch 2 times, most recently from 4976b3e to 5aa5975 Compare September 16, 2026 18:24
@eersnington
eersnington force-pushed the stack/feat-rivetkit-forward-otel-sdk-warnings-to-the-pino-logger-vmosovzz branch from e10de14 to 5fd3076 Compare September 16, 2026 18:24
@eersnington
eersnington force-pushed the stack/docs-rivetkit-add-actor-tracing-docs-mqqwnuwl branch from 5aa5975 to 67deba1 Compare September 16, 2026 18:34
@eersnington
eersnington force-pushed the stack/feat-rivetkit-forward-otel-sdk-warnings-to-the-pino-logger-vmosovzz branch 2 times, most recently from 2c70404 to a78f5c5 Compare September 16, 2026 18:42
@eersnington
eersnington force-pushed the stack/docs-rivetkit-add-actor-tracing-docs-mqqwnuwl branch from 67deba1 to 63b46d5 Compare September 16, 2026 18:42
@eersnington
eersnington force-pushed the stack/feat-rivetkit-forward-otel-sdk-warnings-to-the-pino-logger-vmosovzz branch from a78f5c5 to 8443f5d Compare September 16, 2026 19:13
@eersnington
eersnington force-pushed the stack/docs-rivetkit-add-actor-tracing-docs-mqqwnuwl branch 2 times, most recently from 50b6370 to abe4606 Compare September 16, 2026 20:28
@eersnington
eersnington force-pushed the stack/feat-rivetkit-forward-otel-sdk-warnings-to-the-pino-logger-vmosovzz branch 2 times, most recently from 39bc2f6 to 403bbe7 Compare September 17, 2026 15:14
@eersnington
eersnington force-pushed the stack/docs-rivetkit-add-actor-tracing-docs-mqqwnuwl branch from abe4606 to 261c750 Compare September 17, 2026 15:14
@eersnington
eersnington force-pushed the stack/feat-rivetkit-forward-otel-sdk-warnings-to-the-pino-logger-vmosovzz branch from 403bbe7 to a249107 Compare September 18, 2026 22:40
@eersnington
eersnington force-pushed the stack/docs-rivetkit-add-actor-tracing-docs-mqqwnuwl branch from 261c750 to 53f1337 Compare September 18, 2026 22:40
@eersnington
eersnington force-pushed the stack/feat-rivetkit-forward-otel-sdk-warnings-to-the-pino-logger-vmosovzz branch from a249107 to 86c5005 Compare September 19, 2026 01:01
@eersnington
eersnington force-pushed the stack/docs-rivetkit-add-actor-tracing-docs-mqqwnuwl branch from 53f1337 to 061c0ec Compare September 19, 2026 01:01
@eersnington
eersnington force-pushed the stack/docs-rivetkit-add-actor-tracing-docs-mqqwnuwl branch from 061c0ec to a182e43 Compare September 21, 2026 22:56
@eersnington
eersnington force-pushed the stack/feat-rivetkit-forward-otel-sdk-warnings-to-the-pino-logger-vmosovzz branch from 86c5005 to 80a413c Compare September 21, 2026 22:56

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant