# Metrics

Each `almad` process can expose Prometheus metrics for the services it runs. An SSH-only process publishes SSH and instance-wide metrics, so no single host is expected to report the entire catalog.

Metrics use Prometheus exposition format at `:3081/metrics`. Setting `ALMA_METRICS_LISTEN` binds that dedicated listener. While it is unset the diagnostic listener serves `/metrics` itself, so the endpoint is off only when neither listener is bound. See [Monitoring](https://almaforge.com/monitoring.md#scrape-configuration) for the listener settings, a scrape configuration, and recommended alerting signals.

## Reading the catalog[​](#reading-the-catalog "Direct link to Reading the catalog")

Query every name exactly as the catalog spells it. Prefixes are not uniform: some metrics carry an `alma_` prefix and most do not, and the two forms sit side by side in the same table. Adding or dropping a prefix silently returns an empty result rather than an error.

The **Component** column identifies the service that publishes each metric. The names match those used throughout the docs. A metric listed under Proxy Service appears only on hosts running `almad --proxy-service`.

Types follow Prometheus conventions. A counter only rises and resets to zero on restart. Query it with `rate()` instead of reading it directly. A gauge reports a current value. A histogram publishes `_bucket`, `_sum`, and `_count` series. Use `histogram_quantile()` to calculate latency percentiles.

## Metrics[​](#metrics "Direct link to Metrics")

## Auth Service and backends[​](#auth-service-and-backends "Direct link to Auth Service and backends")

| Name                                                 | Type      | Component           | Description                                                                                                 |
| ---------------------------------------------------- | --------- | ------------------- | ----------------------------------------------------------------------------------------------------------- |
| `audit_failed_disk_monitoring`                       | counter   | AlmaForge Audit Log | Number of times disk monitoring failed.                                                                     |
| `audit_failed_emit_events`                           | counter   | AlmaForge Audit Log | Number of times emitting audit events failed.                                                               |
| `audit_percentage_disk_space_used`                   | gauge     | AlmaForge Audit Log | Percentage of disk space used.                                                                              |
| `audit_server_open_files`                            | gauge     | AlmaForge Audit Log | Number of open audit files.                                                                                 |
| `auth_generate_requests_throttled_total`             | counter   | AlmaForge Auth      | Number of throttled requests to generate new server keys.                                                   |
| `auth_generate_requests_total`                       | counter   | AlmaForge Auth      | Number of requests to generate new server keys.                                                             |
| `auth_generate_requests`                             | gauge     | AlmaForge Auth      | Number of current generate requests.                                                                        |
| `auth_generate_seconds`                              | histogram | AlmaForge Auth      | Latency for generate requests.                                                                              |
| `backend_batch_read_requests_total`                  | counter   | cache               | Number of read requests to the backend.                                                                     |
| `backend_batch_read_seconds`                         | histogram | cache               | Latency for batch read operations.                                                                          |
| `backend_batch_write_requests_total`                 | counter   | cache               | Number of batch write requests to the backend.                                                              |
| `backend_batch_write_seconds`                        | histogram | cache               | Latency for backend batch write operations.                                                                 |
| `backend_read_requests_total`                        | counter   | cache               | Number of read requests to the backend.                                                                     |
| `backend_read_seconds`                               | histogram | cache               | Latency for read operations.                                                                                |
| `backend_requests`                                   | counter   | cache               | Number of requests to the backend (reads, writes, and keepalives).                                          |
| `backend_write_requests_total`                       | counter   | cache               | Number of write requests to the backend.                                                                    |
| `backend_write_seconds`                              | histogram | cache               | Latency for backend write operations.                                                                       |
| `backend_batch_read_requests_failed_total`           | counter   | cache               | Number of failed batch read requests to the backend.                                                        |
| `backend_batch_write_requests_failed_total`          | counter   | cache               | Number of failed batch write requests to the backend.                                                       |
| `backend_read_requests_failed_total`                 | counter   | cache               | Number of failed read requests to the backend.                                                              |
| `backend_write_requests_failed_total`                | counter   | cache               | Number of failed write requests to the backend.                                                             |
| `backend_watchers_total`                             | gauge     | cache               | Number of active backend watchers.                                                                          |
| `backend_watcher_queues_total`                       | gauge     | cache               | Backend watcher queue sizes.                                                                                |
| `cluster_name_not_found_total`                       | counter   | AlmaForge Auth      | Number of times a cluster was not found.                                                                    |
| `dynamo_requests_total`                              | counter   | DynamoDB            | Total number of requests to the DynamoDB API.                                                               |
| `dynamo_requests`                                    | counter   | DynamoDB            | Total number of requests to the DynamoDB API grouped by result.                                             |
| `dynamo_requests_seconds`                            | histogram | DynamoDB            | Latency of DynamoDB API requests.                                                                           |
| `etcd_backend_batch_read_requests`                   | counter   | etcd                | Number of read requests to the etcd database.                                                               |
| `etcd_backend_batch_read_seconds`                    | histogram | etcd                | Latency for etcd read operations.                                                                           |
| `etcd_backend_read_requests`                         | counter   | etcd                | Number of read requests to the etcd database.                                                               |
| `etcd_backend_read_seconds`                          | histogram | etcd                | Latency for etcd read operations.                                                                           |
| `etcd_backend_tx_requests`                           | counter   | etcd                | Number of transaction requests to the database.                                                             |
| `etcd_backend_tx_seconds`                            | histogram | etcd                | Latency for etcd transaction operations.                                                                    |
| `etcd_backend_write_requests`                        | counter   | etcd                | Number of write requests to the database.                                                                   |
| `etcd_backend_write_seconds`                         | histogram | etcd                | Latency for etcd write operations.                                                                          |
| `alma_etcd_events`                                   | counter   | etcd                | Total number of etcd events processed.                                                                      |
| `alma_etcd_event_backpressure`                       | counter   | etcd                | Total number of times event processing encountered backpressure.                                            |
| `firestore_events_backend_batch_read_requests`       | counter   | GCP Cloud Firestore | Number of batch read requests to Cloud Firestore events.                                                    |
| `firestore_events_backend_batch_read_seconds`        | histogram | GCP Cloud Firestore | Latency for Cloud Firestore events batch read operations.                                                   |
| `firestore_events_backend_batch_write_requests`      | counter   | GCP Cloud Firestore | Number of batch write requests to Cloud Firestore events.                                                   |
| `firestore_events_backend_batch_write_seconds`       | histogram | GCP Cloud Firestore | Latency for Cloud Firestore events batch write operations.                                                  |
| `firestore_events_backend_write_requests`            | counter   | GCP Cloud Firestore | Number of write requests to Cloud Firestore events.                                                         |
| `firestore_events_backend_write_seconds`             | histogram | GCP Cloud Firestore | Latency for Cloud Firestore events write operations.                                                        |
| `gcs_event_storage_downloads_seconds`                | histogram | GCP GCS             | Latency for GCS download operations.                                                                        |
| `gcs_event_storage_downloads`                        | counter   | GCP GCS             | Number of downloads from the GCS backend.                                                                   |
| `gcs_event_storage_uploads_seconds`                  | histogram | GCP GCS             | Latency for GCS upload operations.                                                                          |
| `gcs_event_storage_uploads`                          | counter   | GCP GCS             | Number of uploads to the GCS backend.                                                                       |
| `grpc_server_started_total`                          | counter   | AlmaForge Auth      | Total number of RPCs started on the server.                                                                 |
| `grpc_server_handled_total`                          | counter   | AlmaForge Auth      | Total number of RPCs completed on the server, regardless of success or failure.                             |
| `grpc_server_msg_received_total`                     | counter   | AlmaForge Auth      | Total number of RPC stream messages received on the server.                                                 |
| `grpc_server_msg_sent_total`                         | counter   | AlmaForge Auth      | Total number of gRPC stream messages sent by the server.                                                    |
| `heartbeat_connections_received_total`               | counter   | AlmaForge Auth      | Number of times the Auth Service received a heartbeat connection.                                           |
| `heartbeats_missed_total`                            | gauge     | AlmaForge Auth      | Number of heartbeats the Auth Service expected and did not receive.                                         |
| `s3_audit_flushes_total`                             | counter   | Amazon S3           | Number of audit event batches written to the S3 backend.                                                    |
| `s3_audit_flush_failures_total`                      | counter   | Amazon S3           | Number of audit event batches the S3 backend failed to write.                                               |
| `s3_audit_flush_seconds`                             | histogram | Amazon S3           | Time taken to write one batch of audit events to the S3 backend.                                            |
| `s3_audit_events_refused_total`                      | counter   | Amazon S3           | Audit events the S3 backend refused to buffer, by `reason`, `bucket` and `path`.                            |
| `s3_audit_pending_bytes`                             | gauge     | Amazon S3           | Audit event bytes held in memory, waiting to be written, by `bucket` and `path`.                            |
| `s3_audit_pending_bytes_limit`                       | gauge     | Amazon S3           | Bytes held in memory before the backend refuses events, by `bucket` and `path`.                             |
| `s3_audit_objects_listed`                            | histogram | Amazon S3           | Number of objects listed per audit search of the S3 backend.                                                |
| `s3_recordings_uploads_total`                        | counter   | Amazon S3           | Session recordings stored in the S3 backend, by `result` and `bucket`.                                      |
| `s3_recordings_upload_seconds`                       | histogram | Amazon S3           | Time taken to store one session recording in the S3 backend.                                                |
| `s3_recordings_downloads_total`                      | counter   | Amazon S3           | Session recordings read from the S3 backend, by `result` and `bucket`.                                      |
| `s3_recordings_download_seconds`                     | histogram | Amazon S3           | Time taken to read one session recording from the S3 backend.                                               |
| `s3_recordings_searches_total`                       | counter   | Amazon S3           | Recordings listings served from the S3 backend, by `result`.                                                |
| `s3_requests_total`                                  | counter   | Amazon S3           | Total number of requests to the S3 API.                                                                     |
| `s3_requests`                                        | counter   | Amazon S3           | Total number of requests to the S3 API grouped by result.                                                   |
| `s3_requests_seconds`                                | histogram | Amazon S3           | Request latency for the S3 API.                                                                             |
| `alma_audit_emit_events`                             | counter   | AlmaForge Audit Log | Number of audit events emitted.                                                                             |
| `alma_audit_parquetlog_batch_processing_seconds`     | histogram | AlmaForge Audit Log | Duration of processing single batch of events in the Parquet-format audit log.                              |
| `alma_audit_parquetlog_s3_flush_seconds`             | histogram | AlmaForge Audit Log | Duration of flushing parquet files to S3 in Parquet-format audit log.                                       |
| `alma_audit_parquetlog_delete_events_seconds`        | histogram | AlmaForge Audit Log | Duration of deletion events from SQS in Parquet-format audit log.                                           |
| `alma_audit_parquetlog_batch_size`                   | histogram | AlmaForge Audit Log | Overall size of events in single batch in Parquet-format audit log.                                         |
| `alma_audit_parquetlog_batch_count`                  | counter   | AlmaForge Audit Log | Total number of events in single batch in Parquet-format audit log.                                         |
| `alma_audit_parquetlog_last_processed_timestamp`     | gauge     | AlmaForge Audit Log | Number of last processing time in Parquet-format audit log.                                                 |
| `alma_audit_parquetlog_age_oldest_processed_message` | gauge     | AlmaForge Audit Log | Number of age of oldest event in Parquet-format audit log.                                                  |
| `alma_audit_parquetlog_errors_from_collect_count`    | counter   | AlmaForge Audit Log | Number of collect failures in Parquet-format audit log.                                                     |
| `alma_access_requests_created`                       | counter   | AlmaForge Auth      | Number of access requests created, by requested roles and resources.                                        |
| `alma_connected_resources`                           | gauge     | AlmaForge Auth      | Number and type of resources connected via keepalives.                                                      |
| `alma_device_code_inflight`                          | gauge     | AlmaForge Auth      | Device-authorization records pending approval or exchange. Every interactive login opens one.               |
| `alma_device_code_outcome_total`                     | counter   | AlmaForge Auth      | Device-authorization flows that reached a terminal outcome, grouped by outcome.                             |
| `alma_device_code_token_latency_seconds`             | histogram | AlmaForge Auth      | Latency of the device-code token endpoint, grouped by outcome.                                              |
| `alma_incomplete_session_uploads_total`              | gauge     | AlmaForge Audit Log | Number of sessions not yet uploaded to the Auth Service.                                                    |
| `alma_total_instances`                               | gauge     | AlmaForge Auth      | Number of instances the Auth Service currently counts in the cluster.                                       |
| `alma_user_certificates_generated`                   | counter   | AlmaForge Auth      | Number of user certificates issued.                                                                         |
| `alma_registered_servers`                            | gauge     | AlmaForge Auth      | The number of AlmaForge services that are connected to an Auth Service instance grouped by version.         |
| `alma_registered_servers_by_install_methods`         | gauge     | AlmaForge Auth      | The number of AlmaForge services that are connected to an Auth Service instance grouped by install methods. |
| `user_login_total`                                   | counter   | AlmaForge Auth      | Number of user logins.                                                                                      |
| `alma_migrations`                                    | gauge     | AlmaForge Auth      | Tracks for each migration if it is active (1) or not (0).                                                   |
| `watcher_event_sizes`                                | histogram | cache               | Overall size of events emitted.                                                                             |
| `watcher_events`                                     | histogram | cache               | Per resource size of events emitted.                                                                        |

## Proxy Service[​](#proxy-service "Direct link to Proxy Service")

| Name                                               | Type      | Component       | Description                                                                                                                               |
| -------------------------------------------------- | --------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `failed_connect_to_node_attempts_total`            | counter   | AlmaForge Proxy | Number of failed SSH connection attempts to the SSH Service. Use with `alma_connect_to_node_attempts_total` to get the failure rate.      |
| `failed_login_attempts_total`                      | counter   | AlmaForge Proxy | Number of failed `alma login` or `alma ssh` logins.                                                                                       |
| `grpc_client_started_total`                        | counter   | AlmaForge Proxy | Total number of RPCs started on the client.                                                                                               |
| `grpc_client_handled_total`                        | counter   | AlmaForge Proxy | Total number of RPCs completed on the client, regardless of success or failure.                                                           |
| `grpc_client_msg_received_total`                   | counter   | AlmaForge Proxy | Total number of RPC stream messages received on the client.                                                                               |
| `grpc_client_msg_sent_total`                       | counter   | AlmaForge Proxy | Total number of gRPC stream messages sent by the client.                                                                                  |
| `proxy_connection_limit_exceeded_total`            | counter   | AlmaForge Proxy | Number of connections that exceeded the Proxy Service connection limit.                                                                   |
| `proxy_peer_client_dial_error_total`               | counter   | AlmaForge Proxy | Total number of errors encountered dialing peer Proxy Service instances.                                                                  |
| `proxy_peer_client_connections`                    | gauge     | AlmaForge Proxy | Number of open connections to peer Proxy Service instances.                                                                               |
| `proxy_peer_client_rpc`                            | gauge     | AlmaForge Proxy | Number of current client RPC requests.                                                                                                    |
| `proxy_peer_client_rpc_total`                      | counter   | AlmaForge Proxy | Total number of client RPC requests.                                                                                                      |
| `proxy_peer_client_rpc_duration_seconds`           | histogram | AlmaForge Proxy | Duration in seconds of RPCs sent by the client.                                                                                           |
| `proxy_peer_client_message_sent_size`              | histogram | AlmaForge Proxy | Size of messages sent by the client.                                                                                                      |
| `proxy_peer_client_message_received_size`          | histogram | AlmaForge Proxy | Size of messages received by the client.                                                                                                  |
| `proxy_peer_server_connections`                    | gauge     | AlmaForge Proxy | Number of currently opened connection to peer Proxy Service clients.                                                                      |
| `proxy_peer_server_rpc`                            | gauge     | AlmaForge Proxy | Number of current server RPC requests.                                                                                                    |
| `proxy_peer_server_rpc_total`                      | counter   | AlmaForge Proxy | Total number of server RPC requests.                                                                                                      |
| `proxy_peer_server_rpc_duration_seconds`           | histogram | AlmaForge Proxy | Duration in seconds of RPCs sent by the server.                                                                                           |
| `proxy_peer_server_message_sent_size`              | histogram | AlmaForge Proxy | Size of messages sent by the server.                                                                                                      |
| `proxy_peer_server_message_received_size`          | histogram | AlmaForge Proxy | Size of messages received by the server.                                                                                                  |
| `proxy_ssh_sessions_total`                         | gauge     | AlmaForge Proxy | Number of active sessions through this Proxy Service instance.                                                                            |
| `missing_ssh_tunnels`                              | gauge     | AlmaForge Proxy | Number of missing SSH tunnels. Used to debug if AlmaForge instances have discovered all Proxy Service instances.                          |
| `alma_connect_to_node_attempts_total`              | counter   | AlmaForge Proxy | Number of SSH connection attempts to an SSH Service. Use with `failed_connect_to_node_attempts_total` to get the failure rate.            |
| `alma_reverse_ssh_tunnels`                         | gauge     | AlmaForge Proxy | Number of reverse SSH tunnels connected to the AlmaForge Proxy Service by AlmaForge instances.                                            |
| `alma_proxy_db_connection_setup_time_seconds`      | histogram | AlmaForge Proxy | Time to establish connection to DB service from Proxy service.                                                                            |
| `alma_proxy_db_connection_dial_attempts_total`     | counter   | AlmaForge Proxy | Number of dial attempts from Proxy to DB service made.                                                                                    |
| `alma_proxy_db_connection_dial_failures_total`     | counter   | AlmaForge Proxy | Number of failed dial attempts from Proxy to DB service made.                                                                             |
| `alma_proxy_db_attempted_servers_total`            | histogram | AlmaForge Proxy | Number of servers processed during connection attempt to the DB service from Proxy service.                                               |
| `alma_proxy_db_connection_tls_config_time_seconds` | histogram | AlmaForge Proxy | Time to fetch TLS configuration for the connection to DB service from Proxy service.                                                      |
| `alma_proxy_db_active_connections_total`           | gauge     | AlmaForge Proxy | Number of currently active connections to DB service from Proxy service.                                                                  |
| `alma_accepted_connections_total`                  | counter   | AlmaForge Proxy | Connections accepted, by ingress path and service. Separates traffic that arrived through the multiplex from traffic on a dedicated port. |
| `alma_active_connections`                          | gauge     | AlmaForge Proxy | Connections currently open, by ingress path and service.                                                                                  |
| `alma_authenticated_accepted_connections_total`    | counter   | AlmaForge Proxy | Accepted connections that went on to authenticate. Compare with `alma_accepted_connections_total` for the failure rate.                   |
| `alma_authenticated_active_connections`            | gauge     | AlmaForge Proxy | Open connections that authenticated.                                                                                                      |
| `reversetunnel_conn_latency`                       | histogram | AlmaForge Proxy | Time to reach an agent over a reverse tunnel, by dial type and connection stage.                                                          |

## Database Service[​](#database-service "Direct link to Database Service")

| Name                                    | Type      | Component                  | Description                                                       |
| --------------------------------------- | --------- | -------------------------- | ----------------------------------------------------------------- |
| `alma_db_messages_from_client_total`    | counter   | AlmaForge Database Service | Number of messages (packets) received from the DB client.         |
| `alma_db_messages_from_server_total`    | counter   | AlmaForge Database Service | Number of messages (packets) received from the DB server.         |
| `alma_db_method_call_count_total`       | counter   | AlmaForge Database Service | Number of times a DB method was called.                           |
| `alma_db_method_call_latency_seconds`   | histogram | AlmaForge Database Service | Call latency for database method calls.                           |
| `alma_db_initialized_connections_total` | counter   | AlmaForge Database Service | Number of initialized DB connections.                             |
| `alma_db_active_connections_total`      | gauge     | AlmaForge Database Service | Number of active DB connections.                                  |
| `alma_db_connection_durations_seconds`  | histogram | AlmaForge Database Service | Duration of DB connection.                                        |
| `alma_db_connection_setup_time_seconds` | histogram | AlmaForge Database Service | Time to establish a database connection before handling requests. |
| `alma_db_errors_total`                  | counter   | AlmaForge Database Service | Number of synthetic DB errors sent to the client.                 |

### Kubernetes Access[​](#kubernetes-access "Direct link to Kubernetes Access")

The following tables identify all metrics available in the proxy service if Kubernetes access is enabled.

#### Client[​](#client "Direct link to Client")

The following table identifies all metrics the Kubernetes Proxy records for its connections to the upstream that serves a cluster, which is an agent running the Kubernetes Service.

| Name                                                          | Type      | Component                  | Description                                                                                                 |
| ------------------------------------------------------------- | --------- | -------------------------- | ----------------------------------------------------------------------------------------------------------- |
| `alma_kubernetes_client_in_flight_requests`                   | gauge     | AlmaForge Kubernetes Proxy | In-flight requests waiting for the upstream response.                                                       |
| `alma_kubernetes_client_requests_total`                       | counter   | AlmaForge Kubernetes Proxy | Total number of requests sent to the upstream AlmaForge proxy, kube\_service or Kubernetes Cluster servers. |
| `alma_kubernetes_client_tls_duration_seconds`                 | histogram | AlmaForge Kubernetes Proxy | Latency distribution of TLS handshakes.                                                                     |
| `alma_kubernetes_client_got_conn_duration_seconds`            | histogram | AlmaForge Kubernetes Proxy | Latency distribution of time to dial to the upstream server - using reverse tunnel or direct dialer.        |
| `alma_kubernetes_client_first_byte_response_duration_seconds` | histogram | AlmaForge Kubernetes Proxy | Latency distribution of time to receive the first response byte from the upstream server.                   |
| `alma_kubernetes_client_request_duration_seconds`             | histogram | AlmaForge Kubernetes Proxy | Latency distribution of the upstream request time.                                                          |

#### Server[​](#server "Direct link to Server")

The following table identifies all metrics available for incoming connections.

| Name                                                    | Type      | Component                  | Description                                         |
| ------------------------------------------------------- | --------- | -------------------------- | --------------------------------------------------- |
| `alma_kubernetes_server_in_flight_requests`             | gauge     | AlmaForge Kubernetes Proxy | In-flight requests currently handled by the server. |
| `alma_kubernetes_server_api_requests_total`             | counter   | AlmaForge Kubernetes Proxy | Total number of requests handled by the server.     |
| `alma_kubernetes_server_request_duration_seconds`       | histogram | AlmaForge Kubernetes Proxy | Latency distribution of the total request time.     |
| `alma_kubernetes_server_response_size_bytes`            | histogram | AlmaForge Kubernetes Proxy | Distribution of the response size.                  |
| `alma_kubernetes_server_exec_in_flight_sessions`        | gauge     | AlmaForge Kubernetes Proxy | Number of active kubectl exec sessions.             |
| `alma_kubernetes_server_exec_sessions_total`            | counter   | AlmaForge Kubernetes Proxy | Total number of kubectl exec sessions.              |
| `alma_kubernetes_server_portforward_in_flight_sessions` | gauge     | AlmaForge Kubernetes Proxy | Number of active kubectl portforward sessions.      |
| `alma_kubernetes_server_portforward_sessions_total`     | counter   | AlmaForge Kubernetes Proxy | Total number of kubectl port-forward sessions.      |
| `alma_kubernetes_server_join_in_flight_sessions`        | gauge     | AlmaForge Kubernetes Proxy | Number of active joining sessions,                  |
| `alma_kubernetes_server_join_sessions_total`            | counter   | AlmaForge Kubernetes Proxy | Total number of joining sessions.                   |

## AlmaForge SSH Service[​](#almaforge-ssh-service "Direct link to AlmaForge SSH Service")

| Name                                     | Type    | Component     | Description                                                     |
| ---------------------------------------- | ------- | ------------- | --------------------------------------------------------------- |
| `user_max_concurrent_sessions_hit_total` | counter | AlmaForge SSH | Number of times a user exceeded their concurrent session limit. |

## AlmaForge Kubernetes Service[​](#almaforge-kubernetes-service "Direct link to AlmaForge Kubernetes Service")

The following table identifies all metrics the Kubernetes Service records for its connections to the upstream, which is always a Kubernetes cluster.

| Name                                                          | Type      | Component                    | Description                                                                                                     |
| ------------------------------------------------------------- | --------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `alma_kubernetes_client_in_flight_requests`                   | gauge     | AlmaForge Kubernetes Service | In-flight requests waiting for the upstream response.                                                           |
| `alma_kubernetes_client_requests_total`                       | counter   | AlmaForge Kubernetes Service | Total number of requests sent to the upstream Proxy Service, Kubernetes Service, or Kubernetes Cluster servers. |
| `alma_kubernetes_client_tls_duration_seconds`                 | histogram | AlmaForge Kubernetes Service | Latency distribution of TLS handshakes.                                                                         |
| `alma_kubernetes_client_got_conn_duration_seconds`            | histogram | AlmaForge Kubernetes Service | Latency distribution of time to dial to the upstream server - using reversetunnel or direct dialer.             |
| `alma_kubernetes_client_first_byte_response_duration_seconds` | histogram | AlmaForge Kubernetes Service | Latency distribution of time to receive the first response byte from the upstream server.                       |
| `alma_kubernetes_client_request_duration_seconds`             | histogram | AlmaForge Kubernetes Service | Latency distribution of the upstream request time.                                                              |

The following table identifies all metrics available for incoming connections.

| Name                                                    | Type      | Component                    | Description                                         |
| ------------------------------------------------------- | --------- | ---------------------------- | --------------------------------------------------- |
| `alma_kubernetes_server_in_flight_requests`             | gauge     | AlmaForge Kubernetes Service | In-flight requests currently handled by the server. |
| `alma_kubernetes_server_api_requests_total`             | counter   | AlmaForge Kubernetes Service | Total number of requests handled by the server.     |
| `alma_kubernetes_server_request_duration_seconds`       | histogram | AlmaForge Kubernetes Service | Latency distribution of the total request time.     |
| `alma_kubernetes_server_response_size_bytes`            | histogram | AlmaForge Kubernetes Service | Distribution of the response size.                  |
| `alma_kubernetes_server_exec_in_flight_sessions`        | gauge     | AlmaForge Kubernetes Service | Number of active kubectl exec sessions.             |
| `alma_kubernetes_server_exec_sessions_total`            | counter   | AlmaForge Kubernetes Service | Total number of kubectl exec sessions.              |
| `alma_kubernetes_server_portforward_in_flight_sessions` | gauge     | AlmaForge Kubernetes Service | Number of active kubectl portforward sessions.      |
| `alma_kubernetes_server_portforward_sessions_total`     | counter   | AlmaForge Kubernetes Service | Total number of kubectl port-forward sessions.      |
| `alma_kubernetes_server_join_in_flight_sessions`        | gauge     | AlmaForge Kubernetes Service | Number of active joining sessions,                  |
| `alma_kubernetes_server_join_sessions_total`            | counter   | AlmaForge Kubernetes Service | Total number of joining sessions.                   |

## All AlmaForge instances[​](#all-almaforge-instances "Direct link to All AlmaForge instances")

| Name                                | Type    | Component | Description                                                                                                                                                         |
| ----------------------------------- | ------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `process_state`                     | gauge   | AlmaForge | State of the almad process: 0 - ok, 1 - recovering, 2 - degraded, 3 - starting.                                                                                     |
| `certificate_mismatch_total`        | counter | AlmaForge | Number of SSH server login failures due to a certificate mismatch.                                                                                                  |
| `rx`                                | counter | AlmaForge | Number of bytes received during an SSH connection.                                                                                                                  |
| `server_interactive_sessions_total` | gauge   | AlmaForge | Number of active sessions.                                                                                                                                          |
| `alma_build_info`                   | gauge   | AlmaForge | Provides build information of AlmaForge including gitref (git describe --long --tags), Go version, and AlmaForge version. The value of this gauge will always be 1. |
| `alma_cache_events`                 | counter | AlmaForge | Number of events received by a AlmaForge service cache. AlmaForge's Auth Service, Proxy Service, and other services cache incoming events related to their service. |
| `alma_cache_stale_events`           | counter | AlmaForge | Number of stale events received by a AlmaForge service cache. A high percentage of stale events can indicate a degraded backend.                                    |
| `tx`                                | counter | AlmaForge | Number of bytes transmitted during an SSH connection.                                                                                                               |

## Go runtime metrics[​](#go-runtime-metrics "Direct link to Go runtime metrics")

These metrics are surfaced by the Go runtime and are not specific to AlmaForge.

| Name                               | Type    | Component   | Description                                                                                 |
| ---------------------------------- | ------- | ----------- | ------------------------------------------------------------------------------------------- |
| `go_gc_duration_seconds`           | summary | Internal Go | A summary of GC invocation durations.                                                       |
| `go_goroutines`                    | gauge   | Internal Go | Number of goroutines that currently exist.                                                  |
| `go_info`                          | gauge   | Internal Go | Information about the Go environment.                                                       |
| `go_memstats_alloc_bytes_total`    | counter | Internal Go | Total number of bytes allocated, even if freed.                                             |
| `go_memstats_alloc_bytes`          | gauge   | Internal Go | Number of bytes allocated and still in use.                                                 |
| `go_memstats_buck_hash_sys_bytes`  | gauge   | Internal Go | Number of bytes used by the profiling bucket hash table.                                    |
| `go_memstats_frees_total`          | counter | Internal Go | Total number of frees.                                                                      |
| `go_memstats_gc_cpu_fraction`      | gauge   | Internal Go | The fraction of this program's available CPU time used by the GC since the program started. |
| `go_memstats_gc_sys_bytes`         | gauge   | Internal Go | Number of bytes used for garbage collection system metadata.                                |
| `go_memstats_heap_alloc_bytes`     | gauge   | Internal Go | Number of heap bytes allocated and still in use.                                            |
| `go_memstats_heap_idle_bytes`      | gauge   | Internal Go | Number of heap bytes waiting to be used.                                                    |
| `go_memstats_heap_inuse_bytes`     | gauge   | Internal Go | Number of heap bytes that are in use.                                                       |
| `go_memstats_heap_objects`         | gauge   | Internal Go | Number of allocated objects.                                                                |
| `go_memstats_heap_released_bytes`  | gauge   | Internal Go | Number of heap bytes released to the OS.                                                    |
| `go_memstats_heap_sys_bytes`       | gauge   | Internal Go | Number of heap bytes obtained from the system.                                              |
| `go_memstats_last_gc_time_seconds` | gauge   | Internal Go | Number of seconds since the Unix epoch of the last garbage collection.                      |
| `go_memstats_lookups_total`        | counter | Internal Go | Total number of pointer lookups.                                                            |
| `go_memstats_mallocs_total`        | counter | Internal Go | Total number of mallocs.                                                                    |
| `go_memstats_mcache_inuse_bytes`   | gauge   | Internal Go | Number of bytes in use by mcache structures.                                                |
| `go_memstats_mcache_sys_bytes`     | gauge   | Internal Go | Number of bytes used for mcache structures obtained from system.                            |
| `go_memstats_mspan_inuse_bytes`    | gauge   | Internal Go | Number of bytes in use by mspan structures.                                                 |
| `go_memstats_mspan_sys_bytes`      | gauge   | Internal Go | Number of bytes used for mspan structures obtained from system.                             |
| `go_memstats_next_gc_bytes`        | gauge   | Internal Go | Number of heap bytes when next the garbage collection will take place.                      |
| `go_memstats_other_sys_bytes`      | gauge   | Internal Go | Number of bytes used for other system allocations.                                          |
| `go_memstats_stack_inuse_bytes`    | gauge   | Internal Go | Number of bytes in use by the stack allocator.                                              |
| `go_memstats_stack_sys_bytes`      | gauge   | Internal Go | Number of bytes obtained from the system for stack allocator.                               |
| `go_memstats_sys_bytes`            | gauge   | Internal Go | Number of bytes obtained from the system.                                                   |
| `go_threads`                       | gauge   | Internal Go | Number of OS threads created.                                                               |
| `process_cpu_seconds_total`        | counter | Internal Go | Total user and system CPU time spent in seconds.                                            |
| `process_max_fds`                  | gauge   | Internal Go | Maximum number of open file descriptors.                                                    |
| `process_open_fds`                 | gauge   | Internal Go | Number of open file descriptors.                                                            |
| `process_resident_memory_bytes`    | gauge   | Internal Go | Resident memory size in bytes.                                                              |
| `process_start_time_seconds`       | gauge   | Internal Go | Start time of the process since the Unix epoch in seconds.                                  |
| `process_virtual_memory_bytes`     | gauge   | Internal Go | Virtual memory size in bytes.                                                               |
| `process_virtual_memory_max_bytes` | gauge   | Internal Go | Maximum amount of virtual memory available in bytes.                                        |

## Prometheus[​](#prometheus "Direct link to Prometheus")

| Name                                         | Type    | Component  | Description                                  |
| -------------------------------------------- | ------- | ---------- | -------------------------------------------- |
| `promhttp_metric_handler_requests_in_flight` | gauge   | prometheus | Current number of scrapes being served.      |
| `promhttp_metric_handler_requests_total`     | counter | prometheus | Total number of scrapes by HTTP status code. |

## References[​](#references "Direct link to References")

* [Monitoring](https://almaforge.com/monitoring.md): endpoints, scrape configuration, and the signals worth alerting on.
* [Networking](https://almaforge.com/networking.md): every port `almad` listens on, including the metrics and diagnostic listeners.
* [Audit Events](https://almaforge.com/reference/audit.md): records of user and system activity rather than process performance.
* [Scaling](https://almaforge.com/scaling.md): how to act on saturation signals.
