Statistics and Metrics Reference
Share link Geode provides comprehensive statistics and metrics for monitoring, optimization, and observability. This reference documents all available metrics, collection methods, and integration options.
Overview
Share link Metric Categories
Share link Category Purpose Collection Method Query Statistics Query performance analysis Automatic Storage Statistics Disk and memory usage Automatic Index Statistics Index efficiency Automatic + Manual Transaction Statistics ACID operations Automatic Connection Statistics Client connections Automatic System Statistics Resource utilization Automatic
Access Methods
Share link GQL Procedures : CALL db.stats.*Prometheus Endpoint : /metricsAdmin API : REST endpointsEXPLAIN/PROFILE : Per-query metricsQuery Statistics
Share link Global Query Statistics
Share link -- View overall query statistics
CALL db . stats . queries () ;
Output:
Metric Type Description total_queriesCounter Total queries executed successful_queriesCounter Successfully completed queries failed_queriesCounter Failed queries queries_in_progressGauge Currently executing queries avg_query_time_msGauge Average query latency p50_query_time_msGauge Median query latency p95_query_time_msGauge 95th percentile latency p99_query_time_msGauge 99th percentile latency max_query_time_msGauge Maximum observed latency
Query Type Breakdown
Share link -- Statistics by query type
CALL db . stats . queries . by_type () ;
Query Type Description MATCHRead queries CREATENode/relationship creation SETProperty updates DELETEDeletions MERGEUpsert operations CALLProcedure calls
Slow Query Log
Share link -- View slow queries ( > threshold )
CALL db . stats . slow_queries ( 100 ) ; -- threshold in ms
-- Configure slow query threshold
CALL db . config . set ( ' query . slow_threshold_ms ' , 100 ) ;
Slow Query Entry:
{
"timestamp" : "2026-01-28T10:30:00Z" ,
"query" : "MATCH (p:Person)-[:KNOWS*5]->(f) RETURN f" ,
"duration_ms" : 1523 ,
"rows_returned" : 10000 ,
"db_hits" : 500000 ,
"user" : "alice" ,
"client_ip" : "192.168.1.100"
}
Query Plan Statistics
Share link -- View cached query plans
CALL db . stats . query _plans () ;
Metric Description plan_cache_sizeNumber of cached plans plan_cache_hitsCache hit count plan_cache_missesCache miss count plan_cache_hit_rateHit rate percentage avg_plan_time_msAverage planning time
Storage Statistics
Share link Database Size
Share link -- Overall storage statistics
CALL db . stats . storage () ;
Output:
Metric Type Description data_size_bytesGauge Total data file size index_size_bytesGauge Total index size wal_size_bytesGauge Write-ahead log size total_size_bytesGauge Total disk usage page_countGauge Total pages allocated used_pagesGauge Pages with data free_pagesGauge Available pages fragmentation_ratioGauge Space fragmentation (0-1)
Graph Statistics
Share link -- Graph element counts
CALL db . stats . graph () ;
Metric Description node_countTotal nodes relationship_countTotal relationships label_countDistinct node labels relationship_type_countDistinct relationship types property_key_countDistinct property keys
Label Statistics
Share link -- Statistics per label
CALL db . stats . labels () ;
Per-label metrics:
Metric Description node_countNodes with this label avg_property_countAverage properties per node avg_relationship_countAverage relationships per node
Relationship Type Statistics
Share link -- Statistics per relationship type
CALL db . stats . relationship_types () ;
Per-type metrics:
Metric Description countRelationships of this type avg_property_countAverage properties per relationship
Index Statistics
Share link Index Overview
Share link -- All index statistics
CALL db . stats . indexes () ;
Per-index metrics:
Metric Type Description index_nameString Index identifier index_typeString btree, hash, fulltext, etc. labelString Target label propertyString Indexed property size_bytesGauge Index storage size entry_countGauge Number of indexed entries unique_valuesGauge Distinct indexed values null_countGauge NULL entries avg_values_per_keyGauge Average duplicates per key
Index Usage Statistics
Share link -- Index usage metrics
CALL db . stats . index_usage () ;
Metric Description readsIndex read operations scansFull index scans seeksPoint lookups range_scansRange query operations updatesIndex update operations last_usedTimestamp of last use
Index Health
Share link -- Check index health
CALL db . stats . index_health ( ' index_name ' ) ;
Metric Description Healthy Range fragmentationInternal fragmentation < 0.3 depthTree depth (B-tree) < 5 fill_factorPage fill ratio > 0.7 bloom_false_positive_rateBloom filter FP rate < 0.01
Manual Statistics Update
Share link -- Update statistics for all indexes
CALL db . stats . update () ;
-- Update statistics for specific label
CALL db . stats . update ( ' Person ' ) ;
-- Update specific index statistics
CALL db . index . analyze ( ' person_email_idx ' ) ;
Cardinality Estimation
Share link The query optimizer uses cardinality estimates for cost-based optimization.
Histogram Statistics
Share link -- View histograms for a property
CALL db . stats . histogram ( ' Person ' , ' age ' ) ;
Output:
Column Description bucket_minBucket lower bound bucket_maxBucket upper bound frequencyRow count in bucket cumulative_frequencyCumulative row count distinct_countDistinct values in bucket
Selectivity Estimates
Share link -- Estimate predicate selectivity
CALL db . stats . selectivity ( ' Person ' , ' age > 30 ' ) ;
Metric Description estimated_rowsRows matching predicate selectivityFraction of total (0-1) confidenceEstimate confidence (low/medium/high)
Statistics Configuration
Share link statistics :
auto_update : true
update_threshold : 10000 # Update after N modifications
sample_size : 1000 # Rows sampled for histograms
histogram_buckets : 100 # Number of histogram buckets
update_interval : 3600 # Auto-update interval (seconds)
Transaction Statistics
Share link -- Transaction statistics
CALL db . stats . transactions () ;
Metric Type Description active_transactionsGauge Currently open transactions total_commitsCounter Successful commits total_rollbacksCounter Rollbacks commit_rateGauge Commits per second avg_transaction_time_msGauge Average transaction duration deadlock_countCounter Deadlock occurrences lock_wait_time_msCounter Total lock wait time
Lock Statistics
Share link -- Current lock information
CALL db . stats . locks () ;
Metric Description active_locksCurrently held locks waiting_locksLock requests waiting lock_timeoutsLock timeout count avg_lock_wait_msAverage lock wait time
Connection Statistics
Share link -- Connection statistics
CALL db . stats . connections () ;
Metric Type Description active_connectionsGauge Currently connected clients total_connectionsCounter Total connections (lifetime) connection_errorsCounter Failed connection attempts max_connectionsGauge Connection limit available_connectionsGauge Available connection slots
Per-Client Statistics
Share link -- Statistics per connected client
CALL db . stats . clients () ;
Column Description client_idClient identifier userAuthenticated user ip_addressClient IP connected_atConnection timestamp queries_executedQuery count for session bytes_sentData sent to client bytes_receivedData received from client
System Metrics
Share link Resource Utilization
Share link -- System resource metrics
CALL db . stats . system () ;
Metric Type Description cpu_usage_percentGauge CPU utilization memory_used_bytesGauge Memory in use memory_available_bytesGauge Available memory memory_heap_bytesGauge Heap memory usage gc_pause_msHistogram GC pause times gc_countCounter GC cycles
I/O Statistics
Share link -- Disk I / O statistics
CALL db . stats . io () ;
Metric Type Description read_bytesCounter Bytes read from disk write_bytesCounter Bytes written to disk read_opsCounter Read operations write_opsCounter Write operations read_latency_msHistogram Read latency write_latency_msHistogram Write latency fsync_countCounter fsync operations fsync_latency_msHistogram fsync latency
Buffer Pool Statistics
Share link -- Buffer pool metrics
CALL db . stats . buffer_pool () ;
Metric Description pool_size_pagesTotal buffer pool pages used_pagesPages in use dirty_pagesModified pages pending write hit_rateBuffer cache hit rate evictionsPage evictions reads_from_diskCache misses
Prometheus Integration
Share link Metrics Endpoint
Share link Geode exposes metrics in Prometheus format at /metrics:
curl http://localhost:3141/metrics
Sample Output
Share link # HELP geode_queries_total Total queries executed
# TYPE geode_queries_total counter
geode_queries_total{status="success"} 1234567
geode_queries_total{status="error"} 123
# HELP geode_query_duration_seconds Query execution time
# TYPE geode_query_duration_seconds histogram
geode_query_duration_seconds_bucket{le="0.001"} 10000
geode_query_duration_seconds_bucket{le="0.01"} 50000
geode_query_duration_seconds_bucket{le="0.1"} 100000
geode_query_duration_seconds_bucket{le="1.0"} 120000
geode_query_duration_seconds_bucket{le="+Inf"} 123456
geode_query_duration_seconds_sum 12345.67
geode_query_duration_seconds_count 123456
# HELP geode_connections_active Active client connections
# TYPE geode_connections_active gauge
geode_connections_active 42
# HELP geode_storage_bytes Storage size in bytes
# TYPE geode_storage_bytes gauge
geode_storage_bytes{type="data"} 1073741824
geode_storage_bytes{type="index"} 268435456
geode_storage_bytes{type="wal"} 134217728
# HELP geode_nodes_total Total nodes in database
# TYPE geode_nodes_total gauge
geode_nodes_total 1000000
# HELP geode_relationships_total Total relationships
# TYPE geode_relationships_total gauge
geode_relationships_total 5000000
Prometheus Configuration
Share link # prometheus.yml
scrape_configs :
- job_name : 'geode'
static_configs :
- targets : [ 'geode-server:3141' ]
metrics_path : '/metrics'
scrape_interval : 15s
Available Prometheus Metrics
Share link Metric Name Type Labels Description geode_queries_totalCounter status Total queries geode_query_duration_secondsHistogram - Query latency geode_connections_activeGauge - Active connections geode_connections_totalCounter - Total connections geode_transactions_totalCounter status Transaction count geode_storage_bytesGauge type Storage usage geode_nodes_totalGauge label Node count geode_relationships_totalGauge type Relationship count geode_index_size_bytesGauge index Index sizes geode_buffer_pool_hit_ratioGauge - Cache hit rate geode_wal_size_bytesGauge - WAL size geode_gc_pause_secondsHistogram - GC pauses
Alerting Guidelines
Share link Recommended Alerts
Share link # Alert rules for Geode
groups :
- name : geode_alerts
rules :
# High query latency
- alert : GeodeHighQueryLatency
expr : histogram_quantile(0.95, geode_query_duration_seconds_bucket) > 1
for : 5m
labels :
severity : warning
annotations :
summary : "High query latency detected"
# Connection pool exhaustion
- alert : GeodeConnectionPoolLow
expr : geode_connections_active / geode_connections_max > 0.9
for : 5m
labels :
severity : critical
annotations :
summary : "Connection pool nearly exhausted"
# Storage space
- alert : GeodeStorageHigh
expr : geode_storage_bytes{type="data"} > 100e9
for : 1h
labels :
severity : warning
annotations :
summary : "Database storage exceeds 100GB"
# Buffer pool hit rate
- alert : GeodeLowCacheHitRate
expr : geode_buffer_pool_hit_ratio < 0.9
for : 10m
labels :
severity : warning
annotations :
summary : "Buffer pool hit rate below 90%"
Grafana Dashboards
Share link Key Panels
Share link Query Performance:
Queries per second (rate) Query latency percentiles (p50, p95, p99) Slow query count Error rate Storage:
Database size growth Index size breakdown WAL size Fragmentation ratio Resources:
Buffer pool hit rate Memory usage I/O throughput Connection count Example Dashboard JSON
Share link {
"dashboard" : {
"title" : "Geode Database" ,
"panels" : [
{
"title" : "Query Rate" ,
"type" : "graph" ,
"targets" : [
{
"expr" : "rate(geode_queries_total[5m])" ,
"legendFormat" : "{{status}}"
}
]
},
{
"title" : "Query Latency (p95)" ,
"type" : "graph" ,
"targets" : [
{
"expr" : "histogram_quantile(0.95, rate(geode_query_duration_seconds_bucket[5m]))"
}
]
}
]
}
}
Best Practices
Share link Statistics Collection
Share link Enable auto-update for query optimizer accuracyMonitor slow queries with appropriate thresholdsTrack index usage to identify unused indexesSet up alerting for critical metricsBaseline metrics during normal operationTrack trends over timeCorrelate metrics (e.g., latency vs. connection count)Review after changes (schema, indexes, configuration)Capacity Planning
Share link Monitor storage growth rateTrack query volume trendsPlan index storage needsSize buffer pool based on working setLast Updated: January 28, 2026
Geode Version: v0.1.3+
Metrics Count: 50+ observable metrics