Skip to content

Latest commit

 

History

History
80 lines (60 loc) · 2.43 KB

File metadata and controls

80 lines (60 loc) · 2.43 KB

OpenTelemetry Integration Summary

Implementation Complete ✅

Core Features Implemented

  1. OTLP Exporter Integration

    • HTTP-based OTLP exporter with configurable endpoint
    • Default endpoint: http://localhost:4318
    • Compatible with Jaeger, Honeycomb, and other OTLP platforms
  2. Context Propagation

    • Full context propagation across all components
    • RPC client → Debug command → Simulator runner
    • Maintains trace continuity throughout the execution flow
  3. Span Hierarchies

    • debug_transaction (root span)
      • fetch_transaction (RPC call)
      • simulate_transaction (when simulation runs)
        • marshal_request
        • execute_simulator
        • unmarshal_response
  4. Rich Span Attributes

    • Transaction hash, network, envelope sizes
    • Simulator binary path, request/response sizes
    • Error information when operations fail
  5. Configuration Flags

    • --tracing: Enable/disable tracing (default: false)
    • --otlp-url: Configure OTLP endpoint URL

Performance Characteristics

  • Zero overhead when disabled: No performance impact when --tracing is false
  • Minimal overhead when enabled: Asynchronous batched export
  • Graceful error handling: Continues operation even if OTLP endpoint unavailable

Testing

  • Unit tests for telemetry package
  • Integration test for span creation
  • Backward compatibility verified (CLI works without tracing)
  • All existing tests pass

Files Added/Modified

New Files:

  • internal/telemetry/telemetry.go - OpenTelemetry configuration
  • internal/telemetry/telemetry_test.go - Unit tests
  • docs/opentelemetry.md - Documentation
  • docker-compose.jaeger.yml - Local Jaeger setup
  • test/integration/otel_integration.go - Integration test

Modified Files:

  • internal/cmd/debug.go - Added tracing flags and root span
  • internal/rpc/client.go - Added RPC tracing
  • internal/simulator/runner.go - Added simulation tracing with context
  • go.mod - Added OpenTelemetry dependencies

Usage Examples

# 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>

Ready for Production

  • Enterprise-ready observability integration
  • Configurable for any OTLP-compatible platform
  • Follows OpenTelemetry best practices
  • Comprehensive error handling and logging