UltipaDocs
Products
Solutions
Resources
Company
Start Free Trial
UltipaDocs
Start Free Trial
  • Introduction
  • Database Installation
  • Deployment Topologies
  • Clustering
  • Cloud Deployments
  • Database Info
  • Backup & Restore
  • Monitoring
  • Performance
  • Diagnostics and Repair
  1. Docs
  2. /
  3. Operations

Monitoring

GQLDB exposes a layered monitoring surface: logs for events, Prometheus-style metrics for time series, gRPC health checks for liveness, and GQL-visible introspection for state. This page is the index: what each surface gives you, how to enable / scrape it, and which alerts are worth wiring.

Surfaces at a Glance

SurfaceShapeBest for
LogsText lines on stderr or rotated log files.Operational events, errors, startup / shutdown.
MetricsPrometheus-style gauges / counters via in-process collectors.Throughput, latency, heap / GC, cache hit rate.
Health checkgRPC HealthService.Check (extended with HA fields in HA mode).Liveness / readiness for load balancers, k8s probes, oncall paging.
Database InfoFunctions db.version(), db.license(), db.plugins(), db.stats(), db.overview(), etc.Synchronous state probes from dashboards or pre-flight checks.
HA telemetrySHOW HA STATUS, SHOW HA LOG TAIL, SHOW HA SNAPSHOTS, plus HAService.GetStatus / GetReplicationLag gRPCs.Cluster topology, leader / follower state, replication lag.
Query managementSHOW QUERIES, KILL QUERY <id>.Identifying and stopping slow / runaway queries in real time.

Production monitoring is rarely a single surface. The default stack is: metrics scraped into Prometheus + Grafana, logs shipped to a search backend (Loki, OpenSearch), health checks driving the load balancer, and SHOW HA STATUS polled on a slower cadence for on-call dashboards.

For a starting alert set built on these surfaces, see Alert-Worthy Signals.

Logs

The fastest path to a problem is usually the log. GQLDB writes structured lines (timestamp, level, subsystem, message) to stderr by default. Configure routing and rotation at startup; see Database Installation → See All Flags for the full flag table.

FlagDefaultWhat it does
-log-levelinfodebug / info / warn / error. Drop to debug during incident triage; keep at info in steady state.
-log-formattextOutput format: text or json. Use json for ingestion by log shippers / search backends.
-log-sourcefalseInclude the source file:line in each log line. Useful for debugging; adds overhead in steady state.
-log-file(stderr)Directory for rotated log files. Empty → stderr only.
-log-max-size100 (MB)Per-file size cap before rotation.
-log-max-files10Retained rotated file count.

For ad-hoc local testing, shell redirection (> gqldb.log 2>&1) captures everything (stderr logs, stdout banners, panic traces) into one flat file. For production, set -log-file to a directory and let the rotation flags do the work; pair with a log shipper to push files into your search backend.

Metrics

GQLDB runs an in-process Monitor that aggregates metrics from registered MetricsCollectors on a configurable interval (default 10s). Two collectors are built-in: query and hardware. Metric names are Prometheus-style (ultipagqldb_*) with gauge or counter types. Scrape them via the Prometheus endpoint (see Scraping).

Reading Metrics with SHOW STATS

SHOW STATS returns a snapshot of the collected metrics in-band as a query result — one row per metric, with columns category, metric, and value. Pass a category to filter to a single collector:

GQL
SHOW STATS              -- all metrics
SHOW STATS QUERY        -- query throughput / latency / errors
SHOW STATS HARDWARE     -- heap, GC, goroutines, CPU

Only the registered collectors have data, so QUERY and HARDWARE are the categories that return rows. Use SHOW STATS for ad-hoc checks from a GQL session; use the Prometheus endpoint for continuous monitoring.

Query Metrics

Emitted by the QueryCollector:

NameTypeWhat it measures
ultipagqldb_queries_totalCounterCumulative queries served since process start.
ultipagqldb_query_latency_avg_msGaugeRolling average query latency in milliseconds.
ultipagqldb_queries_activeGaugeCurrently executing query count.
ultipagqldb_query_errors_totalCounterCumulative query errors.
ultipagqldb_queries_per_secondGaugeRecent QPS.

Hardware / Runtime Metrics

Emitted by the HardwareCollector:

NameTypeWhat it measures
ultipagqldb_heap_alloc_bytesGaugeCurrently allocated heap. Cross-check against -mem-limit-bytes.
ultipagqldb_heap_sys_bytesGaugeHeap memory obtained from the OS.
ultipagqldb_heap_objectsGaugeLive heap object count.
ultipagqldb_gc_cycles_totalCounterCompleted GC cycles.
ultipagqldb_gc_pause_total_nsCounterCumulative GC pause time. Watch for upward inflection.
ultipagqldb_goroutinesGaugeLive goroutine count. Sustained climb = leak.
ultipagqldb_num_cpuGaugeCPU count available to the process.

Hardware samples are cached for 1 s — multiple Snapshot() calls inside a second return the same numbers, avoiding repeated runtime.ReadMemStats cost.

Scraping

The metrics endpoint is served by the gRPC server layer. Point your Prometheus job at the configured endpoint (consult the install or your operator); a default config typically scrapes every 15–30 s.

A snapshot is collected on demand each scrape — the 10s collection ticker is a pacing hint, not a hard cadence. Metric timestamps are server-side, so clock skew between scrapers shows up as a per-metric attribute.

Custom Collectors

Monitor.RegisterCollector(collector MetricsCollector) accepts any type implementing the MetricsCollector interface (Name, Category, Collect). Vendor / customer-deployed plugins can add their own metric family without touching the server build.

Health Checks

Standard gRPC HealthService.Check returns SERVING / NOT_SERVING. In HA mode, the response metadata is extended with:

FieldMeaning
roleleader, follower, learner, or witness.
lag_bytesReplication lag in bytes for this node.
compute_readyWhether the compute engine has finished its topology build for the bound graph.

Compatible with any standard gRPC health probe (k8s readiness/liveness, ELB/NLB target groups, grpc-health-probe). The base SERVING / NOT_SERVING behavior is preserved for tooling that doesn't know about the HA extension.

Use it as liveness (server responds at all). Use compute_ready = true + a sensible lag_bytes ceiling as readiness if you don't want a node to take traffic before its caches are warm.

Alert-Worthy Signals

A starting alert set:

AlertRuleWhy
Server downup{job="gqldb"} == 0 for > 1 min.Process or scrape endpoint gone.
No leader (HA)SHOW HA STATUS returns no leader for > 1 election timeout.Cluster can't accept writes.
Replication lag highlag_bytes > workload ceiling for > 5 min.Follower falling behind; failover would lose data.
Error rate climbingrate(ultipagqldb_query_errors_total[5m]) / rate(ultipagqldb_queries_total[5m]) > 0.05.Workload regression or client misuse.
Latency spikeultipagqldb_query_latency_avg_ms above a baseline percentile.Slow query, contention, or stale stats.
Memory near limitultipagqldb_heap_alloc_bytes approaching -mem-limit-bytes for > 5 min.Risk of OOM or rejected operations.
GC pause climbingrate(ultipagqldb_gc_pause_total_ns[5m]) above baseline.Heap pressure or large allocations.
Cache hit rate droppingPlan cache hit rate < 50 %.Workload is parameter-thin — promote query parameterization on the client.

Tune the thresholds to your workload; the rule shapes above are the starting point.