# Prometheus Metrics

## Postgres 
<table><thead><tr><th width="220">Metric</th>
                                          <th width="140">Update frequency</th>
                                          <th width="80">Type</th>
                                          <th>Description</th></tr></thead>
             <tbody><tr><td><code>pg_activity_count</code></td><td>continuous</td><td>gauge</td><td></td></tr><tr><td><code>pg_activity_max</code></td><td>every hour</td><td>gauge</td><td>max_connections</td></tr><tr><td><code>pg_blks_hit</code></td><td>continuous</td><td>counter</td><td></td></tr><tr><td><code>pg_blks_read</code></td><td>continuous</td><td>counter</td><td></td></tr><tr><td><code>pg_cluster_size</code></td><td>continuous</td><td>gauge</td><td>Cluster size</td></tr><tr><td><code>pg_database_size</code></td><td>every hour</td><td>gauge</td><td>Database size</td></tr><tr><td><code>pg_deletes_total</code></td><td>continuous</td><td>counter</td><td>Total number of rows deleted from PostgreSQL</td></tr><tr><td><code>pg_errors_total</code></td><td>continuous</td><td>counter</td><td>Total number of PostgreSQL errors</td></tr><tr><td><code>pg_idx_scan</code></td><td>every minute</td><td>counter</td><td>Number of index scans on a table</td></tr><tr><td><code>pg_inserts_total</code></td><td>continuous</td><td>counter</td><td>Total number of rows inserted in PostgreSQL</td></tr><tr><td><code>pg_replication_flush_lag_bytes</code></td><td>continuous</td><td>gauge</td><td>Number of bytes standby lags behind primary in flush phase</td></tr><tr><td><code>pg_replication_flush_lag_seconds</code></td><td>continuous</td><td>gauge</td><td>Number of seconds standby lags behind primary in flush phase</td></tr><tr><td><code>pg_replication_pending_lag_bytes</code></td><td>continuous</td><td>gauge</td><td>Number of bytes standby lags behind primary in pending phase</td></tr><tr><td><code>pg_replication_replay_lag_bytes</code></td><td>continuous</td><td>gauge</td><td>Number of bytes standby lags behind primary in replay phase</td></tr><tr><td><code>pg_replication_replay_lag_seconds</code></td><td>continuous</td><td>gauge</td><td>Number of seconds standby lags behind primary in replay phase</td></tr><tr><td><code>pg_replication_total_lag_bytes</code></td><td>continuous</td><td>gauge</td><td>Number of bytes standby lags behind primary in total</td></tr><tr><td><code>pg_replication_total_lag_seconds</code></td><td>continuous</td><td>gauge</td><td>Number of seconds standby lags behind primary in total</td></tr><tr><td><code>pg_replication_write_lag_bytes</code></td><td>continuous</td><td>gauge</td><td>Number of bytes standby lags behind primary in write phase</td></tr><tr><td><code>pg_replication_write_lag_seconds</code></td><td>continuous</td><td>gauge</td><td>Number of seconds standby lags behind primary in write phase</td></tr><tr><td><code>pg_requests_duration_seconds_sum</code></td><td>continuous</td><td>counter</td><td>Requests duration sum</td></tr><tr><td><code>pg_requests_duration_seconds_total</code></td><td>continuous</td><td>counter</td><td>Requests duration total</td></tr><tr><td><code>pg_requests_total</code></td><td>continuous</td><td>counter</td><td>Total number of PostgreSQL requests</td></tr><tr><td><code>pg_seq_scan</code></td><td>every minute</td><td>counter</td><td>Number of sequential scans on a table</td></tr><tr><td><code>pg_stat_statements_mean_execution_time</code></td><td>every minute</td><td>gauge</td><td>Mean exec time</td></tr><tr><td><code>pg_stat_statements_stddev_execution_time</code></td><td>every minute</td><td>gauge</td><td>stddev exec time</td></tr><tr><td><code>pg_stat_statements_total_calls</code></td><td>every minute</td><td>counter</td><td>Total calls</td></tr><tr><td><code>pg_table_size</code></td><td>every hour</td><td>gauge</td><td>Table size</td></tr><tr><td><code>pg_tup_fetched</code></td><td>continuous</td><td>counter</td><td>Total number of tuples fetched from PostgreSQL</td></tr><tr><td><code>pg_tup_returned</code></td><td>continuous</td><td>counter</td><td>Total number of tuples returned from PostgreSQL</td></tr><tr><td><code>pg_updates_total</code></td><td>continuous</td><td>counter</td><td>Total number of rows updated in PostgreSQL</td></tr></tbody></table>

## JVM 
<table><thead><tr><th width="220">Metric</th>
                                          <th width="140">Update frequency</th>
                                          <th width="80">Type</th>
                                          <th>Description</th></tr></thead>
             <tbody><tr><td><code>httpkit_core_size</code></td><td>every hour</td><td>gauge</td><td>The core number of threads in the pool</td></tr><tr><td><code>httpkit_max_size</code></td><td>every hour</td><td>gauge</td><td>The maximum number of threads allowed</td></tr><tr><td><code>jvm_available_processors_size</code></td><td>every hour</td><td>gauge</td><td>The maximum number of processors available</td></tr><tr><td><code>jvm_cpu_time</code></td><td>continuous</td><td>counter</td><td>CPU time used by the process on which the JVM is running</td></tr><tr><td><code>jvm_cpu_utilization</code></td><td>continuous</td><td>histogam</td><td>Recent CPU utilization for the whole system as reported by the JVM</td></tr><tr><td><code>jvm_gc_count</code></td><td>continuous</td><td>gauge</td><td>The total number of collections that have occurred</td></tr><tr><td><code>jvm_gc_duration</code></td><td>continuous</td><td>histogram</td><td>The approximate accumulated collection elapsed time</td></tr><tr><td><code>jvm_gc_time</code></td><td>continuous</td><td>gauge</td><td>The approximate accumulated collection elapsed time</td></tr><tr><td><code>jvm_heap_memory</code></td><td>continuous</td><td>gauge</td><td>The current memory usage of the heap that is used for object allocation</td></tr><tr><td><code>jvm_max_memory_size</code></td><td>every hour</td><td>gauge</td><td>The maximum amount of memory that the JVM  will attempt to use</td></tr><tr><td><code>jvm_non_heap_memory</code></td><td>continuous</td><td>gauge</td><td>The current memory usage of non-heap memory that is used by the JVM</td></tr><tr><td><code>jvm_system_cpu_utilization</code></td><td>continuous</td><td>histogam</td><td>Recent CPU utilization for the whole system as reported by the JVM</td></tr><tr><td><code>jvm_thread_by_state_count</code></td><td>continuous</td><td>gauge</td><td>Number of executing platform threads by state</td></tr><tr><td><code>jvm_thread_count</code></td><td>continuous</td><td>gauge</td><td>The current number of live threads</td></tr><tr><td><code>jvm_thread_daemon_count</code></td><td>continuous</td><td>gauge</td><td>The current number of live daemon threads</td></tr><tr><td><code>jvm_thread_peak_count</code></td><td>continuous</td><td>gauge</td><td>The peak live thread count</td></tr><tr><td><code>jvm_total_memory_size</code></td><td>every hour</td><td>gauge</td><td>The total amount of memory in the JVM</td></tr><tr><td><code>system_memory_utilization</code></td><td>continuous</td><td>gauge</td><td></td></tr></tbody></table>

## HTTP 
<table><thead><tr><th width="220">Metric</th>
                                          <th width="140">Update frequency</th>
                                          <th width="80">Type</th>
                                          <th>Description</th></tr></thead>
             <tbody><tr><td><code>aidbox_http_request_created_seconds</code></td><td>continuous</td><td>histogram</td><td></td></tr><tr><td><code>aidbox_http_request_duration_seconds</code></td><td>continuous</td><td>histogram</td><td></td></tr><tr><td><code>aidbox_http_request_used_seconds</code></td><td>continuous</td><td>histogram</td><td></td></tr><tr><td><code>aidbox_http_request_wait_seconds</code></td><td>continuous</td><td>histogram</td><td></td></tr><tr><td><code>httpkit_active_count</code></td><td>continuous</td><td>gauge</td><td>Number of concurrent HTTP requests</td></tr><tr><td><code>httpkit_completed_total</code></td><td>continuous</td><td>counter</td><td>Number HTTP requests completed</td></tr><tr><td><code>httpkit_queue_count</code></td><td>continuous</td><td>gauge</td><td>Number HTTP requests in the queue</td></tr></tbody></table>

## Hikari (Postgres connection pool) 
<table><thead><tr><th width="220">Metric</th>
                                          <th width="140">Update frequency</th>
                                          <th width="80">Type</th>
                                          <th>Description</th></tr></thead>
             <tbody><tr><td><code>hikari_acquire_created_seconds</code></td><td>continuous</td><td>histogram</td><td>The time it took to create a new connection</td></tr><tr><td><code>hikari_acquire_used_seconds</code></td><td>continuous</td><td>histogram</td><td>The time between borrowing a connection and returning it to the pool</td></tr><tr><td><code>hikari_acquire_wait_seconds</code></td><td>continuous</td><td>histogram</td><td>The time it took to obtain an open connection from the pool</td></tr><tr><td><code>hikari_acquired_total</code></td><td>continuous</td><td>counter</td><td></td></tr><tr><td><code>hikari_active_count</code></td><td>continuous</td><td>gauge</td><td>The number of active connections</td></tr><tr><td><code>hikari_closed_total</code></td><td>continuous</td><td>counter</td><td></td></tr><tr><td><code>hikari_idle_count</code></td><td>continuous</td><td>gauge</td><td>The number of idle connections allowed</td></tr><tr><td><code>hikari_max_size</code></td><td>every hour</td><td>gauge</td><td>The maximum number of open connections allowed</td></tr><tr><td><code>hikari_timeout_total</code></td><td>continuous</td><td>counter</td><td></td></tr></tbody></table>

