Module metrics

Module metrics 

Source
Expand description

Prometheus metrics counters, histograms, gauges and tracing initialisation Prometheus metrics for stygian pipelines.

Provides a process-wide MetricsRegistry that tracks:

  • Counters: requests, errors, cache hits/misses
  • Histograms: request duration, pipeline execution time
  • Gauges: active workers, queue depth, circuit-breaker state

§Example

use stygian_graph::application::metrics::{MetricsRegistry, MetricEvent};

let registry = MetricsRegistry::new();
registry.record(MetricEvent::RequestStarted { service: "http".into() });
registry.record(MetricEvent::RequestCompleted {
    service: "http".into(),
    duration_ms: 142,
    success: true,
});

let snapshot = registry.snapshot();
assert_eq!(snapshot.requests_total, 1);
assert_eq!(snapshot.errors_total, 0);

Structs§

MetricsRegistry
Thread-safe registry for all pipeline metrics.
MetricsSnapshot
Point-in-time snapshot of all metric counters.
TracingInit
Tracing initialisation configuration.

Enums§

LogFormat
Log output format
MetricEvent
An observable event emitted by the pipeline engine.

Functions§

global_metrics
Process-wide global MetricsRegistry instance.