pub struct GlideOpenTelemetry {}Implementations§
Source§impl GlideOpenTelemetry
Our interface to OpenTelemetry
impl GlideOpenTelemetry
Our interface to OpenTelemetry
Sourcepub unsafe fn is_span_pointer_valid(span_ptr: u64) -> bool
pub unsafe fn is_span_pointer_valid(span_ptr: u64) -> bool
Validate if a span pointer is valid
§Arguments
span_ptr- The u64 span pointer to validate
§Returns
true- If the span pointer is valid (non-zero and within reasonable bounds)false- If the span pointer is invalid (zero, out of bounds, or potentially corrupted)
§Safety
This function performs basic validation but cannot guarantee the pointer points to valid memory. It only checks for obvious invalid values like null pointers and unreasonable addresses.
Sourcepub unsafe fn span_from_pointer(
span_ptr: u64,
) -> Result<GlideSpan, GlideOTELError>
pub unsafe fn span_from_pointer( span_ptr: u64, ) -> Result<GlideSpan, GlideOTELError>
Convert a span pointer to a GlideSpan with validation
§Arguments
span_ptr- The u64 span pointer to convert
§Returns
Ok(GlideSpan)- If the pointer is valid and conversion succeedsErr(TraceError)- If the pointer is invalid or conversion fails
§Safety
This function validates the pointer before attempting conversion, but still uses unsafe code
Sourcepub fn initialise(
config: GlideOpenTelemetryConfig,
) -> Result<(), GlideOTELError>
pub fn initialise( config: GlideOpenTelemetryConfig, ) -> Result<(), GlideOTELError>
Initialise the open telemetry library with a file system exporter
This method should be called once for the given process If OpenTelemetry is already initialized, this method will return Ok(()) without reinitializing
Sourcepub fn record_timeout_error() -> Result<(), GlideOTELError>
pub fn record_timeout_error() -> Result<(), GlideOTELError>
Record a timeout error
If OpenTelemetry is not initialized, this method will do nothing.
Sourcepub fn record_retry_attempt() -> Result<(), GlideOTELError>
pub fn record_retry_attempt() -> Result<(), GlideOTELError>
Record a retry attempt
If OpenTelemetry is not initialized, this method will do nothing.
Sourcepub fn record_moved_error() -> Result<(), GlideOTELError>
pub fn record_moved_error() -> Result<(), GlideOTELError>
Record a moved error
If OpenTelemetry is not initialized, this method will do nothing.
Sourcepub fn record_subscription_out_of_sync() -> Result<(), GlideOTELError>
pub fn record_subscription_out_of_sync() -> Result<(), GlideOTELError>
Record that subscriptions are out of sync
If OpenTelemetry is not initialized, this method will do nothing.
Sourcepub fn update_subscription_last_sync_timestamp() -> Result<(), GlideOTELError>
pub fn update_subscription_last_sync_timestamp() -> Result<(), GlideOTELError>
Update the timestamp of when subscriptions were last in sync
Records the current system time as a Unix timestamp in milliseconds.
If OpenTelemetry is not initialized, this method will do nothing.
Sourcepub fn get_flush_interval_ms(config: GlideOpenTelemetryConfig) -> Duration
pub fn get_flush_interval_ms(config: GlideOpenTelemetryConfig) -> Duration
Get the flush interval milliseconds
Sourcepub fn is_initialized() -> bool
pub fn is_initialized() -> bool
Check if OpenTelemetry is initialized
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GlideOpenTelemetry
impl RefUnwindSafe for GlideOpenTelemetry
impl Send for GlideOpenTelemetry
impl Sync for GlideOpenTelemetry
impl Unpin for GlideOpenTelemetry
impl UnsafeUnpin for GlideOpenTelemetry
impl UnwindSafe for GlideOpenTelemetry
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,
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