Add optional Monocle observability (opt-in) - #3
Draft
imohammedansari wants to merge 1 commit into
Draft
Conversation
imohammedansari
force-pushed
the
monocle-optional
branch
3 times, most recently
from
July 15, 2026 22:44
44c2171 to
501698a
Compare
imohammedansari
force-pushed
the
monocle-optional
branch
from
July 15, 2026 22:57
501698a to
83c10b9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds optional, opt-in Monocle observability to Open Deep Research, following the same app-owned env interface as the existing LangSmith tracing gate. Off by default; a default install is unaffected.
Env interface (parallel to
LANGSMITH_*)MONOCLE_TRACINGMONOCLE_EXPORTERSfile, console, okahu, s3, blob, gcsfileOKAHU_API_KEYokahuis selectedWhat it does
MONOCLE_EXPORTERSitself, validates each entry against the known set, and fails fast on an unknown exporter or anokahuselection withoutOKAHU_API_KEY— before any instrumentation runs, so a config typo surfaces a clear error rather than an opaque one.setup_monocle_telemetry(workflow_name="open-deep-research", monocle_exporters_list=<MONOCLE_EXPORTERS or "file">). The app owns the exporter selection rather than deferring to Monocle's own env var.MONOCLE_TRACINGis unset/false the block is a no-op andmonocle_apptraceis never imported.monocle_apptraceis an optional[monocle]extra (not a core dependency). Enabling tracing without the extra raises a clear install hint:pip install "open_deep_research[monocle]".Each run writes one trace file to
.monocle/, viewable in the Monocle VS Code extension; theokahuexporter sends traces to Okahu for cross-run analysis.Files changed
src/open_deep_research/deep_researcher.py— guarded, gated setup helper (initialized once at import)..env.example—MONOCLE_TRACING/MONOCLE_EXPORTERS/OKAHU_API_KEYblock.pyproject.toml—monocleoptional extra.README.md— "Monocle Tracing" section under Configurations.Verification (4 cases)
monocle_apptracenever imported, setup not called.setup_monocle_telemetrycalled;MONOCLE_EXPORTERS=file,console→ forwarded"file,console"; unset →"file".RuntimeErrorwith thepip install "open_deep_research[monocle]"hint.ValueError;okahuwithoutOKAHU_API_KEY→ValueError.Also confirmed with the real installed
monocle_apptracethatimport open_deep_research.deep_researcherworks both disabled (no.monocle/written) and enabled (real setup runs).