pub struct TelemetryStore { /* private fields */ }Expand description
Thread-safe in-memory telemetry store.
Stores recently-received OTLP data in bounded collections. The OTLP receiver writes to this store, and the OTLP client trait implementations read from it.
Implementations§
Source§impl TelemetryStore
impl TelemetryStore
Sourcepub fn new(config: StoreConfig) -> Arc<Self>
pub fn new(config: StoreConfig) -> Arc<Self>
Create a new telemetry store with the given configuration.
Sourcepub fn insert_trace(&self, trace: Trace)
pub fn insert_trace(&self, trace: Trace)
Insert or update a trace in the store.
Sourcepub fn search_traces(
&self,
service_name: Option<&str>,
operation_name: Option<&str>,
min_duration_us: Option<u64>,
max_duration_us: Option<u64>,
start_time_us: Option<u64>,
end_time_us: Option<u64>,
limit: usize,
) -> Vec<TraceSummary>
pub fn search_traces( &self, service_name: Option<&str>, operation_name: Option<&str>, min_duration_us: Option<u64>, max_duration_us: Option<u64>, start_time_us: Option<u64>, end_time_us: Option<u64>, limit: usize, ) -> Vec<TraceSummary>
Search traces matching the given criteria. Returns summaries.
Sourcepub fn trace_count(&self) -> usize
pub fn trace_count(&self) -> usize
Get the number of stored traces.
Sourcepub fn insert_logs(&self, entries: Vec<LogEntry>)
pub fn insert_logs(&self, entries: Vec<LogEntry>)
Insert log entries into the store.
Sourcepub fn query_logs(
&self,
start_ns: i64,
end_ns: i64,
labels: &FxHashMap<String, String>,
contains: Option<&str>,
limit: usize,
) -> Vec<LogEntry>
pub fn query_logs( &self, start_ns: i64, end_ns: i64, labels: &FxHashMap<String, String>, contains: Option<&str>, limit: usize, ) -> Vec<LogEntry>
Query logs matching the given filters.
Sourcepub fn known_log_labels(&self) -> Vec<String>
pub fn known_log_labels(&self) -> Vec<String>
Get all known label keys from stored logs.
Sourcepub fn insert_metric_point(&self, point: MetricDataPoint)
pub fn insert_metric_point(&self, point: MetricDataPoint)
Insert a metric data point into the store.
Sourcepub fn insert_metric_points(&self, points: Vec<MetricDataPoint>)
pub fn insert_metric_points(&self, points: Vec<MetricDataPoint>)
Insert a batch of metric data points.
Sourcepub fn metric_names(&self) -> Vec<String>
pub fn metric_names(&self) -> Vec<String>
Get all known metric names.
Sourcepub fn metric_label_names(&self, metric: &str) -> Vec<String>
pub fn metric_label_names(&self, metric: &str) -> Vec<String>
Get all known label names for a specific metric.
Sourcepub fn metric_label_values(&self, metric: &str, label: &str) -> Vec<String>
pub fn metric_label_values(&self, metric: &str, label: &str) -> Vec<String>
Get all known label values for a specific metric and label name.
Sourcepub fn query_metric(
&self,
metric: &str,
labels: &FxHashMap<String, String>,
start_ns: u64,
end_ns: u64,
step_ns: u64,
) -> QueryResponse
pub fn query_metric( &self, metric: &str, labels: &FxHashMap<String, String>, start_ns: u64, end_ns: u64, step_ns: u64, ) -> QueryResponse
Query a metric and return a QueryResponse compatible with the Prometheus format.
Sourcepub fn metric_series_count(&self) -> usize
pub fn metric_series_count(&self) -> usize
Get the number of stored metric time series.
Sourcepub fn metric_point_count(&self) -> usize
pub fn metric_point_count(&self) -> usize
Get the total number of stored metric data points.