Skip to content

Commit dce6fac

Browse files
committed
Remove the call from unused places where 'runOnServer' is not required.
Only Server type hold that value.
1 parent 3362288 commit dce6fac

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

cmd/postgres_exporter/postgres_exporter.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ type intermediateMetricMap struct {
158158
columnMappings map[string]ColumnMapping
159159
master bool
160160
cacheSeconds uint64
161-
runonserver string
162161
}
163162

164163
// MetricMapNamespace groups metric maps under a shared set of labels.
@@ -167,7 +166,6 @@ type MetricMapNamespace struct {
167166
columnMappings map[string]MetricMap // Column mappings in this namespace
168167
master bool // Call query only for master database
169168
cacheSeconds uint64 // Number of seconds this metric namespace can be cached. 0 disables.
170-
runonserver string // Run the query on which server version
171169
}
172170

173171
// MetricMap stores the prometheus metric description which a given column will
@@ -227,7 +225,6 @@ var builtinMetricMaps = map[string]intermediateMetricMap{
227225
},
228226
true,
229227
0,
230-
"",
231228
},
232229
"pg_stat_database": {
233230
map[string]ColumnMapping{
@@ -253,7 +250,6 @@ var builtinMetricMaps = map[string]intermediateMetricMap{
253250
},
254251
true,
255252
0,
256-
"",
257253
},
258254
"pg_stat_database_conflicts": {
259255
map[string]ColumnMapping{
@@ -267,7 +263,6 @@ var builtinMetricMaps = map[string]intermediateMetricMap{
267263
},
268264
true,
269265
0,
270-
"",
271266
},
272267
"pg_locks": {
273268
map[string]ColumnMapping{
@@ -277,7 +272,6 @@ var builtinMetricMaps = map[string]intermediateMetricMap{
277272
},
278273
true,
279274
0,
280-
"",
281275
},
282276
"pg_stat_replication": {
283277
map[string]ColumnMapping{
@@ -324,7 +318,6 @@ var builtinMetricMaps = map[string]intermediateMetricMap{
324318
},
325319
true,
326320
0,
327-
"",
328321
},
329322
"pg_replication_slots": {
330323
map[string]ColumnMapping{
@@ -349,7 +342,6 @@ var builtinMetricMaps = map[string]intermediateMetricMap{
349342
},
350343
true,
351344
0,
352-
"",
353345
},
354346
"pg_stat_activity": {
355347
map[string]ColumnMapping{
@@ -360,7 +352,6 @@ var builtinMetricMaps = map[string]intermediateMetricMap{
360352
},
361353
true,
362354
0,
363-
"",
364355
},
365356
}
366357

@@ -543,7 +534,6 @@ func parseUserQueries(content []byte) (map[string]intermediateMetricMap, map[str
543534
columnMappings: newMetricMap,
544535
master: specs.Master,
545536
cacheSeconds: specs.CacheSeconds,
546-
runonserver: specs.RunOnServer,
547537
}
548538
metricMaps[metric] = metricMap
549539
}
@@ -736,7 +726,7 @@ func makeDescMap(pgVersion semver.Version, serverLabels prometheus.Labels, metri
736726
}
737727
}
738728

739-
metricMap[namespace] = MetricMapNamespace{variableLabels, thisMap, intermediateMappings.master, intermediateMappings.cacheSeconds, intermediateMappings.runonserver}
729+
metricMap[namespace] = MetricMapNamespace{variableLabels, thisMap, intermediateMappings.master, intermediateMappings.cacheSeconds}
740730
}
741731

742732
return metricMap

0 commit comments

Comments
 (0)