@@ -154,7 +154,7 @@ func GetMonitoredDatabaseSettings(ctx context.Context, md *sources.SourceConn, n
154154 }
155155 matches := rBouncerAndPgpoolVerMatch .FindStringSubmatch (dbNewSettings .VersionStr )
156156 if len (matches ) != 1 {
157- return dbSettings , fmt .Errorf ("Unexpected PgBouncer version input: %s" , dbNewSettings .VersionStr )
157+ return dbSettings , fmt .Errorf ("unexpected PgBouncer version input: %s" , dbNewSettings .VersionStr )
158158 }
159159 dbNewSettings .Version = VersionToInt (matches [0 ])
160160 case sources .SourcePgPool :
@@ -164,7 +164,7 @@ func GetMonitoredDatabaseSettings(ctx context.Context, md *sources.SourceConn, n
164164
165165 matches := rBouncerAndPgpoolVerMatch .FindStringSubmatch (dbNewSettings .VersionStr )
166166 if len (matches ) != 1 {
167- return dbSettings , fmt .Errorf ("Unexpected PgPool version input: %s" , dbNewSettings .VersionStr )
167+ return dbSettings , fmt .Errorf ("unexpected PgPool version input: %s" , dbNewSettings .VersionStr )
168168 }
169169 dbNewSettings .Version = VersionToInt (matches [0 ])
170170 default :
@@ -708,11 +708,12 @@ func FetchMetricsPgpool(ctx context.Context, msg MetricFetchConfig, vme Monitore
708708 retRow [k ] = vs
709709 if k == "status" { // was changed from numeric to string at some pgpool version so leave the string
710710 // but also add "status_num" field
711- if vs == "up" {
711+ switch vs {
712+ case "up" :
712713 retRow ["status_num" ] = 1
713- } else if vs == "down" {
714+ case "down" :
714715 retRow ["status_num" ] = 0
715- } else {
716+ default :
716717 i , err := strconv .ParseInt (vs , 10 , 64 )
717718 if err == nil {
718719 retRow ["status_num" ] = i
0 commit comments