pub struct StandardTelemetry;Expand description
A ready-to-use Observer that emits structured tracing events for
every stream lifecycle transition — turnkey operational telemetry with no
boilerplate and no extra dependency.
Each hook logs under the arcly_stream::telemetry target with structured
fields (app, stream, skipped), so a tracing-subscriber can render it
to stdout, JSON, or a rolling file appender. Routine transitions log at
INFO; slow-consumer/rate-limit/reap signals log at WARN so they surface
in alerting. The per-frame hook is intentionally not logged — it is
far too high-cardinality for the hot path; use the
PrometheusObserver (metrics
feature) for frame counters.
use arcly_stream::observe::StandardTelemetry;
use arcly_stream::prelude::*;
let engine = Engine::builder()
.application(AppSpec::new("live"))
.observer(StandardTelemetry::new())
.build();Implementations§
Trait Implementations§
Source§impl Clone for StandardTelemetry
impl Clone for StandardTelemetry
Source§fn clone(&self) -> StandardTelemetry
fn clone(&self) -> StandardTelemetry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for StandardTelemetry
Source§impl Debug for StandardTelemetry
impl Debug for StandardTelemetry
Source§impl Default for StandardTelemetry
impl Default for StandardTelemetry
Source§fn default() -> StandardTelemetry
fn default() -> StandardTelemetry
Returns the “default value” for a type. Read more
Source§impl Observer for StandardTelemetry
impl Observer for StandardTelemetry
Source§fn on_event(&self, event: &StreamEvent)
fn on_event(&self, event: &StreamEvent)
A stream lifecycle event was emitted.
Source§fn on_publish_started(&self, app: &str)
fn on_publish_started(&self, app: &str)
A publish session started in application
app.Source§fn on_publish_ended(&self, app: &str)
fn on_publish_ended(&self, app: &str)
A publish session ended in application
app.Source§fn on_subscriber_lagged(&self, key: &StreamKey, skipped: u64)
fn on_subscriber_lagged(&self, key: &StreamKey, skipped: u64)
A subscriber fell behind the broadcast buffer and
skipped frames were
dropped from its view before it could read them. This is the canonical
slow-consumer signal: alert on it. Fired by
StreamHandle::subscribe_resilient.Source§fn on_subscriber_evicted(&self, key: &StreamKey)
fn on_subscriber_evicted(&self, key: &StreamKey)
A chronically slow subscriber crossed its
max_lag budget and was shed.
Fired by Subscription::recv.Source§fn on_rate_limited(&self, key: &StreamKey)
fn on_rate_limited(&self, key: &StreamKey)
An ingress rate limit was exceeded for
key; the protocol handler should
drop or backpressure the connection. Handlers call this from their
ingest loop (e.g. when IngestRateLimit
returns false).Source§fn on_stream_reaped(&self, key: &StreamKey)
fn on_stream_reaped(&self, key: &StreamKey)
A publish session was reaped for exceeding the engine’s idle timeout.
Source§fn on_frame(&self, _key: &StreamKey, _frame: &MediaFrame)
fn on_frame(&self, _key: &StreamKey, _frame: &MediaFrame)
A frame was published. Hot-path hook — keep it cheap. The default
is a no-op so the branch is trivially predicted away when no observer
is installed.
Auto Trait Implementations§
impl Freeze for StandardTelemetry
impl RefUnwindSafe for StandardTelemetry
impl Send for StandardTelemetry
impl Sync for StandardTelemetry
impl Unpin for StandardTelemetry
impl UnsafeUnpin for StandardTelemetry
impl UnwindSafe for StandardTelemetry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more