Skip to main content

ObserveEvent

Enum ObserveEvent 

Source
pub enum ObserveEvent {
    RequestStarted {
        request_id: String,
        downstream_user_agent: Option<String>,
    },
    AuthnComplete {
        principal_id: String,
        kind: PrincipalKind,
    },
    UpstreamChosen {
        upstream: Upstream,
    },
    Chunk {
        batch_index: u64,
        event_count: usize,
        total_bytes: usize,
    },
    RequestFinished {
        status: StatusCode,
        input_tokens: Option<u64>,
        output_tokens: Option<u64>,
        cache_creation_input_tokens: Option<u64>,
        cache_read_input_tokens: Option<u64>,
        duration_ms: u64,
    },
    Error {
        code: String,
        message: String,
        source: String,
    },
}
Expand description

Observability events emitted by the lifecycle.

Variants§

§

RequestStarted

Downstream request has entered the proxy.

Fields

§request_id: String

Request identifier.

§downstream_user_agent: Option<String>

Downstream user-agent header, when present.

§

AuthnComplete

Authentication completed successfully.

Fields

§principal_id: String

Authenticated principal identifier.

§kind: PrincipalKind

Authenticated principal kind.

§

UpstreamChosen

Router selected an upstream.

Fields

§upstream: Upstream

Selected upstream.

§

Chunk

A batch of streamed events passed through the relay.

Fields

§batch_index: u64

Monotonic batch index within the response stream.

§event_count: usize

Number of SSE events in the batch.

§total_bytes: usize

Total bytes in the batch.

§

RequestFinished

Request finished successfully or with an upstream HTTP error.

Fields

§status: StatusCode

Final HTTP status code.

§input_tokens: Option<u64>

Input token count reported by the upstream, when known.

§output_tokens: Option<u64>

Output token count reported by the upstream, when known.

§cache_creation_input_tokens: Option<u64>

Cache write token count reported by the upstream, when known.

§cache_read_input_tokens: Option<u64>

Cache read token count reported by the upstream, when known.

§duration_ms: u64

End-to-end request duration in milliseconds.

§

Error

Lifecycle or plugin error was observed.

Fields

§code: String

Stable error code.

§message: String

Redacted human-readable message.

§source: String

Error source component.

Trait Implementations§

Source§

impl Clone for ObserveEvent

Source§

fn clone(&self) -> ObserveEvent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ObserveEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ObserveEvent

Source§

impl PartialEq for ObserveEvent

Source§

fn eq(&self, other: &ObserveEvent) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ObserveEvent

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.