pub trait ObservabilityExtension: Extension {
// Required methods
fn counter_inc(&self, name: &str, value: u64, labels: &[(&str, &str)]);
fn gauge_set(&self, name: &str, value: f64, labels: &[(&str, &str)]);
fn histogram_observe(&self, name: &str, value: f64, labels: &[(&str, &str)]);
fn span_start(&self, name: &str, parent: Option<u64>) -> u64;
fn span_end(&self, span_id: u64);
fn span_event(&self, span_id: u64, name: &str, attributes: &[(&str, &str)]);
// Provided methods
fn log_debug(&self, message: &str, fields: &[(&str, &str)]) { ... }
fn log_info(&self, message: &str, fields: &[(&str, &str)]) { ... }
fn log_warn(&self, message: &str, fields: &[(&str, &str)]) { ... }
fn log_error(&self, message: &str, fields: &[(&str, &str)]) { ... }
fn report_health(&self, health: &HealthInfo) { ... }
}Expand description
Observability extension
Implement this for metrics, tracing, and logging backends.
§Why Plugin Architecture?
- No Dependency Bloat: Core doesn’t pull in Prometheus, DataDog, etc.
- Vendor Neutral: Users choose their observability stack
- Flexible: Can run without any observability in embedded scenarios
§Available Plugins (separate crates):
sochdb-prometheus: Prometheus metricssochdb-datadog: DataDog integrationsochdb-opentelemetry: OpenTelemetry supportsochdb-logging-json: JSON structured loggingsochdb-logging-logfmt: logfmt style logging
Required Methods§
Sourcefn counter_inc(&self, name: &str, value: u64, labels: &[(&str, &str)])
fn counter_inc(&self, name: &str, value: u64, labels: &[(&str, &str)])
Record a counter increment
Provided Methods§
Sourcefn report_health(&self, health: &HealthInfo)
fn report_health(&self, health: &HealthInfo)
Report health status (called periodically by kernel)