pub struct TelemetryWorkerHandle { /* private fields */ }Expand description
TelemetryWorkerHandle is a handle which allows interactions with the telemetry worker. The handle is safe to use across threads.
The worker won’t send data to the agent until you call TelemetryWorkerHandle::send_start
To stop the worker, call TelemetryWorkerHandle::send_stop which trigger flush asynchronously
then TelemetryWorkerHandle::wait_for_shutdown
Implementations§
Source§impl TelemetryWorkerHandle
impl TelemetryWorkerHandle
pub fn register_metric_context( &self, name: String, tags: Vec<Tag>, metric_type: MetricType, common: bool, namespace: MetricNamespace, ) -> ContextKey
pub fn try_send_msg(&self, msg: TelemetryActions) -> Result<()>
pub async fn send_msg(&self, msg: TelemetryActions) -> Result<()>
pub async fn send_msgs<T>(&self, msgs: T) -> Result<()>where
T: IntoIterator<Item = TelemetryActions>,
pub async fn send_msg_timeout( &self, msg: TelemetryActions, timeout: Duration, ) -> Result<()>
pub fn send_start(&self) -> Result<()>
pub fn send_stop(&self) -> Result<()>
pub fn wait_for_shutdown_deadline(&self, deadline: Instant)
pub fn add_dependency( &self, name: String, version: Option<String>, ) -> Result<()>
pub fn add_integration( &self, name: String, enabled: bool, version: Option<String>, compatible: Option<bool>, auto_enabled: Option<bool>, ) -> Result<()>
pub fn add_log<T: Hash>( &self, identifier: T, message: String, level: LogLevel, stack_trace: Option<String>, ) -> Result<()>
pub fn add_point( &self, value: f64, context: &ContextKey, extra_tags: Vec<Tag>, ) -> Result<()>
pub fn wait_for_shutdown(&self)
pub fn stats(&self) -> Result<Receiver<TelemetryWorkerStats>>
Trait Implementations§
Source§impl Clone for TelemetryWorkerHandle
impl Clone for TelemetryWorkerHandle
Source§fn clone(&self) -> TelemetryWorkerHandle
fn clone(&self) -> TelemetryWorkerHandle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TelemetryWorkerHandle
impl RefUnwindSafe for TelemetryWorkerHandle
impl Send for TelemetryWorkerHandle
impl Sync for TelemetryWorkerHandle
impl Unpin for TelemetryWorkerHandle
impl UnsafeUnpin for TelemetryWorkerHandle
impl UnwindSafe for TelemetryWorkerHandle
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