@@ -366,6 +366,7 @@ func (a *API) RegisterQueryable(
366366
367367// RegisterQueryAPI registers the Prometheus API routes with the provided handler.
368368func (a * API ) RegisterQueryAPI (handler http.Handler ) {
369+ infoHandler := & buildInfoHandler {logger : a .logger }
369370 a .RegisterRoute (path .Join (a .cfg .PrometheusHTTPPrefix , "/api/v1/read" ), handler , true , "POST" )
370371 a .RegisterRoute (path .Join (a .cfg .PrometheusHTTPPrefix , "/api/v1/query" ), handler , true , "GET" , "POST" )
371372 a .RegisterRoute (path .Join (a .cfg .PrometheusHTTPPrefix , "/api/v1/query_range" ), handler , true , "GET" , "POST" )
@@ -374,7 +375,7 @@ func (a *API) RegisterQueryAPI(handler http.Handler) {
374375 a .RegisterRoute (path .Join (a .cfg .PrometheusHTTPPrefix , "/api/v1/label/{name}/values" ), handler , true , "GET" )
375376 a .RegisterRoute (path .Join (a .cfg .PrometheusHTTPPrefix , "/api/v1/series" ), handler , true , "GET" , "POST" , "DELETE" )
376377 a .RegisterRoute (path .Join (a .cfg .PrometheusHTTPPrefix , "/api/v1/metadata" ), handler , true , "GET" )
377- a .RegisterRoute (path .Join (a .cfg .PrometheusHTTPPrefix , "/api/v1/status/buildinfo" ), handler , true , "GET" )
378+ a .RegisterRoute (path .Join (a .cfg .PrometheusHTTPPrefix , "/api/v1/status/buildinfo" ), infoHandler , true , "GET" )
378379
379380 // Register Legacy Routers
380381 a .RegisterRoute (path .Join (a .cfg .LegacyHTTPPrefix , "/api/v1/read" ), handler , true , "POST" )
@@ -385,7 +386,7 @@ func (a *API) RegisterQueryAPI(handler http.Handler) {
385386 a .RegisterRoute (path .Join (a .cfg .LegacyHTTPPrefix , "/api/v1/label/{name}/values" ), handler , true , "GET" )
386387 a .RegisterRoute (path .Join (a .cfg .LegacyHTTPPrefix , "/api/v1/series" ), handler , true , "GET" , "POST" , "DELETE" )
387388 a .RegisterRoute (path .Join (a .cfg .LegacyHTTPPrefix , "/api/v1/metadata" ), handler , true , "GET" )
388- a .RegisterRoute (path .Join (a .cfg .LegacyHTTPPrefix , "/api/v1/status/buildinfo" ), handler , true , "GET" )
389+ a .RegisterRoute (path .Join (a .cfg .LegacyHTTPPrefix , "/api/v1/status/buildinfo" ), infoHandler , true , "GET" )
389390}
390391
391392// RegisterQueryFrontend registers the Prometheus routes supported by the
0 commit comments