Skip to content

feat: Add telemetry hooks for SDK method execution duration#654

Open
ekumamatthew wants to merge 3 commits intodotandev:mainfrom
ekumamatthew:feature/telemetry-hooks
Open

feat: Add telemetry hooks for SDK method execution duration#654
ekumamatthew wants to merge 3 commits intodotandev:mainfrom
ekumamatthew:feature/telemetry-hooks

Conversation

@ekumamatthew
Copy link

Closes #622

  • Implement optional MethodTelemetry interface for duration tracking
  • Add WithMethodTiming() for automatic span creation and timing
  • Add RecordMethodDuration() for manual duration recording
  • Instrument core network RPC methods (getTransaction, getLedgerHeader, getLedgerEntries, simulateTransaction)
  • Instrument simulator Run() method with timing and attributes
  • Add telemetry configuration options (telemetry_enabled, telemetry_exporter_url, telemetry_service_name)
  • Support both environment variables and TOML configuration
  • Add comprehensive test suite for telemetry functionality
  • Maintain backward compatibility with no-op implementation when disabled

Performance metrics collected:

  • Method execution duration in seconds (histogram)
  • Method names, network info, RPC URLs as attributes
  • Transaction hashes, ledger sequences, simulator config

Closes dotandev#622

- Implement optional MethodTelemetry interface for duration tracking
- Add WithMethodTiming() for automatic span creation and timing
- Add RecordMethodDuration() for manual duration recording
- Instrument core network RPC methods (getTransaction, getLedgerHeader, getLedgerEntries, simulateTransaction)
- Instrument simulator Run() method with timing and attributes
- Add telemetry configuration options (telemetry_enabled, telemetry_exporter_url, telemetry_service_name)
- Support both environment variables and TOML configuration
- Add comprehensive test suite for telemetry functionality
- Maintain backward compatibility with no-op implementation when disabled

Performance metrics collected:
- Method execution duration in seconds (histogram)
- Method names, network info, RPC URLs as attributes
- Transaction hashes, ledger sequences, simulator config

This enables identification of performance bottlenecks in critical SDK methods.
@dotandev
Copy link
Owner

fix conflicts, please.

- Fix config.go: Add RequestTimeout field and remove telemetry conflicts
- Fix simulator/runner.go: Keep both telemetry and validation functionality
- Restore memory limit simulation functionality in main.rs
- Update SimHost::new calls to include memory_limit parameter
- Add memory limit checking after operation execution
- Keep both telemetry instrumentation and URL routing logic
- Preserve circuit breaker functionality for Soroban endpoints
- Maintain proper URL selection for getLedgerEntries and simulateTransaction methods
@dotandev
Copy link
Owner

fix the newest conflicts, please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add telemetry hooks for SDK method execution duration

2 participants