pub struct Telemetry { /* private fields */ }Implementations§
Source§impl Telemetry
impl Telemetry
pub fn disabled() -> Self
pub async fn new(redis_url: &str) -> Result<Self, Box<dyn Error + Send + Sync>>
Sourcepub fn from_connection_manager(manager: ConnectionManager) -> Self
pub fn from_connection_manager(manager: ConnectionManager) -> Self
Create a Telemetry instance from an existing ConnectionManager. This allows sharing a single Redis connection across subsystems.
pub fn with_stream_key(self, stream_key: &str) -> Self
pub async fn record( &self, key: &str, model: &str, response_time_ms: u64, ) -> Result<(), Box<dyn Error + Send + Sync>>
pub async fn record_with_tokens( &self, key: &str, model: &str, input_tokens: u32, output_tokens: u32, response_time_ms: u64, ) -> Result<(), Box<dyn Error + Send + Sync>>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Telemetry
impl !UnwindSafe for Telemetry
impl Forget for Telemetry
impl Freeze for Telemetry
impl Move for Telemetry
impl Send for Telemetry
impl Sync for Telemetry
impl Unpin for Telemetry
impl UnsafeUnpin for Telemetry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more