-
OTLP Exporter Integration
- HTTP-based OTLP exporter with configurable endpoint
- Default endpoint:
http://localhost:4318 - Compatible with Jaeger, Honeycomb, and other OTLP platforms
-
Context Propagation
- Full context propagation across all components
- RPC client → Debug command → Simulator runner
- Maintains trace continuity throughout the execution flow
-
Span Hierarchies
debug_transaction(root span)fetch_transaction(RPC call)simulate_transaction(when simulation runs)marshal_requestexecute_simulatorunmarshal_response
-
Rich Span Attributes
- Transaction hash, network, envelope sizes
- Simulator binary path, request/response sizes
- Error information when operations fail
-
Configuration Flags
--tracing: Enable/disable tracing (default: false)--otlp-url: Configure OTLP endpoint URL
- Zero overhead when disabled: No performance impact when
--tracingis false - Minimal overhead when enabled: Asynchronous batched export
- Graceful error handling: Continues operation even if OTLP endpoint unavailable
- Unit tests for telemetry package
- Integration test for span creation
- Backward compatibility verified (CLI works without tracing)
- All existing tests pass
New Files:
internal/telemetry/telemetry.go- OpenTelemetry configurationinternal/telemetry/telemetry_test.go- Unit testsdocs/opentelemetry.md- Documentationdocker-compose.jaeger.yml- Local Jaeger setuptest/integration/otel_integration.go- Integration test
Modified Files:
internal/cmd/debug.go- Added tracing flags and root spaninternal/rpc/client.go- Added RPC tracinginternal/simulator/runner.go- Added simulation tracing with contextgo.mod- Added OpenTelemetry dependencies
# Basic usage (no tracing)
./erst debug <tx-hash>
# With Jaeger
./erst debug --tracing <tx-hash>
# With custom OTLP endpoint
./erst debug --tracing --otlp-url https://api.honeycomb.io/v1/traces <tx-hash>- Enterprise-ready observability integration
- Configurable for any OTLP-compatible platform
- Follows OpenTelemetry best practices
- Comprehensive error handling and logging