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: StringHex trace identifier.
span_id: StringHex span identifier.
parent_span_id: StringParent span identifier (empty for the root).
span_name: StringSpan name.
start_time_unix_nano: i64Start time as nanoseconds since the Unix epoch (0 when missing).
end_time_unix_nano: i64End time as nanoseconds since the Unix epoch (0 when missing).
duration: Durationend - start when both timestamps are present.
prompt_tokens: i64Deprecated: prompt tokens (use Self::input_tokens).
completion_tokens: i64Deprecated: completion tokens (use Self::output_tokens).
total_tokens: i64Total tokens (computed as input + output when absent upstream).
cost: f64Total cost in USD (alias of Self::total_cost).
model: StringResolved model id (prefers response.model over request.model).
input_tokens: i64Canonical input-token count.
output_tokens: i64Canonical output-token count.
total_cost: f64Total USD cost.
input_cost: f64Input-side USD cost.
output_cost: f64Output-side USD cost.
cached_tokens: i64Tokens served from cache.
audio_input_tokens: i64Audio-input tokens.
video_input_tokens: i64Video-input tokens.
image_output_tokens: i64Image-output tokens.
reasoning_tokens: i64Reasoning tokens.
operation_name: Stringgen_ai.operation.name value.
system: Stringgen_ai.system value.
provider_name: Stringgen_ai.provider.name value.
response_model: Stringgen_ai.response.model value.
finish_reason: Stringgen_ai.response.finish_reason value.
finish_reasons: Stringgen_ai.response.finish_reasons value.
request_model: Stringgen_ai.request.model value.
provider_slug: Stringopenrouter.provider_slug value.
openrouter_provider_name: Stringopenrouter.provider_name value.
api_key_name: Stringopenrouter.api_key_name value.
entity_id: Stringopenrouter.entity_id value.
openrouter_user_id: Stringopenrouter.user_id value.
openrouter_finish_reason: Stringopenrouter.finish_reason value.
input_unit_price: f64Per-input-token USD unit price.
output_unit_price: f64Per-output-token USD unit price.
source: Stringopenrouter.source value (originating client/integration).
prompt: StringVerbatim gen_ai.prompt payload.
completion: StringVerbatim gen_ai.completion payload.
span_type: Stringspan.type value.
span_level: Stringspan.level value.
span_input: Stringspan.input value.
span_output: Stringspan.output value.
trace_name: Stringtrace.name value.
trace_input: Stringtrace.input value.
trace_output: Stringtrace.output value.
trace.tags value.
user_id: Stringuser.id value.
session_id: Stringsession.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
impl Clone for BroadcastTrace
Source§fn clone(&self) -> BroadcastTrace
fn clone(&self) -> BroadcastTrace
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more