@@ -110,6 +110,9 @@ var (
110
110
}
111
111
112
112
configMap = map [string ]* (prometheus.Desc ){
113
+ "auth_type" : prometheus .NewDesc (
114
+ prometheus .BuildFQName (namespace , "config" , "authorization_type" ),
115
+ "Config maximum number of client connections" , []string {"method" }, nil ),
113
116
"max_client_conn" : prometheus .NewDesc (
114
117
prometheus .BuildFQName (namespace , "config" , "max_client_connections" ),
115
118
"Config maximum number of client connections" , nil , nil ),
@@ -223,11 +226,14 @@ func queryShowConfig(ch chan<- prometheus.Metric, db *sql.DB, logger *slog.Logge
223
226
}
224
227
225
228
value , err := strconv .ParseFloat (string (values ), 64 )
229
+ labelValues := []string {}
226
230
if err != nil {
227
- return fmt .Errorf ("error parsing SHOW CONFIG column: %v, error: %w " , key , err )
231
+ // We couldn't parse the value as a float, so treat it as a string
232
+ value = 1.0
233
+ labelValues = append (labelValues , string (values ))
228
234
}
229
235
if metric , ok := configMap [key ]; ok {
230
- ch <- prometheus .MustNewConstMetric (metric , prometheus .GaugeValue , value )
236
+ ch <- prometheus .MustNewConstMetric (metric , prometheus .GaugeValue , value , labelValues ... )
231
237
} else {
232
238
logger .Debug ("SHOW CONFIG unknown config" , "config" , key )
233
239
}
0 commit comments