ExESDB.Telemetry (ex_esdb v0.11.0)
Telemetry GenServer for the ExESDB core package.
This module is responsible only for monitoring and observability within the core ex_esdb 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 event store read/write operations
- Track stream operations and performance
- Monitor subscription management and delivery
- Track snapshot operations
- Monitor gateway worker performance
- Collect cluster consistency and health metrics
Usage
The telemetry server is automatically started by the ExESDB supervisor. To emit custom events from your code:
ExESDB.Telemetry.emit(:stream_write_start, %{store: :my_store, stream: "my-stream"})
ExESDB.Telemetry.emit(:stream_write_complete, %{store: :my_store, stream: "my-stream", events: 5, duration_us: 1500})To get current metrics:
ExESDB.Telemetry.get_metrics()
ExESDB.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.