Snakepit.Telemetry.GrpcStream (Snakepit v0.6.10)
View SourceManages gRPC telemetry streams from Python workers.
This GenServer maintains bidirectional telemetry streams with Python workers,
translating Python telemetry events into Elixir :telemetry events.
Features:
- Automatic stream registration when workers connect
- Dynamic sampling rate adjustments
- Event filtering
- Graceful handling of worker disconnections
Summary
Functions
Returns a specification to start this module under a supervisor.
Gets the current state of all registered streams.
Registers a worker for telemetry streaming.
Starts the telemetry stream manager.
Enables or disables telemetry for a specific worker.
Removes a worker from telemetry streaming.
Updates event filters for a specific worker.
Updates the sampling rate for a specific worker.
Types
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Gets the current state of all registered streams.
Registers a worker for telemetry streaming.
Automatically initiates a telemetry stream with the worker and starts consuming events.
Examples
iex> channel = connect_to_worker()
iex> Snakepit.Telemetry.GrpcStream.register_worker(channel, %{
...> worker_id: "worker_1",
...> pool_name: :default,
...> python_pid: 12345
...> })
:ok
Starts the telemetry stream manager.
Enables or disables telemetry for a specific worker.
Removes a worker from telemetry streaming.
Called when a worker disconnects or terminates.
Updates event filters for a specific worker.
Updates the sampling rate for a specific worker.
Examples
iex> Snakepit.Telemetry.GrpcStream.update_sampling("worker_1", 0.1)
:ok
iex> Snakepit.Telemetry.GrpcStream.update_sampling("worker_1", 0.5, ["python.call.*"])
:ok