Skip to main content

BroadcastTrace

Struct BroadcastTrace 

Source
pub struct BroadcastTrace {
Show 54 fields pub trace_id: String, pub span_id: String, pub parent_span_id: String, pub span_name: String, pub start_time_unix_nano: i64, pub end_time_unix_nano: i64, pub duration: Duration, pub prompt_tokens: i64, pub completion_tokens: i64, pub total_tokens: i64, pub cost: f64, pub model: String, pub input_tokens: i64, pub output_tokens: i64, pub total_cost: f64, pub input_cost: f64, pub output_cost: f64, pub cached_tokens: i64, pub audio_input_tokens: i64, pub video_input_tokens: i64, pub image_output_tokens: i64, pub reasoning_tokens: i64, pub operation_name: String, pub system: String, pub provider_name: String, pub response_model: String, pub finish_reason: String, pub finish_reasons: String, pub request_model: String, pub provider_slug: String, pub openrouter_provider_name: String, pub api_key_name: String, pub entity_id: String, pub openrouter_user_id: String, pub openrouter_finish_reason: String, pub input_unit_price: f64, pub output_unit_price: f64, pub source: String, pub prompt: String, pub completion: String, pub span_type: String, pub span_level: String, pub span_input: String, pub span_output: String, pub trace_name: String, pub trace_input: String, pub trace_output: String, pub trace_tags: String, pub user_id: String, pub session_id: String, pub metadata: BTreeMap<String, String>, pub span_metadata: BTreeMap<String, String>, pub resource_attributes: BTreeMap<String, String>, pub raw_attributes: BTreeMap<String, String>,
}
Expand description

User-friendly representation of a single span extracted from an OTLP trace payload sent by OpenRouter Broadcast. Field names mirror the Go SDK; deprecated aliases (Self::prompt_tokens, etc.) are kept so callers porting from the Go SDK don’t have to rename everything.

Fields§

§trace_id: String

Hex trace identifier.

§span_id: String

Hex span identifier.

§parent_span_id: String

Parent span identifier (empty for the root).

§span_name: String

Span name.

§start_time_unix_nano: i64

Start time as nanoseconds since the Unix epoch (0 when missing).

§end_time_unix_nano: i64

End time as nanoseconds since the Unix epoch (0 when missing).

§duration: Duration

end - start when both timestamps are present.

§prompt_tokens: i64

Deprecated: prompt tokens (use Self::input_tokens).

§completion_tokens: i64

Deprecated: completion tokens (use Self::output_tokens).

§total_tokens: i64

Total tokens (computed as input + output when absent upstream).

§cost: f64

Total cost in USD (alias of Self::total_cost).

§model: String

Resolved model id (prefers response.model over request.model).

§input_tokens: i64

Canonical input-token count.

§output_tokens: i64

Canonical output-token count.

§total_cost: f64

Total USD cost.

§input_cost: f64

Input-side USD cost.

§output_cost: f64

Output-side USD cost.

§cached_tokens: i64

Tokens served from cache.

§audio_input_tokens: i64

Audio-input tokens.

§video_input_tokens: i64

Video-input tokens.

§image_output_tokens: i64

Image-output tokens.

§reasoning_tokens: i64

Reasoning tokens.

§operation_name: String

gen_ai.operation.name value.

§system: String

gen_ai.system value.

§provider_name: String

gen_ai.provider.name value.

§response_model: String

gen_ai.response.model value.

§finish_reason: String

gen_ai.response.finish_reason value.

§finish_reasons: String

gen_ai.response.finish_reasons value.

§request_model: String

gen_ai.request.model value.

§provider_slug: String

openrouter.provider_slug value.

§openrouter_provider_name: String

openrouter.provider_name value.

§api_key_name: String

openrouter.api_key_name value.

§entity_id: String

openrouter.entity_id value.

§openrouter_user_id: String

openrouter.user_id value.

§openrouter_finish_reason: String

openrouter.finish_reason value.

§input_unit_price: f64

Per-input-token USD unit price.

§output_unit_price: f64

Per-output-token USD unit price.

§source: String

openrouter.source value (originating client/integration).

§prompt: String

Verbatim gen_ai.prompt payload.

§completion: String

Verbatim gen_ai.completion payload.

§span_type: String

span.type value.

§span_level: String

span.level value.

§span_input: String

span.input value.

§span_output: String

span.output value.

§trace_name: String

trace.name value.

§trace_input: String

trace.input value.

§trace_output: String

trace.output value.

§trace_tags: String

trace.tags value.

§user_id: String

user.id value.

§session_id: String

session.id value.

§metadata: BTreeMap<String, String>

Values from trace.metadata.* attributes (prefix stripped).

§span_metadata: BTreeMap<String, String>

Values from span.metadata.* attributes (prefix stripped).

§resource_attributes: BTreeMap<String, String>

Attributes from the OTLP resource.

§raw_attributes: BTreeMap<String, String>

All other span attributes not mapped to a named field.

Trait Implementations§

Source§

impl Clone for BroadcastTrace

Source§

fn clone(&self) -> BroadcastTrace

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 BroadcastTrace

Source§

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

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

impl Default for BroadcastTrace

Source§

fn default() -> BroadcastTrace

Returns the “default value” for a type. Read more
Source§

impl PartialEq for BroadcastTrace

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BroadcastTrace

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more