Skip to content

Operational Metrics

To better understand the behavior of RStudio Package Manager, the server allows you to consume operational metrics via a Prometheus compatible HTTP endpoint. This standardized format allows you to monitor the health and behavior of RSPM.

The configuration Metrics.Enabled = true and Metrics.Listen = 2112 allows RSPM to export metrics via e.g.: http://localhost:2112/metrics

Monitoring disk usage

RSPM disk usage can vary depending on how the service is used so, it can be helpful to monitor the exact consumption of the different storage classes. By enabling the Metrics configuration, as well as the StorageAudit configuration, RSPM provides a way to monitor disk usage over time.


Note that RSPM provides the usage metrics for each storage class regardless of whether they are mounted on the same device. This will naturally result in duplicated values.

# HELP rspm_storage_calculation_time The time in seconds it took to query for filesystem usage
# TYPE rspm_storage_calculation_time gauge
rspm_storage_calculation_time{path="data/binaries"} 0.1935838
rspm_storage_calculation_time{path="data/bioconductor"} 0.0024876
rspm_storage_calculation_time{path="data/cache"} 0.0241345
rspm_storage_calculation_time{path="data/cran"} 0.0024571
rspm_storage_calculation_time{path="data/launcher"} 0.1642556
rspm_storage_calculation_time{path="data/metrics"} 0.2234798
rspm_storage_calculation_time{path="data/packages"} 0.0038647
# HELP rspm_storage_free The free space of the filesystem in GB
# TYPE rspm_storage_free gauge
rspm_storage_free{path="data/binaries"} 719
rspm_storage_free{path="data/bioconductor"} 719
rspm_storage_free{path="data/cache"} 719
rspm_storage_free{path="data/cran"} 719
rspm_storage_free{path="data/launcher"} 719
rspm_storage_free{path="data/metrics"} 719
rspm_storage_free{path="data/packages"} 719
# HELP rspm_storage_size The size of the filesystem in GB
# TYPE rspm_storage_size gauge
rspm_storage_size{path="data/binaries"} 914
rspm_storage_size{path="data/bioconductor"} 914
rspm_storage_size{path="data/cache"} 914
rspm_storage_size{path="data/cran"} 914
rspm_storage_size{path="data/launcher"} 914
rspm_storage_size{path="data/metrics"} 914
rspm_storage_size{path="data/packages"} 914
# HELP rspm_storage_used The used space in this path of the filesystem in GB
# TYPE rspm_storage_used gauge
rspm_storage_used{path="data/binaries"} 0
rspm_storage_used{path="data/bioconductor"} 0
rspm_storage_used{path="data/cache"} 0
rspm_storage_used{path="data/cran"} 0
rspm_storage_used{path="data/launcher"} 0
rspm_storage_used{path="data/metrics"} 0
rspm_storage_used{path="data/packages"} 0

Monitoring R package binary routing

Since RStudio makes a best effort to serve binaries, there will be cases where a binary simply cannot be located for your environment. In these cases, the R package source is be served instead. You can retrieve the success rate of serving binaries using the provided metrics.

# HELP binary_routing_binary
# TYPE binary_routing_binary counter
binary_routing_binary{match=""} 500
binary_routing_binary{match="best"} 1000
binary_routing_binary{match="exact"} 500
# HELP binary_routing_distro
# TYPE binary_routing_distro counter
binary_routing_distro{distro="3.6-bionic",status="fail"} 1
binary_routing_distro{distro="3.6-bionic",status="ok"} 99
binary_routing_distro{distro="unknown",status="fail"} 5
# HELP binary_routing_fallback
# TYPE binary_routing_fallback counter
binary_routing_fallback{reason="match_error_no_best_match"} 200
binary_routing_fallback{reason="service_error_ash"} 10
binary_routing_fallback{reason="service_error_fetch"} 30
binary_routing_fallback{reason="ua_error_distro_mismatch"} 12
binary_routing_fallback{reason="ua_error_no_r"} 5
binary_routing_fallback{reason="ua_error_none"} 5
binary_routing_fallback{reason="ua_error_unsupported_os"} 100