Node Monitoring and Observability
Last modified on October 4, 2023
You can enable metrics on StrongDM gateways and relays in order to assist with monitoring and observability. When visualized on monitoring dashboards and mapped to alerts, metrics provide valuable insights into the status of gateways and relays, including connection failures, disconnects, availability, and so forth. Monitoring gateways and relays can help you to preemptively address and understand problems as soon as they arise.
This guide defines gateway and relay metrics, describes common terminology related to such metrics, and provides a configuration example for enabling Prometheus-formatted metrics on a gateway or relay.
After configuration is complete, you can request metrics from the gateway or relay on the specified port. The
/metrics endpoint can be reached at:
Common terminology related to gateway and relay metrics is described in the following table.
|A data blob representing a portion of a long-running SSH, RDP, or Kubernetes interactive session recording.
|The act of a gateway or relay making an outbound network connection (called an egress connection) directly to a target resource outside the StrongDM relay network. Of the many relay hops that may make up a route from client to resource, only the last hop creates the egress connection.
|A secure network connection between a gateway and a client, relay, or other gateway. There is generally only one link between any two entities. A link serves as a tunnel through which streams can flow.
|A single client request to a resource, such as a SQL query. Long-running SSH, RDP, or Kubernetes interactive sessions count as queries.
|A single logical network connection between a client and a resource. One stream can be tunneled through multiple links across multiple gateways and relays. One link can contain multiple streams. There can be multiple simultaneous streams between a client and a resource.
Gateway and relay metrics are described in the following table.
|Summary of the pause duration of garbage collection cycles
|Number of goroutines that currently exist
|Information about the Go environment
|Number of bytes allocated and still in use
|Total number of bytes allocated even if freed
|Number of bytes used by the profiling bucket hash table
|Total number of frees
|Number of bytes used for garbage collection system metadata
|Number of heap bytes allocated and still in use
|Number of heap bytes waiting to be used
|Number of heap bytes that are in use
|Number of allocated objects
|Number of heap bytes released to OS
|Number of heap bytes obtained from the system
|Number of seconds since 00:00:00 UTC on January 1, 1970 of the last garbage collection
|Total number of pointer lookups
|Total number of mallocs
|Number of bytes in use by mcache structures
|Number of bytes used for mcache structures obtained from the system
|Number of bytes in use by mspan structures
|Number of bytes used for mspan structures obtained from the system
|Number of heap bytes when next garbage collection will take place
|Number of bytes used for other system allocations
|Number of bytes in use by the stack allocator
|Number of bytes obtained from the system for the stack allocator
|Number of bytes obtained from the system
|Number of OS threads created
|Current number of scrapes being served
|Total number of scrapes by HTTP status code
|Number of chunks processed by the gateway or relay
|Total number of times the gateway or relay has attempted to load credentials for a resource
|Current number of active egress connections
|Total number of times the gateway or relay has attempted to establish an egress connection to a resource
|Total number of attempts to establish links with other gateways, relays, and listeners
|Current number of active links
|Round-trip network latency (in seconds) to a certain gateway
|Count and duration of each time the gateway or relay attempts to send a heartbeat to the StrongDM backend
|Total number of times a heartbeat attempt has failed
error=invalid operation|permission denied|item already exists|item does not exist|internal error|canceled|deadline exceeded|unauthenticated|failed precondition|aborted|out of range|unimplemented|unavailable|resource exhausted
|Total number of times the gateway or relay has changed its lifecycle state
|Number of queries processed by the gateway or relay
|Current number of active streams
|Current size of the gateway or relay’s upload backlog in bytes
|Number of bytes the gateway or relay has attempted to upload
|Number of query batches and chunks the gateway or relay has attempted to upload
|Number of uploads the gateway or relay has given up retrying
|Number of uploads the gateway or relay has retried
Before you begin configuration, ensure that you have the following:
- StrongDM client version 34.96.0 or higher
- A StrongDM account with the Administrator permission level
- A StrongDM gateway or relay up and running
- Existing accounts and familiarity with the following:
- A monitoring system and time series database, such as Prometheus
- A monitoring dashboard, such as Grafana
- An alerting tool, such as Prometheus Alertmanager or Rapid7
You can use the
/metrics endpoint to request metrics for any monitoring solution. This particular example shows how to enable Prometheus-formatted metrics on a gateway or relay. Note that the following example steps may differ from yours, and these steps are provided as an example only.
Configuration involves these general steps:
- Enable Prometheus-formatted metrics on your gateway or relay
- Configure Prometheus
- Set up a monitoring dashboard
- Set up alerts
1. Enable Prometheus-formatted metrics on your gateway or relay
This section explains the various ways to enable Prometheus-formatted metrics on your gateway or relay. You need to specify the port and/or IP address for the gateway or relay to listen on. To do so, set an environment variable with or without IP, or pass a setting in your command-line interface.
Once metrics are enabled, the gateway or relay starts listening on the specified port.
Enable metrics using environment variable with port
SDM_METRICS_LISTEN_ADDRESS environment variable in the gateway or relay’s environment on port 9999:
Enable metrics using environment variable with IP and port
To specify an IP address to listen on, set the variable with the IP address and port 9999, as in the following example:
Enable metrics using CLI setting
The following example shows how to pass the metrics setting as a command-line argument:
sdm relay --prometheus-metrics=:9999
2. Configure Prometheus
Open your config YAML file for editing.
scrape_configssection, add jobs for each gateway or relay, as in the following example:
scrape_configs: - job_name: "StrongDM Relay 01" static_configs: - targets: ["<RELAY_BOX_URL>:9999"]
3. Set up your monitoring dashboard
Configure a monitoring dashboard such as Grafana to visualize your Prometheus metrics. For information on creating a Prometheus data source in Grafana, please see the Prometheus documentation.
4. Set up alerts
Configure your desired alerts on a tool such as Prometheus Alertmanager or Rapid7 in order to ensure reliability and be aware of gateway and relay performance issues.
You may, for example, wish to set alerts for gateway health, resource health and reachability, when a new gateway fails to connect, and when a connected gateway disconnects.
How to Request Metrics
After configuration is complete, you can request metrics from the gateway or relay on the specified port by accessing the