Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pg_setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"math"
"strconv"
"strings"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/log"
Expand Down Expand Up @@ -49,7 +50,7 @@ type pgSetting struct {
func (s *pgSetting) metric() prometheus.Metric {
var (
err error
name = s.name
name = strings.Replace(s.name, ".", "_", -1)
unit = s.unit
shortDesc = s.shortDesc
subsystem = "settings"
Expand Down
16 changes: 16 additions & 0 deletions pg_setting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,22 @@ var fixtures = []fixture{
d: "Desc{fqName: \"pg_settings_special_minus_one_value_seconds\", help: \"foo foo foo [Units converted to seconds.]\", constLabels: {}, variableLabels: []}",
v: -1,
},
fixture{
p: pgSetting{
name: "rds.rds_superuser_reserved_connections",
setting: "2",
unit: "",
shortDesc: "Sets the number of connection slots reserved for rds_superusers.",
vartype: "integer",
},
n: normalised{
val: 2,
unit: "",
err: "",
},
d: "Desc{fqName: \"pg_settings_rds_rds_superuser_reserved_connections\", help: \"Sets the number of connection slots reserved for rds_superusers.\", constLabels: {}, variableLabels: []}",
v: 2,
},
fixture{
p: pgSetting{
name: "unknown_unit",
Expand Down