pub struct SpanEvent {Show 18 fields
pub timestamp: String,
pub trace_id: String,
pub span_id: String,
pub parent_span_id: Option<String>,
pub service: Arc<str>,
pub cloud_region: Option<Arc<str>>,
pub event_type: EventType,
pub operation: String,
pub target: String,
pub duration_us: u64,
pub source: EventSource,
pub status_code: Option<u16>,
pub response_size_bytes: Option<u64>,
pub code_function: Option<Arc<str>>,
pub code_filepath: Option<Arc<str>>,
pub code_lineno: Option<u32>,
pub code_namespace: Option<Arc<str>>,
pub instrumentation_scopes: Vec<Arc<str>>,
}Expand description
A single span event representing an I/O operation (SQL query, HTTP call).
Strings repeated across events of the same workload are stored as
Arc<str> for cheap clones, per-event-unique strings stay as String.
Fields§
§timestamp: String§trace_id: String§span_id: String§parent_span_id: Option<String>§service: Arc<str>§cloud_region: Option<Arc<str>>Cloud region this span was emitted from, sourced from the OTel
cloud.region resource attribute (or span attribute as fallback).
Used by the carbon scoring stage to apply per-region carbon
intensity coefficients in multi-region deployments. None when
the attribute is absent or when ingesting from formats that don’t
carry it (Jaeger, Zipkin, raw JSON without explicit field).
event_type: EventType§operation: StringSQL: db.system for OTLP (e.g. “postgresql”), verb for native JSON.
HTTP: request method (e.g. “GET”).
target: String§duration_us: u64§source: EventSource§status_code: Option<u16>§response_size_bytes: Option<u64>HTTP response body size in bytes, sourced from the OTel
http.response.body.size attribute (or legacy
http.response_content_length). Used by the carbon scoring stage
for HTTP payload size tier classification and network transport
energy estimation. None for SQL spans or when the attribute is
absent.
code_function: Option<Arc<str>>OTel code.function attribute.
code_filepath: Option<Arc<str>>OTel code.filepath attribute.
code_lineno: Option<u32>OTel code.lineno attribute.
code_namespace: Option<Arc<str>>OTel code.namespace attribute (e.g. Java package).
instrumentation_scopes: Vec<Arc<str>>OpenTelemetry instrumentation scope names captured at ingest time:
the leaf span’s scope at index 0, then each unique ancestor scope
up to a bounded depth. Lets framework detection identify Spring
Data, Hibernate, Quarkus, Helidon and friends from the
io.opentelemetry.<module> strings emitted by the agent, without
relying on user-code naming conventions.
Implementations§
Source§impl SpanEvent
impl SpanEvent
Sourcepub fn code_location(&self) -> Option<CodeLocation>
pub fn code_location(&self) -> Option<CodeLocation>
Build a CodeLocation from this span’s code_* fields.
Returns None when all four fields are absent.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SpanEvent
impl<'de> Deserialize<'de> for SpanEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for SpanEvent
impl StructuralPartialEq for SpanEvent
Auto Trait Implementations§
impl Freeze for SpanEvent
impl RefUnwindSafe for SpanEvent
impl Send for SpanEvent
impl Sync for SpanEvent
impl Unpin for SpanEvent
impl UnsafeUnpin for SpanEvent
impl UnwindSafe for SpanEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
T in a tonic::Request