From 8af9412eb211093a2d43afe5036552f3271aadf4 Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Wed, 30 Oct 2024 09:58:29 -0500 Subject: [PATCH] Collect compute backpressure throttling time This will tell us how much time the compute has spent throttled if pageserver/safekeeper cannot keep up with WAL generation. Signed-off-by: Tristan Partin --- compute/etc/neon_collector.jsonnet | 1 + .../compute_backpressure_throttling_ms.libsonnet | 10 ++++++++++ .../compute_backpressure_throttling_ms.sql | 1 + 3 files changed, 12 insertions(+) create mode 100644 compute/etc/sql_exporter/compute_backpressure_throttling_ms.libsonnet create mode 100644 compute/etc/sql_exporter/compute_backpressure_throttling_ms.sql diff --git a/compute/etc/neon_collector.jsonnet b/compute/etc/neon_collector.jsonnet index 8b43ebe7a3..e73fb132ee 100644 --- a/compute/etc/neon_collector.jsonnet +++ b/compute/etc/neon_collector.jsonnet @@ -3,6 +3,7 @@ metrics: [ import 'sql_exporter/checkpoints_req.libsonnet', import 'sql_exporter/checkpoints_timed.libsonnet', + import 'sql_exporter/compute_backpressure_throttling_ms.libsonnet', import 'sql_exporter/compute_current_lsn.libsonnet', import 'sql_exporter/compute_logical_snapshot_files.libsonnet', import 'sql_exporter/compute_receive_lsn.libsonnet', diff --git a/compute/etc/sql_exporter/compute_backpressure_throttling_ms.libsonnet b/compute/etc/sql_exporter/compute_backpressure_throttling_ms.libsonnet new file mode 100644 index 0000000000..b25bb73d0f --- /dev/null +++ b/compute/etc/sql_exporter/compute_backpressure_throttling_ms.libsonnet @@ -0,0 +1,10 @@ +{ + metric_name: 'compute_backpressure_throttling_ms', + type: 'gauge', + help: 'Time compute has spent throttled', + key_labels: null, + values: [ + 'throttled', + ], + query: importstr 'sql_exporter/compute_backpressure_throttling_ms.sql', +} diff --git a/compute/etc/sql_exporter/compute_backpressure_throttling_ms.sql b/compute/etc/sql_exporter/compute_backpressure_throttling_ms.sql new file mode 100644 index 0000000000..1fa62d38a4 --- /dev/null +++ b/compute/etc/sql_exporter/compute_backpressure_throttling_ms.sql @@ -0,0 +1 @@ +SELECT neon.backpressure_throttling_time() AS throttled;