Skip to main content

TraceRepository

Trait TraceRepository 

Source
pub trait TraceRepository: Send + Sync {
    // Required methods
    fn store_trace<'life0, 'life1, 'async_trait>(
        &'life0 self,
        trace: &'life1 TraceEvent,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn store_span<'life0, 'life1, 'async_trait>(
        &'life0 self,
        span: &'life1 TraceSpan,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn query_traces<'life0, 'life1, 'async_trait>(
        &'life0 self,
        query: &'life1 TraceQuery,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<TraceEvent>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn query_spans<'life0, 'life1, 'async_trait>(
        &'life0 self,
        query: &'life1 TraceQuery,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<TraceSpan>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_trace<'life0, 'async_trait>(
        &'life0 self,
        tenant_id: TenantId,
        trace_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Option<TraceEvent>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_span<'life0, 'async_trait>(
        &'life0 self,
        tenant_id: TenantId,
        span_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Option<TraceSpan>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete_traces_before<'life0, 'async_trait>(
        &'life0 self,
        tenant_id: TenantId,
        before: DateTime<Utc>,
    ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_stats<'life0, 'async_trait>(
        &'life0 self,
        tenant_id: TenantId,
    ) -> Pin<Box<dyn Future<Output = Result<StorageStats>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn health_check<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Repository for trace and span storage (analytical, high-volume data).

Dev/Lite: SQLite. Production: ClickHouse.

Required Methods§

Source

fn store_trace<'life0, 'life1, 'async_trait>( &'life0 self, trace: &'life1 TraceEvent, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Store a trace event with all its spans.

Source

fn store_span<'life0, 'life1, 'async_trait>( &'life0 self, span: &'life1 TraceSpan, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Store a single trace span.

Source

fn query_traces<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 TraceQuery, ) -> Pin<Box<dyn Future<Output = Result<Vec<TraceEvent>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Query traces with filters.

Source

fn query_spans<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 TraceQuery, ) -> Pin<Box<dyn Future<Output = Result<Vec<TraceSpan>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Query spans with filters.

Source

fn get_trace<'life0, 'async_trait>( &'life0 self, tenant_id: TenantId, trace_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<TraceEvent>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get a specific trace by ID.

Source

fn get_span<'life0, 'async_trait>( &'life0 self, tenant_id: TenantId, span_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<TraceSpan>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get a specific span by ID.

Source

fn delete_traces_before<'life0, 'async_trait>( &'life0 self, tenant_id: TenantId, before: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete traces older than the specified time.

Source

fn get_stats<'life0, 'async_trait>( &'life0 self, tenant_id: TenantId, ) -> Pin<Box<dyn Future<Output = Result<StorageStats>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get storage statistics for a tenant.

Source

fn health_check<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Health check for the trace repository.

Implementors§