ExESDBCommandedAdapter.Telemetry (ex_esdb_commanded v0.9.0)
Telemetry GenServer for the ExESDB Commanded Adapter package.
This module is responsible only for monitoring and observability within the ex_esdb_commanded_adapter package. It follows proper separation of concerns by:
- Only handling telemetry events from this package
- Running as a supervised GenServer for reliability
- Broadcasting events through PubSub for external consumption
- Maintaining internal metrics and health state
Responsibilities
- Monitor command processing and event appending
- Track aggregate lifecycle and state management
- Monitor subscription proxy operations
- Track event acknowledgment and delivery
- Monitor adapter initialization and lifecycle
- Collect command/event sourcing performance metrics
Usage
The telemetry server is automatically started by the adapter supervisor. To emit custom events from your code:
ExESDBCommandedAdapter.Telemetry.emit(:command_handled, %{aggregate_id: "123", command: MyCommand, duration_us: 1500})
ExESDBCommandedAdapter.Telemetry.emit(:event_appended, %{stream: "account-123", events: 2})To get current metrics:
ExESDBCommandedAdapter.Telemetry.get_metrics()
ExESDBCommandedAdapter.Telemetry.get_health()
Summary
Functions
Returns a specification to start this module under a supervisor.
Emit a telemetry event from application code.
Get current health status.
Get current metrics summary.
Reset metrics counters.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Emit a telemetry event from application code.
Get current health status.
Get current metrics summary.
Reset metrics counters.