pub struct SpanAttributes {
pub provider: String,
pub model: String,
pub prompt: Option<String>,
pub system_prompt: Option<String>,
pub temperature: Option<f64>,
pub max_tokens: Option<u32>,
pub tools_count: usize,
pub images_count: usize,
}Expand description
OpenTelemetry span attributes for LLM requests
Fields§
§provider: StringProvider name (e.g., “openai”, “anthropic”)
model: StringModel name (e.g., “gpt-4”, “claude-3-opus”)
prompt: Option<String>Request prompt (truncated if too long)
system_prompt: Option<String>System prompt (truncated if too long)
temperature: Option<f64>Temperature parameter
max_tokens: Option<u32>Max tokens parameter
tools_count: usizeNumber of tools provided
images_count: usizeNumber of images provided
Implementations§
Source§impl SpanAttributes
impl SpanAttributes
Sourcepub fn from_request(provider: &str, model: &str, request: &LlmRequest) -> Self
pub fn from_request(provider: &str, model: &str, request: &LlmRequest) -> Self
Create span attributes from an LLM request
Sourcepub fn from_embedding_request(
provider: &str,
model: &str,
request: &EmbeddingRequest,
) -> Self
pub fn from_embedding_request( provider: &str, model: &str, request: &EmbeddingRequest, ) -> Self
Create span attributes from an embedding request
Trait Implementations§
Source§impl Clone for SpanAttributes
impl Clone for SpanAttributes
Source§fn clone(&self) -> SpanAttributes
fn clone(&self) -> SpanAttributes
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SpanAttributes
impl RefUnwindSafe for SpanAttributes
impl Send for SpanAttributes
impl Sync for SpanAttributes
impl Unpin for SpanAttributes
impl UnwindSafe for SpanAttributes
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