Skip to content

Commit 20b1b75

Browse files
authored
Fix pg_setting different help values
Signed-off-by: GitHub <noreply@github.com>
1 parent 994e5cc commit 20b1b75

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

cmd/postgres_exporter/pg_setting.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func (s *pgSetting) metric(labels prometheus.Labels) prometheus.Metric {
7070
err error
7171
name = strings.Replace(s.name, ".", "_", -1)
7272
unit = s.unit // nolint: ineffassign
73-
shortDesc = s.shortDesc
73+
shortDesc = fmt.Sprintf("Server Parameter: %s", s.name)
7474
subsystem = "settings"
7575
val float64
7676
)

cmd/postgres_exporter/pg_setting_test.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var fixtures = []fixture{
4040
unit: "seconds",
4141
err: "",
4242
},
43-
d: `Desc{fqName: "pg_settings_seconds_fixture_metric_seconds", help: "Foo foo foo [Units converted to seconds.]", constLabels: {}, variableLabels: []}`,
43+
d: `Desc{fqName: "pg_settings_seconds_fixture_metric_seconds", help: "Server Parameter: seconds_fixture_metric [Units converted to seconds.]", constLabels: {}, variableLabels: []}`,
4444
v: 5,
4545
},
4646
{
@@ -56,7 +56,7 @@ var fixtures = []fixture{
5656
unit: "seconds",
5757
err: "",
5858
},
59-
d: `Desc{fqName: "pg_settings_milliseconds_fixture_metric_seconds", help: "Foo foo foo [Units converted to seconds.]", constLabels: {}, variableLabels: []}`,
59+
d: `Desc{fqName: "pg_settings_milliseconds_fixture_metric_seconds", help: "Server Parameter: milliseconds_fixture_metric [Units converted to seconds.]", constLabels: {}, variableLabels: []}`,
6060
v: 5,
6161
},
6262
{
@@ -72,7 +72,7 @@ var fixtures = []fixture{
7272
unit: "bytes",
7373
err: "",
7474
},
75-
d: `Desc{fqName: "pg_settings_eight_kb_fixture_metric_bytes", help: "Foo foo foo [Units converted to bytes.]", constLabels: {}, variableLabels: []}`,
75+
d: `Desc{fqName: "pg_settings_eight_kb_fixture_metric_bytes", help: "Server Parameter: eight_kb_fixture_metric [Units converted to bytes.]", constLabels: {}, variableLabels: []}`,
7676
v: 139264,
7777
},
7878
{
@@ -88,7 +88,7 @@ var fixtures = []fixture{
8888
unit: "bytes",
8989
err: "",
9090
},
91-
d: `Desc{fqName: "pg_settings_16_kb_real_fixture_metric_bytes", help: "Foo foo foo [Units converted to bytes.]", constLabels: {}, variableLabels: []}`,
91+
d: `Desc{fqName: "pg_settings_16_kb_real_fixture_metric_bytes", help: "Server Parameter: 16_kb_real_fixture_metric [Units converted to bytes.]", constLabels: {}, variableLabels: []}`,
9292
v: 49152,
9393
},
9494
{
@@ -104,7 +104,7 @@ var fixtures = []fixture{
104104
unit: "bytes",
105105
err: "",
106106
},
107-
d: `Desc{fqName: "pg_settings_16_mb_real_fixture_metric_bytes", help: "Foo foo foo [Units converted to bytes.]", constLabels: {}, variableLabels: []}`,
107+
d: `Desc{fqName: "pg_settings_16_mb_real_fixture_metric_bytes", help: "Server Parameter: 16_mb_real_fixture_metric [Units converted to bytes.]", constLabels: {}, variableLabels: []}`,
108108
v: 5.0331648e+07,
109109
},
110110
{
@@ -120,7 +120,7 @@ var fixtures = []fixture{
120120
unit: "bytes",
121121
err: "",
122122
},
123-
d: `Desc{fqName: "pg_settings_32_mb_real_fixture_metric_bytes", help: "Foo foo foo [Units converted to bytes.]", constLabels: {}, variableLabels: []}`,
123+
d: `Desc{fqName: "pg_settings_32_mb_real_fixture_metric_bytes", help: "Server Parameter: 32_mb_real_fixture_metric [Units converted to bytes.]", constLabels: {}, variableLabels: []}`,
124124
v: 1.00663296e+08,
125125
},
126126
{
@@ -136,7 +136,7 @@ var fixtures = []fixture{
136136
unit: "bytes",
137137
err: "",
138138
},
139-
d: `Desc{fqName: "pg_settings_64_mb_real_fixture_metric_bytes", help: "Foo foo foo [Units converted to bytes.]", constLabels: {}, variableLabels: []}`,
139+
d: `Desc{fqName: "pg_settings_64_mb_real_fixture_metric_bytes", help: "Server Parameter: 64_mb_real_fixture_metric [Units converted to bytes.]", constLabels: {}, variableLabels: []}`,
140140
v: 2.01326592e+08,
141141
},
142142
{
@@ -152,7 +152,7 @@ var fixtures = []fixture{
152152
unit: "",
153153
err: "",
154154
},
155-
d: `Desc{fqName: "pg_settings_bool_on_fixture_metric", help: "Foo foo foo", constLabels: {}, variableLabels: []}`,
155+
d: `Desc{fqName: "pg_settings_bool_on_fixture_metric", help: "Server Parameter: bool_on_fixture_metric", constLabels: {}, variableLabels: []}`,
156156
v: 1,
157157
},
158158
{
@@ -168,7 +168,7 @@ var fixtures = []fixture{
168168
unit: "",
169169
err: "",
170170
},
171-
d: `Desc{fqName: "pg_settings_bool_off_fixture_metric", help: "Foo foo foo", constLabels: {}, variableLabels: []}`,
171+
d: `Desc{fqName: "pg_settings_bool_off_fixture_metric", help: "Server Parameter: bool_off_fixture_metric", constLabels: {}, variableLabels: []}`,
172172
v: 0,
173173
},
174174
{
@@ -184,7 +184,7 @@ var fixtures = []fixture{
184184
unit: "seconds",
185185
err: "",
186186
},
187-
d: `Desc{fqName: "pg_settings_special_minus_one_value_seconds", help: "foo foo foo [Units converted to seconds.]", constLabels: {}, variableLabels: []}`,
187+
d: `Desc{fqName: "pg_settings_special_minus_one_value_seconds", help: "Server Parameter: special_minus_one_value [Units converted to seconds.]", constLabels: {}, variableLabels: []}`,
188188
v: -1,
189189
},
190190
{
@@ -200,7 +200,7 @@ var fixtures = []fixture{
200200
unit: "",
201201
err: "",
202202
},
203-
d: `Desc{fqName: "pg_settings_rds_rds_superuser_reserved_connections", help: "Sets the number of connection slots reserved for rds_superusers.", constLabels: {}, variableLabels: []}`,
203+
d: `Desc{fqName: "pg_settings_rds_rds_superuser_reserved_connections", help: "Server Parameter: rds.rds_superuser_reserved_connections", constLabels: {}, variableLabels: []}`,
204204
v: 2,
205205
},
206206
{

0 commit comments

Comments
 (0)