Skip to main content

Prometheus Metrics for Cloud Users

For cloud users, BuildBuddy exposes Prometheus metrics to monitor and alert on their usage.

In order to fetch Prometheus metrics, you can add the following scrape config in your Prometheus configuration:

global:
scrape_interval: 3600s
scrape_configs:
- job_name: buildbuddy
scheme: https
authorization:
type: "x-buildbuddy-api-key"
credentials: "<buildbuddy_api_key>"
metrics_path: "/api/v1/metrics"
static_configs:
- targets: ["app.buildbuddy.io"]

To view these metrics in a live-updating dashboard, we recommend using a tool like Grafana.

exported_buildbuddy_remote_execution_queue_length (Gauge)

Number of actions currently waiting in the executor queue.

Labels

  • pod_name

Examples

sum by(pod_name) (exported_buildbuddy_remote_execution_queue_length)

exported_buildbuddy_invocation_duration_usec (Histogram)

The total duration of each invocation, in microseconds.

Labels

  • invocation_status

  • pod_name

Examples

# Median invocation duration in the past 5 minutes
histogram_quantile(
0.5,
sum(rate(exported_buildbuddy_invocation_duration_usec_bucket[5m])) by (le)
)

# Number of invocations per Second
sum by (invocation_status) (rate(exported_buildbuddy_invocation_duration_usec_count[5m]))

exported_buildbuddy_remote_cache_num_hits (Counter)

Number of cache hits.

Labels

  • cache_type

  • pod_name

Examples

# Number of Hits as measured over the last week
sum by (cache_type) (increase(exported_buildbuddy_remote_cache_num_hits[1w]))

exported_buildbuddy_remote_cache_download_size_bytes (Counter)

Number of bytes downloaded from the remote cache.

Labels

  • pod_name

Examples

# Number of bytes downloaded as measured over the last week
sum(increase(exported_buildbuddy_remote_cache_download_size_bytes[1w]))

exported_buildbuddy_remote_cache_upload_size_bytes (Counter)

Number of bytes uploaded to the remote cache.

Labels

  • pod_name

Examples

# Number of bytes uploaded as measured over the last week
sum(increase(exported_buildbuddy_remote_cache_upload_size_bytes[1w]))

exported_buildbuddy_remote_execution_duration_usec (Histogram)

The total duration of remote execution, in microseconds.

Labels

  • os

  • pod_name

Examples

# The total duration of remote execution as measured over the last week
sum by (os) (rate(exported_buildbuddy_remote_execution_duration_usec_sum[1w]))