pub struct ProxyLogEvent {
pub id: Uuid,
pub event_type: Cow<'static, str>,
pub timestamp: DateTime<Utc>,
pub request: Option<ChatRequest>,
pub response: Option<CollectedProxiedResult>,
pub latency: Option<Duration>,
pub total_latency: Option<Duration>,
pub was_rate_limited: Option<bool>,
pub num_retries: Option<u32>,
pub error: Option<Value>,
pub options: ProxyRequestOptions,
}
Expand description
An event from the proxy.
Fields§
§id: Uuid
A unique ID for this event
event_type: Cow<'static, str>
The type of event
timestamp: DateTime<Utc>
The timestamp of the event
request: Option<ChatRequest>
The request that was proxied
response: Option<CollectedProxiedResult>
The response from the model provider
latency: Option<Duration>
The latency of the request that succeeded
total_latency: Option<Duration>
The total latency of the request, including retries.
was_rate_limited: Option<bool>
Whether the request was rate limited
num_retries: Option<u32>
The number of retries
error: Option<Value>
The error that occurred, if any.
options: ProxyRequestOptions
The options that were used for the request
Implementations§
Source§impl ProxyLogEvent
impl ProxyLogEvent
Sourcepub fn from_payload(id: Uuid, payload: EventPayload) -> Self
pub fn from_payload(id: Uuid, payload: EventPayload) -> Self
Create a new event from a submitted payload
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProxyLogEvent
impl RefUnwindSafe for ProxyLogEvent
impl Send for ProxyLogEvent
impl Sync for ProxyLogEvent
impl Unpin for ProxyLogEvent
impl UnwindSafe for ProxyLogEvent
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> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
Creates a shared type from an unshared type.