Repository navigation
Conversation
Share the bounded OTLP exporter with every worker so one API request is one trace through the workflow and each activity attempt. Workflow spans leave the sandbox only through interceptors and a replay-silent sink, with span links for continue-as-new and background continuations. Signed-off-by: Dayton Allen <daytonballen@gmail.com> Co-authored-by: dayton536 <dayton536@users.noreply.github.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Request context and workflow memos apps/api/src/dot-goals.ts, apps/api/src/memory-consolidation-coordinator.ts, apps/api/src/memory-mutation-coordinator.ts, apps/api/src/room-agent.ts, apps/api/src/trace-context.ts, apps/api/tests/trace-correlation.test.ts |
API workflow starters pass trace context and correlation fields in workflow memos. traceparentForTraceId returns the registered request traceparent, and tests check the request parent span and Room Agent memo fields. |
Workflow and activity span export
| Layer / File(s) | Summary |
|---|---|
Workflow span context and link contracts apps/worker/src/otlp-span-context.ts, packages/runtime/src/otlp-span-exporter.ts, apps/worker/tests/otlp-span-context.test.ts, apps/worker/tests/otlp-fixtures/workflows.ts |
Shared helpers validate identifiers and attributes, encode Temporal headers, and resolve workflow parent and link relationships. The OTLP exporter accepts valid span links. Unit tests cover context resolution, filtering, and span conversion. |
Worker workflow and activity export apps/worker/src/otlp-workflow-interceptors.ts, apps/worker/src/worker-otlp.ts, apps/worker/src/activity-observability.ts, apps/worker/src/worker.ts, apps/worker/src/memory-maintenance-worker.ts, apps/worker/src/memory-mutation-worker.ts, apps/worker/tests/activity-observability.test.ts |
Workflow interceptors propagate trace headers and export workflow spans. Worker options configure workflow sinks and activity interceptors. Activity spans use a decoded workflow carrier as parent when available and apply the attribute allowlist. |
Integration coverage and tracing documentation apps/worker/tests/otlp-workflow-spans.integration.test.ts, apps/worker/package.json, apps/api/tests/otlp-span-exporter.test.ts, docs/configuration-reference.md, docs/quality/observability.md, docs/quality/KNOWN_LIMITATIONS.md, docs/quality/review-findings.json |
Integration tests check span relationships, retries, continuation links, sensitive-data omission, and replay silence. Documentation describes export configuration, span behavior, and remaining observability gaps. |
Priority:
Estimated code review effort: 4 (Complex) | ~45 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant API
participant TemporalWorkflow
participant TemporalActivity
participant OTLPExporter
API->>TemporalWorkflow: Start with trace correlation memo
TemporalWorkflow->>TemporalActivity: Propagate OTLP context in activity header
TemporalActivity->>OTLPExporter: Export activity-attempt span
TemporalWorkflow->>OTLPExporter: Export workflow span through sink
Possibly related issues
- [$600] Export worker and workflow spans over OTLP: one trace from API request to every Temporal activity #61: Requests Temporal worker and workflow spans over OTLP under the API request trace, which this change implements.
Possibly related PRs
- oll4com/spaceapp#349: Changes the same API trace propagation, worker span export, activity parenting, and continuation-link paths.
- oll4com/spaceapp#334: Adds workflow span propagation through Temporal headers, activities, child workflows, and continue-as-new runs.
- oll4com/spaceapp#319: Changes API-to-Temporal trace propagation and worker workflow and activity spans.
Merge Risk: 
Minimal · up to 7d59c
-
No identified tracing defect blocks merging after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title says the PR adds OTLP export of Temporal worker and workflow spans. The raw summary supports this. The worker now exports workflow spans and activity-attempt spans over OTLP, with span links for continue-as-new and background continuations, and the title names that main change. The title also includes the issue suffix (
#61), which conflicts with the PR objectives that cite PR#361. That mismatch does not change the assessment of the title's content.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 62.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 40 functions across 19 files. (5 skipped: 5 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
Fixes #61 Problem and user impactWhen Change
Verification
|
|
Thank you for the time you put into this pull request. |
|
Thank you for the time and care you put into this pull request. |
Fixes #61
Problem and user impact
When
SPACE_OTEL_EXPORTER_OTLP_ENDPOINTis configured, the API exports HTTP request spans over OTLP/HTTP JSON and propagates a W3Ctraceparentinto Temporal workflow inputs and memos, but Temporal workers emit no spans. Operators debugging a slow or failing Room Agent mission, chat turn, or memory workflow had to manually join log lines because traces stopped at the API boundary.Change
@space/runtimeintospace-worker,space-memory-maintenance-worker, andspace-memory-mutation-workerwheneverSPACE_OTEL_EXPORTER_OTLP_ENDPOINTis set (and no-op when unset), without adding any external OpenTelemetry SDK dependency.WorkflowInboundCallsInterceptor,WorkflowOutboundCallsInterceptor,ActivityInboundCallsInterceptor, and a replay-safe workflow sink (callDuringReplay: false) so workflow code performs zero tracing I/O and history replay emits no duplicate spans.traceparentspan ID, nested child workflows (memoryMaintenanceWorkflow->memoryConsolidationWorkflow) under their parent workflow span, emitted per-attempt activity child spans with attempt number, outcome,reasonCode, andcategory, and attached OTLP span links acrosscontinueAsNewand background continuations (trace:bg-<id>).docs/quality/observability.md,docs/configuration-reference.md, anddocs/quality/KNOWN_LIMITATIONS.md.Verification
npm run check,npm test -w @space/worker— 244 tests including the end-to-end fake OTLP collector + Temporal time-skipping integration suite and replay silence check,npm test -w @space/api -- otlp).Signed-off-by:line (Developer Certificate of Origin 1.1), and the contribution is licensed under the MIT License (see CONTRIBUTING.md).docs/quality/observability.md,docs/configuration-reference.md,docs/quality/KNOWN_LIMITATIONS.md).SPACE_OTEL_EXPORTER_OTLP_ENDPOINTis unset).