Skip to main content

Metrics

pg-kinetic exports Prometheus metrics when metrics_addr is configured.

[observability]
metrics_addr = "0.0.0.0:9090"

Scrape URL:

http://<host>:9090/metrics

Metric availability follows the active runtime paths. Metrics for preview-only or disabled paths can remain absent or zero.

Current Runtime Metrics

MetricTypeLabelsAvailabilityNotes
pg_kinetic_client_connections_totalcounternonelive proxyIncrements for accepted client connections.
pg_kinetic_pool_checkout_wait_mshistogramstage, outcomelive proxyMeasures checkout stages and outcomes.
pg_kinetic_pool_connectionsgaugestatelifecycle-aware poolCurrent backend connections by state: active or idle.
pg_kinetic_pool_evictions_totalcounterreasonlifecycle-aware poolIdle backend evictions by reason: idle_timeout or max_lifetime.
pg_kinetic_backpressure_events_totalcounterroute, outcomelive proxyRecords route overload, timeout, and cancellation outcomes.
pg_kinetic_route_checkout_wait_mshistogramroute, outcomelive proxyMeasures per-route wait time.
pg_kinetic_route_in_flightgaugeroute, scopelive proxyShows route in-flight work.
pg_kinetic_route_waitinggaugeroute, scopelive proxyShows route waiters.
pg_kinetic_route_shed_totalcounterroute, priorityroute fairnessCounts route shedding decisions for bounded priority classes.
pg_kinetic_timeout_totalcounterkindlive proxyRecords query, idle-client, and idle-transaction timeouts.
pg_kinetic_buffer_limit_totalcounterkindlive proxyRecords client/backend buffer cap hits.
pg_kinetic_query_count_totalcounterqueryquery analytics enabled by trafficCounts completed query fingerprints using bounded top-query buckets.
pg_kinetic_query_latency_mshistogramqueryquery analytics enabled by trafficMeasures elapsed query time for bounded fingerprint buckets.
pg_kinetic_query_rows_totalcounterqueryquery analytics enabled by trafficCounts returned rows for bounded fingerprint buckets.
pg_kinetic_query_errors_totalcounterqueryquery analytics enabled by trafficCounts failed query cycles for bounded fingerprint buckets.
pg_kinetic_guardrail_denials_totalcounterruleguardrails observe/enforce pathsCounts fixed guardrail denial categories.
pg_kinetic_route_decisions_totalcounterroute, target_role, query_classlive read routingRecords primary/replica routing decisions.
pg_kinetic_route_fallbacks_totalcounterroute, reason, fallback_policylive read routingRecords primary fallback, waits, and rejections.
pg_kinetic_read_after_write_wait_mshistogramroute, outcomelive read routingMeasures read-after-write waits.
pg_kinetic_read_after_write_rejections_totalcounterroute, outcomelive read routingRecords strict freshness rejections.
pg_kinetic_replica_healthgaugeendpoint, healthlive read routing with replicasShows replica probe health.
pg_kinetic_replica_lag_msgaugeendpoint, lag_statelive read routing with replicasShows replica lag state.
pg_kinetic_split_brain_warnings_totalcounterendpoint, target_role, reasonlive read routing with role probesNonzero values require operator review.
pg_kinetic_backend_pin_totalcounterreasonlive proxyCounts backend pin reasons.
pg_kinetic_backend_cleanup_totalcounteractionlive proxyCounts cleanup decisions.
pg_kinetic_backend_recovery_totalcountertrigger, action, outcomelive proxyCounts backend recovery paths.
pg_kinetic_backend_sqlstate_totalcountersqlstatelive proxyCounts normalized SQLSTATEs.
pg_kinetic_breaker_stategaugebackend, stateresilience enabled or backend snapshots recordedShows current per-backend circuit-breaker state.
pg_kinetic_breaker_fast_rejections_totalcounternoneresilience breaker openCounts requests rejected before backend checkout because the breaker is open.
pg_kinetic_hedge_decisions_totalcounteroutcome, reasonreserved hedge evaluatorReserved bounded hedge decision counter; duplicate backend forwarding remains disabled.
pg_kinetic_failover_survived_totalcounternonetransparent failover enabledCounts replay-safe requests that succeeded after a bounded backend replacement retry.
pg_kinetic_failover_failed_totalcounternonetransparent failover enabledCounts enabled failover attempts that could not safely complete.
pg_kinetic_tls_handshakes_totalcounterscope, modeTLS enabledCounts client/backend TLS handshakes.
pg_kinetic_tls_failures_totalcounterscope, mode, reasonTLS enabledCounts TLS failures.
pg_kinetic_auth_attempts_totalcountermodeauth path enabledCounts auth attempts.
pg_kinetic_auth_failures_totalcountermode, reasonauth path enabledCounts auth failures.
pg_kinetic_config_reload_totalcounteroutcomereload enabledapplied, rejected, unchanged, or error.
pg_kinetic_drain_stategaugestatelive proxyCurrent drain state.
pg_kinetic_health_statusgaugekind, statushealth enabledHealth and readiness status.
pg_kinetic_socket_option_totalcountersocket, option, outcomesocket options configuredSocket tuning results.
pg_kinetic_runtime_lifecycle_stategaugestatelive proxyRuntime lifecycle state.
pg_kinetic_runtime_readiness_stategaugestatelive proxyRuntime readiness state.
pg_kinetic_runtime_shutdown_totalcounterreasonshutdown pathShutdown reasons.
pg_kinetic_protocol_phase_duration_mshistogramphase, outcomelive proxy with metrics_addr configuredDetailed protocol phase timings. Controlled by observability.phase_timing_sample_rate; each session is either fully sampled or omitted, while core health, pool, error, and backpressure metrics remain available.
pg_kinetic_audit_records_totalcounternoneaudit enabledAccepted metadata-only records.
pg_kinetic_audit_dropped_totalcounternoneaudit enabledRecords dropped when the bounded audit queue is full.

Set phase_timing_sample_rate = 0.0 to disable detailed phase histogram samples while retaining the mandatory operational metrics. The default is 1.0. A session's phase sequence is sampled as one unit, so partial phase sequences are not produced by the sampler.

Preview Or Tooling Metrics

MetricStatus
pg_kinetic_shard_*Preview-only until sharding config is wired into live traffic.
pg_kinetic_route_map_*Preview/tooling until route-map reload is wired into live traffic.
pg_kinetic_mirror_*Can remain zero because live proxy constructs a disabled mirror dispatcher.
pg_kinetic_adaptive_*Recommendation/simulation only; apply counters do not mean active config was mutated.
pg_kinetic_benchmark_*Tooling metrics from benchmark commands, not proxy traffic.
pg_kinetic_performance_budget_statusTooling metric from report comparison, not proxy traffic.
pg_kinetic_preflight_findings_totalTooling metric from preflight checks.

Alert Starters

  • /readyz returns 503 or pg_kinetic_health_status{kind="ready"} is not ready.
  • pg_kinetic_backpressure_events_total{outcome="rejected"} increases.
  • pg_kinetic_pool_checkout_wait_ms p95 rises for stage="checkout".
  • pg_kinetic_pool_connections{state="idle"} approaches the configured minimum or pg_kinetic_pool_evictions_total rises unexpectedly.
  • pg_kinetic_tls_failures_total or pg_kinetic_auth_failures_total increases after a rollout.
  • pg_kinetic_config_reload_total{outcome="rejected"} increases.
  • pg_kinetic_split_brain_warnings_total is nonzero.