pub struct TelemetryData {
pub source: String,
pub endpoint: String,
pub payload: Vec<u8>,
pub content_type: String,
pub content_encoding: Option<String>,
}Expand description
Core structure representing telemetry data to be forwarded
Fields§
§source: StringSource of the telemetry data (e.g., service name or log group)
endpoint: StringTarget endpoint for the telemetry data
payload: Vec<u8>The actual payload bytes
content_type: StringContent type of the payload
content_encoding: Option<String>Optional content encoding (e.g., gzip)
Implementations§
Source§impl TelemetryData
impl TelemetryData
Sourcepub fn compress(&mut self, compression_level: u32) -> Result<()>
pub fn compress(&mut self, compression_level: u32) -> Result<()>
Applies gzip compression to the payload
This should only be called on the final compacted payload to avoid unnecessary compression/decompression cycles.
Sourcepub fn from_log_record(record: ExporterOutput) -> Result<Self>
pub fn from_log_record(record: ExporterOutput) -> Result<Self>
Creates a TelemetryData instance from a LogRecord
Sourcepub fn from_raw_span(span: Value, log_group: &str) -> Result<Self>
pub fn from_raw_span(span: Value, log_group: &str) -> Result<Self>
Creates a TelemetryData instance from a raw span (as serialized JSON)
Trait Implementations§
Source§impl Clone for TelemetryData
impl Clone for TelemetryData
Source§fn clone(&self) -> TelemetryData
fn clone(&self) -> TelemetryData
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 moreSource§impl Debug for TelemetryData
impl Debug for TelemetryData
Auto Trait Implementations§
impl Freeze for TelemetryData
impl RefUnwindSafe for TelemetryData
impl Send for TelemetryData
impl Sync for TelemetryData
impl Unpin for TelemetryData
impl UnsafeUnpin for TelemetryData
impl UnwindSafe for TelemetryData
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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