pub struct SpanAttributes {
pub kind: Option<String>,
pub attributes: HashMap<String, String>,
pub links: Vec<Link>,
pub carrier: Option<HashMap<String, String>>,
}Expand description
Data extracted from a Lambda event for span creation.
This struct contains all the information needed to create and configure an OpenTelemetry span, including custom attributes, span kind, links, and context propagation headers.
§Example
use lambda_otel_lite::SpanAttributes;
use std::collections::HashMap;
let mut attributes = HashMap::new();
attributes.insert("custom.field".to_string(), "value".to_string());
let span_attrs = SpanAttributes {
kind: Some("CLIENT".to_string()),
attributes,
..SpanAttributes::default()
};Fields§
§kind: Option<String>Optional span kind (defaults to SERVER if not provided)
attributes: HashMap<String, String>Custom attributes to add to the span
links: Vec<Link>Optional span links for connecting related traces
carrier: Option<HashMap<String, String>>Optional carrier headers for context propagation (W3C Trace Context format)
Trait Implementations§
Source§impl Default for SpanAttributes
impl Default for SpanAttributes
Source§fn default() -> SpanAttributes
fn default() -> SpanAttributes
Returns the “default value” for a type. Read more
Auto 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
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> 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