From 93123f2623e5a8df90b0814aba3bf14edac27351 Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Wed, 6 Nov 2024 13:28:23 -0600 Subject: [PATCH] Rename compute_backpressure_throttling_ms to compute_backpressure_throttling_seconds This is in line with the Prometheus guidance[0]. We also haven't started using this metric, so renaming is essentially free. Link: https://prometheus.io/docs/practices/naming/ [0] Signed-off-by: Tristan Partin --- compute/etc/neon_collector.jsonnet | 2 +- .../etc/sql_exporter/compute_backpressure_throttling_ms.sql | 1 - ...nnet => compute_backpressure_throttling_seconds.libsonnet} | 4 ++-- .../sql_exporter/compute_backpressure_throttling_seconds.sql | 1 + 4 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 compute/etc/sql_exporter/compute_backpressure_throttling_ms.sql rename compute/etc/sql_exporter/{compute_backpressure_throttling_ms.libsonnet => compute_backpressure_throttling_seconds.libsonnet} (71%) create mode 100644 compute/etc/sql_exporter/compute_backpressure_throttling_seconds.sql diff --git a/compute/etc/neon_collector.jsonnet b/compute/etc/neon_collector.jsonnet index e73fb132ee..c6fa645b41 100644 --- a/compute/etc/neon_collector.jsonnet +++ b/compute/etc/neon_collector.jsonnet @@ -3,7 +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_backpressure_throttling_seconds.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.sql b/compute/etc/sql_exporter/compute_backpressure_throttling_ms.sql deleted file mode 100644 index 1fa62d38a4..0000000000 --- a/compute/etc/sql_exporter/compute_backpressure_throttling_ms.sql +++ /dev/null @@ -1 +0,0 @@ -SELECT neon.backpressure_throttling_time() AS throttled; diff --git a/compute/etc/sql_exporter/compute_backpressure_throttling_ms.libsonnet b/compute/etc/sql_exporter/compute_backpressure_throttling_seconds.libsonnet similarity index 71% rename from compute/etc/sql_exporter/compute_backpressure_throttling_ms.libsonnet rename to compute/etc/sql_exporter/compute_backpressure_throttling_seconds.libsonnet index b25bb73d0f..02c803cfa6 100644 --- a/compute/etc/sql_exporter/compute_backpressure_throttling_ms.libsonnet +++ b/compute/etc/sql_exporter/compute_backpressure_throttling_seconds.libsonnet @@ -1,10 +1,10 @@ { - metric_name: 'compute_backpressure_throttling_ms', + metric_name: 'compute_backpressure_throttling_seconds', type: 'gauge', help: 'Time compute has spent throttled', key_labels: null, values: [ 'throttled', ], - query: importstr 'sql_exporter/compute_backpressure_throttling_ms.sql', + query: importstr 'sql_exporter/compute_backpressure_throttling_seconds.sql', } diff --git a/compute/etc/sql_exporter/compute_backpressure_throttling_seconds.sql b/compute/etc/sql_exporter/compute_backpressure_throttling_seconds.sql new file mode 100644 index 0000000000..459c586d18 --- /dev/null +++ b/compute/etc/sql_exporter/compute_backpressure_throttling_seconds.sql @@ -0,0 +1 @@ +SELECT neon.backpressure_throttling_time()::float8 / 1000 AS throttled;