refactor(tracing): replace custom Dapper schemas with OpenTelemetry SDK#185
Merged
gowthamrao merged 1 commit intoMay 12, 2026
Merged
Conversation
…DK (#184) - Add opentelemetry-api, opentelemetry-sdk, opentelemetry-exporter-otlp to deps - Create src/coreason_runtime/utils/tracing.py with TracerProvider, OTLP export, and no-op fallbacks - Refactor EmitSpanIOActivity to emit native OTel spans instead of validating ExecutionSpanReceipt Pydantic JSON - Replace otel_telemetry_sink placeholder stub in logger.py with real OTel span emission - Enable instructor auto-instrumentation via TracerProvider init in predict_router - Add comprehensive test suite for tracing module (tests/utils/test_tracing.py) - Update test_emit_span_valid and test_otel_telemetry_sink_forwards_message Closes #184
215b678
into
20260509-nemoclaw-by-issue
10 of 12 checks passed
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.
Summary
Replaces CoReason's custom Dapper-style distributed tracing schemas (
ExecutionSpanReceipt,SpanEvent,TraceExportManifest) with the industry-standard OpenTelemetry SDK and OTLP exporters.Closes #184
Why?
instructorlibrary (already a dependency) has native OTel auto-instrumentation.temporalio(already a dependency) has native OTel interceptors.EmitSpanIOActivity.Changes
New Files
src/coreason_runtime/utils/tracing.py—TracerProviderinitialization with OTLP exporter,get_tracer()utility, no-op fallbackstests/utils/test_tracing.py— Comprehensive test suite for the tracing moduleModified Files
pyproject.tomlopentelemetry-api,opentelemetry-sdk,opentelemetry-exporter-otlpactivities.pyEmitSpanIOActivitynow emits real OTel spans instead of validatingExecutionSpanReceiptlogger.pyotel_telemetry_sinkreplaced — real OTel span emission instead of debug stubpredict_router.pyTracerProviderto enableinstructorauto-instrumentationtest_activities_standalone.pytest_emit_span_validfor OTel-native payloadstest_logger.pytest_otel_telemetry_sink_forwards_messagefor OTel behaviorNOT in Scope
ExecutionNodeReceiptstays — it's Merkle-DAG provenance, not tracingcoreason-manifestwill be a separate PR (Phase 3 of the plan)Configuration
Standard OTel env vars:
Testing
ruff format✅ruff check✅mypy✅ (no new errors; pre-existingDempsterShaferBeliefVectorerror unchanged)pytest— 207 passed, 1 pre-existing failure (test_synthesize_scratch_zero_day_forge)