Skip to content

Commit ffa6782

Browse files
committed
fix parsing include databases
Signed-off-by: Paul van der Linden <[email protected]>
1 parent cbc6ae3 commit ffa6782

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/postgres_exporter/postgres_exporter.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,9 @@ func ExcludeDatabases(s string) ExporterOpt {
11491149
// IncludeDatabases allows to filter result from AutoDiscoverDatabases
11501150
func IncludeDatabases(s string) ExporterOpt {
11511151
return func(e *Exporter) {
1152-
e.includeDatabases = strings.Split(s, ",")
1152+
if len(s) > 0 {
1153+
e.includeDatabases = strings.Split(s, ",")
1154+
}
11531155
}
11541156
}
11551157

0 commit comments

Comments
 (0)