pub struct PrometheusMetrics {Show 28 fields
pub nodes_created: IntCounter,
pub edges_created: IntCounter,
pub prompts_submitted: IntCounter,
pub responses_generated: IntCounter,
pub tools_invoked: IntCounter,
pub agent_handoffs: IntCounter,
pub template_instantiations: IntCounter,
pub queries_executed: IntCounter,
pub write_latency: Histogram,
pub read_latency: Histogram,
pub query_duration: Histogram,
pub tool_duration: Histogram,
pub batch_size: Histogram,
pub active_sessions: IntGauge,
pub total_nodes: IntGauge,
pub total_edges: IntGauge,
pub cache_size_bytes: IntGauge,
pub buffer_size: IntGauge,
pub grpc_requests_total: IntCounterVec,
pub grpc_request_duration: HistogramVec,
pub grpc_active_streams: IntGauge,
pub plugin_executions_total: IntCounterVec,
pub plugin_duration: HistogramVec,
pub plugin_errors_total: IntCounterVec,
pub registry_calls_total: IntCounterVec,
pub vault_archives_total: IntCounter,
pub vault_retrievals_total: IntCounter,
pub vault_errors_total: IntCounter,
}Expand description
Prometheus metrics for MemoryGraph monitoring
Provides comprehensive production-grade metrics across multiple categories:
- 8 Counters for tracking operations
- 5 Histograms for latency and size distributions
- 5 Gauges for current state monitoring
- 7 Production metrics (gRPC, Plugin, Integration)
Fields§
§nodes_created: IntCounterTotal number of nodes created
edges_created: IntCounterTotal number of edges created
prompts_submitted: IntCounterTotal number of prompts submitted
responses_generated: IntCounterTotal number of responses generated
tools_invoked: IntCounterTotal number of tools invoked
agent_handoffs: IntCounterTotal number of agent handoffs
template_instantiations: IntCounterTotal number of template instantiations
queries_executed: IntCounterTotal number of queries executed
write_latency: HistogramWrite operation latency distribution (seconds)
read_latency: HistogramRead operation latency distribution (seconds)
query_duration: HistogramQuery execution duration distribution (seconds)
tool_duration: HistogramTool execution duration distribution (seconds)
batch_size: HistogramBatch operation size distribution
active_sessions: IntGaugeNumber of currently active sessions
total_nodes: IntGaugeTotal number of nodes in the graph
total_edges: IntGaugeTotal number of edges in the graph
cache_size_bytes: IntGaugeCurrent cache size in bytes
buffer_size: IntGaugeCurrent event buffer size
grpc_requests_total: IntCounterVecTotal gRPC requests by method and status
grpc_request_duration: HistogramVecgRPC request duration by method
grpc_active_streams: IntGaugeNumber of active gRPC streams
plugin_executions_total: IntCounterVecTotal plugin executions by plugin name and hook
plugin_duration: HistogramVecPlugin execution duration by plugin and hook
plugin_errors_total: IntCounterVecTotal plugin errors by plugin and error type
registry_calls_total: IntCounterVecTotal LLM-Registry API calls by operation and status
vault_archives_total: IntCounterTotal sessions archived to Data-Vault
vault_retrievals_total: IntCounterTotal sessions retrieved from Data-Vault
vault_errors_total: IntCounterTotal Data-Vault errors
Implementations§
Source§impl PrometheusMetrics
impl PrometheusMetrics
Sourcepub fn with_namespace(registry: &Registry, _namespace: &str) -> Result<Self>
pub fn with_namespace(registry: &Registry, _namespace: &str) -> Result<Self>
Create metrics with a custom namespace prefix
Sourcepub fn record_node_created(&self)
pub fn record_node_created(&self)
Record a node creation
Sourcepub fn record_nodes_created(&self, count: u64)
pub fn record_nodes_created(&self, count: u64)
Record multiple node creations
Sourcepub fn record_edge_created(&self)
pub fn record_edge_created(&self)
Record an edge creation
Sourcepub fn record_edges_created(&self, count: u64)
pub fn record_edges_created(&self, count: u64)
Record multiple edge creations
Sourcepub fn record_prompt_submitted(&self)
pub fn record_prompt_submitted(&self)
Record a prompt submission
Sourcepub fn record_response_generated(&self)
pub fn record_response_generated(&self)
Record a response generation
Sourcepub fn record_tool_invoked(&self)
pub fn record_tool_invoked(&self)
Record a tool invocation
Sourcepub fn record_agent_handoff(&self)
pub fn record_agent_handoff(&self)
Record an agent handoff
Sourcepub fn record_template_instantiation(&self)
pub fn record_template_instantiation(&self)
Record a template instantiation
Sourcepub fn record_query_executed(&self)
pub fn record_query_executed(&self)
Record a query execution
Sourcepub fn record_write_latency(&self, duration_secs: f64)
pub fn record_write_latency(&self, duration_secs: f64)
Record write operation latency in seconds
Sourcepub fn record_read_latency(&self, duration_secs: f64)
pub fn record_read_latency(&self, duration_secs: f64)
Record read operation latency in seconds
Sourcepub fn record_query_duration(&self, duration_secs: f64)
pub fn record_query_duration(&self, duration_secs: f64)
Record query execution duration in seconds
Sourcepub fn record_tool_duration(&self, duration_secs: f64)
pub fn record_tool_duration(&self, duration_secs: f64)
Record tool execution duration in seconds
Sourcepub fn record_batch_size(&self, size: usize)
pub fn record_batch_size(&self, size: usize)
Record batch operation size
Sourcepub fn set_active_sessions(&self, count: i64)
pub fn set_active_sessions(&self, count: i64)
Set the number of active sessions
Sourcepub fn inc_active_sessions(&self)
pub fn inc_active_sessions(&self)
Increment active sessions count
Sourcepub fn dec_active_sessions(&self)
pub fn dec_active_sessions(&self)
Decrement active sessions count
Sourcepub fn set_total_nodes(&self, count: i64)
pub fn set_total_nodes(&self, count: i64)
Set the total number of nodes
Sourcepub fn inc_total_nodes(&self)
pub fn inc_total_nodes(&self)
Increment total nodes count
Sourcepub fn inc_total_nodes_by(&self, count: i64)
pub fn inc_total_nodes_by(&self, count: i64)
Increment total nodes by amount
Sourcepub fn set_total_edges(&self, count: i64)
pub fn set_total_edges(&self, count: i64)
Set the total number of edges
Sourcepub fn inc_total_edges(&self)
pub fn inc_total_edges(&self)
Increment total edges count
Sourcepub fn inc_total_edges_by(&self, count: i64)
pub fn inc_total_edges_by(&self, count: i64)
Increment total edges by amount
Sourcepub fn set_cache_size_bytes(&self, size: i64)
pub fn set_cache_size_bytes(&self, size: i64)
Set cache size in bytes
Sourcepub fn set_buffer_size(&self, size: i64)
pub fn set_buffer_size(&self, size: i64)
Set event buffer size
Sourcepub fn record_grpc_request(&self, method: &str, status: &str)
pub fn record_grpc_request(&self, method: &str, status: &str)
Record a gRPC request with method and status
Sourcepub fn record_grpc_request_duration(&self, method: &str, duration_secs: f64)
pub fn record_grpc_request_duration(&self, method: &str, duration_secs: f64)
Record gRPC request duration for a method
Sourcepub fn inc_grpc_active_streams(&self)
pub fn inc_grpc_active_streams(&self)
Increment active gRPC streams count
Sourcepub fn dec_grpc_active_streams(&self)
pub fn dec_grpc_active_streams(&self)
Decrement active gRPC streams count
Sourcepub fn set_grpc_active_streams(&self, count: i64)
pub fn set_grpc_active_streams(&self, count: i64)
Set the number of active gRPC streams
Sourcepub fn record_plugin_execution(&self, plugin: &str, hook: &str)
pub fn record_plugin_execution(&self, plugin: &str, hook: &str)
Record a plugin execution
Sourcepub fn record_plugin_duration(
&self,
plugin: &str,
hook: &str,
duration_secs: f64,
)
pub fn record_plugin_duration( &self, plugin: &str, hook: &str, duration_secs: f64, )
Record plugin execution duration
Sourcepub fn record_plugin_error(&self, plugin: &str, error_type: &str)
pub fn record_plugin_error(&self, plugin: &str, error_type: &str)
Record a plugin error
Sourcepub fn record_registry_call(&self, operation: &str, status: &str)
pub fn record_registry_call(&self, operation: &str, status: &str)
Record an LLM-Registry API call
Sourcepub fn record_vault_archive(&self)
pub fn record_vault_archive(&self)
Record a successful vault archive operation
Sourcepub fn record_vault_archives(&self, count: u64)
pub fn record_vault_archives(&self, count: u64)
Record multiple vault archive operations
Sourcepub fn record_vault_retrieval(&self)
pub fn record_vault_retrieval(&self)
Record a successful vault retrieval operation
Sourcepub fn record_vault_retrievals(&self, count: u64)
pub fn record_vault_retrievals(&self, count: u64)
Record multiple vault retrieval operations
Sourcepub fn record_vault_error(&self)
pub fn record_vault_error(&self)
Record a vault error
Sourcepub fn record_vault_errors(&self, count: u64)
pub fn record_vault_errors(&self, count: u64)
Record multiple vault errors
Sourcepub fn get_counter_snapshot(&self) -> MetricsCounterSnapshot
pub fn get_counter_snapshot(&self) -> MetricsCounterSnapshot
Get a snapshot of all counter values
Sourcepub fn get_gauge_snapshot(&self) -> MetricsGaugeSnapshot
pub fn get_gauge_snapshot(&self) -> MetricsGaugeSnapshot
Get a snapshot of all gauge values
Sourcepub fn get_grpc_snapshot(&self) -> GrpcMetricsSnapshot
pub fn get_grpc_snapshot(&self) -> GrpcMetricsSnapshot
Get a snapshot of gRPC metrics
Sourcepub fn get_vault_snapshot(&self) -> VaultMetricsSnapshot
pub fn get_vault_snapshot(&self) -> VaultMetricsSnapshot
Get a snapshot of vault metrics
Trait Implementations§
Source§impl Clone for PrometheusMetrics
impl Clone for PrometheusMetrics
Source§fn clone(&self) -> PrometheusMetrics
fn clone(&self) -> PrometheusMetrics
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more