From f18bb0f2abc4e1aa40e0509d0d90fbe02e87afef Mon Sep 17 00:00:00 2001 From: Tom Pang Date: Wed, 24 Sep 2025 12:19:47 +0100 Subject: [PATCH 1/3] export metrics to track shared preload libraries in postgres exports one new metric, `pg_shared_preload_libraries_library_enabled{library= Date: Thu, 25 Sep 2025 10:38:08 +0100 Subject: [PATCH 2/3] better metric name --- collector/pg_shared_preload_libraries.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/collector/pg_shared_preload_libraries.go b/collector/pg_shared_preload_libraries.go index 0a1af6223..81021af99 100644 --- a/collector/pg_shared_preload_libraries.go +++ b/collector/pg_shared_preload_libraries.go @@ -22,7 +22,7 @@ import ( "github.com/prometheus/client_golang/prometheus" ) -const sharedPreloadLibrariesSubsystem = "shared_preload_libraries" +const sharedPreloadLibrariesSubsystem = "settings" func init() { registerCollector(sharedPreloadLibrariesSubsystem, defaultEnabled, NewPGSharedPreloadLibrariesCollector) @@ -39,7 +39,7 @@ var ( prometheus.BuildFQName( namespace, sharedPreloadLibrariesSubsystem, - "library_enabled", + "shared_preload_library_enabled", ), "Whether a library is listed in shared_preload_libraries (1=yes).", []string{"library"}, nil, From 34f7ff0400eecff1004fd5d01ab1b2f3783cc757 Mon Sep 17 00:00:00 2001 From: Tom Pang Date: Thu, 25 Sep 2025 13:17:48 +0100 Subject: [PATCH 3/3] WHAT YEAR IS IT? --- collector/pg_shared_preload_libraries.go | 2 +- collector/pg_shared_preload_libraries_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/collector/pg_shared_preload_libraries.go b/collector/pg_shared_preload_libraries.go index 81021af99..79d1d6a06 100644 --- a/collector/pg_shared_preload_libraries.go +++ b/collector/pg_shared_preload_libraries.go @@ -1,4 +1,4 @@ -// Copyright 2024 The Prometheus Authors +// Copyright 2025 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at diff --git a/collector/pg_shared_preload_libraries_test.go b/collector/pg_shared_preload_libraries_test.go index ad5fe6556..1a8e2629e 100644 --- a/collector/pg_shared_preload_libraries_test.go +++ b/collector/pg_shared_preload_libraries_test.go @@ -1,4 +1,4 @@ -// Copyright 2024 The Prometheus Authors +// Copyright 2025 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at