pub struct FileSpanStore { /* private fields */ }Expand description
A SpanStore that persists each session’s records as a JSON-lines
file on disk.
File layout: <base_dir>/<session_id>.jsonl. Records are appended one
per line in serialization order; load reads them back in append order
and silently skips any malformed trailing line (the only way a partial
write can land is when the process is killed mid-write).
Implementations§
Source§impl FileSpanStore
impl FileSpanStore
Sourcepub fn new(base_dir: impl Into<PathBuf>) -> FileSpanStore
pub fn new(base_dir: impl Into<PathBuf>) -> FileSpanStore
Creates a new file-backed span store rooted at base_dir.
The directory is created lazily on the first write.
Trait Implementations§
Source§impl Debug for FileSpanStore
impl Debug for FileSpanStore
Source§impl SpanStore for FileSpanStore
impl SpanStore for FileSpanStore
Source§fn append(
&self,
session_id: &str,
record: &SpanRecord,
) -> Pin<Box<dyn Future<Output = Result<(), SpanStoreError>> + Send + '_>>
fn append( &self, session_id: &str, record: &SpanRecord, ) -> Pin<Box<dyn Future<Output = Result<(), SpanStoreError>> + Send + '_>>
Append one record to the given session’s history. Read more
Source§fn append_batch<'a>(
&'a self,
records: &'a [(String, SpanRecord)],
) -> Pin<Box<dyn Future<Output = Result<(), SpanStoreError>> + Send + 'a>>
fn append_batch<'a>( &'a self, records: &'a [(String, SpanRecord)], ) -> Pin<Box<dyn Future<Output = Result<(), SpanStoreError>> + Send + 'a>>
Append a batch of
(session_id, record) pairs durably. Read moreSource§fn load(
&self,
session_id: &str,
) -> Pin<Box<dyn Future<Output = Result<Vec<SpanRecord>, SpanStoreError>> + Send + '_>>
fn load( &self, session_id: &str, ) -> Pin<Box<dyn Future<Output = Result<Vec<SpanRecord>, SpanStoreError>> + Send + '_>>
Load every record stored for
session_id, in append order.Auto Trait Implementations§
impl Freeze for FileSpanStore
impl RefUnwindSafe for FileSpanStore
impl Send for FileSpanStore
impl Sync for FileSpanStore
impl Unpin for FileSpanStore
impl UnsafeUnpin for FileSpanStore
impl UnwindSafe for FileSpanStore
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.
impl<T> Output for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn propagate_header(self, header: HeaderName) -> PropagateHeader<Self>where
Self: Sized,
fn propagate_header(self, header: HeaderName) -> PropagateHeader<Self>where
Self: Sized,
Available on crate feature
propagate-header only.Propagate a header from the request to the response. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using gRPC headers. Read more
Source§fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
Available on crate feature
follow-redirect only.Source§fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
Available on crate feature
request-id only.Add request id header and extension. Read more
Source§fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
Available on crate feature
request-id only.Add request id header and extension, using
x-request-id as the header name. Read moreSource§fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
Available on crate feature
request-id only.Propgate request ids from requests to responses. Read more
Source§fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
Available on crate feature
request-id only.Propgate request ids from requests to responses, using
x-request-id as the header name. Read more