Skip to content

fix: keep marimo running when tracing dependencies are missing - #10758

Merged
Light2Dark merged 1 commit into
mainfrom
codex/graceful-tracing-without-otel
Sep 8, 2026
Merged

Light2Dark merged 1 commit into
mainfrom
codex/graceful-tracing-without-otel

Conversation

@Light2Dark

@Light2Dark Light2Dark commented Sep 7, 2026 •

Copy link
Copy Markdown
Member

📝 Summary

MARIMO_TRACING=1 currently prevents marimo from starting when OpenTelemetry is unavailable, including inside isolated notebook sandboxes. Tracing is an optional observability feature and must not make the application unavailable.

This change initializes tracing once and selects either the OpenTelemetry backend or no-op tracers. Missing or incomplete OpenTelemetry installations now produce one actionable warning and disable tracing for that process. Editable sandbox installs also retain requested marimo extras instead of silently dropping them.

image

Seems the only simple way to run with otel is this

uv add --script new_file.py 'marimo[otel]'
MARIMO_TRACING=1 marimo edit --sandbox new_file.py

📋 Pre-Review Checklist

  • This change is focused and does not affect the public API.
  • Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
  • This change has no visual behavior that requires media evidence.

✅ Merge Checklist

  • I have read the contributor guidelines.
  • Documentation has been updated where applicable, including docstrings for API changes.
  • Tests have been added for the changes made.

Written by GPT-5 on Codex

@vercel

vercel Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
marimo-docs Ready Ready Preview Sep 8, 2026 5:35am UTC

Request Review

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread marimo/_tracer.py
Comment thread marimo/_tracer.py
@Light2Dark Light2Dark added the bug Something isn't working label Sep 8, 2026
@Light2Dark
Light2Dark marked this pull request as ready for review September 8, 2026 05:30
Copilot AI lite review requested due to automatic review settings September 8, 2026 05:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

There is a functional gap where tracing isn’t fully disabled (request-path still attempts OpenTelemetry imports), and the new subprocess test script construction is likely to fail due to indentation.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR makes tracing truly optional: when MARIMO_TRACING=1 but OpenTelemetry isn’t available (common in isolated/sandboxed environments), marimo should still start, emit a single actionable warning, and use no-op tracers for the rest of the process. It also ensures editable sandbox installs preserve requested marimo extras.

Changes:

  • Initialize tracing once at import-time and fall back to no-op tracing when OpenTelemetry cannot be imported or initialization fails.
  • Preserve additional_features (extras) when marimo is installed editable in sandboxes.
  • Add tests and docs to cover “missing OpenTelemetry should not prevent startup” behavior.
File summaries
File Description
marimo/_tracer.py Adds one-time tracing initialization with warning + no-op fallback; wires tracers off a global availability flag.
tests/test_tracer.py Updates tracer tests to reflect one-time initialization; adds subprocess test ensuring import marimo works without OpenTelemetry.
marimo/_cli/sandbox.py Preserves extras for editable marimo sandbox dependencies (-e /path[extras]).
tests/_cli/test_sandbox.py Extends sandbox dependency normalization tests for editable installs retaining extras.
development_docs/traces.md Documents that missing tracing deps disables tracing but keeps marimo running.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/test_tracer.py
Comment thread marimo/_tracer.py
Comment thread marimo/_tracer.py
@Light2Dark
Light2Dark merged commit 0cfb49e into main Sep 8, 2026
54 checks passed
@Light2Dark
Light2Dark deleted the codex/graceful-tracing-without-otel branch September 8, 2026 13:47

This branch was successfully deployed

1 active deployment
Preview — f010eb57 Deployed Sep 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants