-
Notifications
You must be signed in to change notification settings - Fork 816
Support Prometheus /api/v1/status/buildinfo API on Querier/QFE #4978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ import ( | |
"github.com/prometheus/client_golang/prometheus/promauto" | ||
dto "github.com/prometheus/client_model/go" | ||
"github.com/prometheus/common/route" | ||
"github.com/prometheus/common/version" | ||
"github.com/prometheus/prometheus/config" | ||
"github.com/prometheus/prometheus/storage" | ||
v1 "github.com/prometheus/prometheus/web/api/v1" | ||
|
@@ -211,7 +212,14 @@ func NewQuerierHandler( | |
false, | ||
regexp.MustCompile(".*"), | ||
func() (v1.RuntimeInfo, error) { return v1.RuntimeInfo{}, errors.New("not implemented") }, | ||
&v1.PrometheusVersion{}, | ||
&v1.PrometheusVersion{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why we decided not to support the following?
Not that I want to support them, but I thought it do be nice to have explicit discussion on this as documentation purposes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I could add GoVersion for sure. Thanks for catching. |
||
Version: version.Version, | ||
Branch: version.Branch, | ||
Revision: version.Revision, | ||
BuildUser: version.BuildUser, | ||
BuildDate: version.BuildDate, | ||
GoVersion: version.GoVersion, | ||
}, | ||
// This is used for the stats API which we should not support. Or find other ways to. | ||
prometheus.GathererFunc(func() ([]*dto.MetricFamily, error) { return nil, nil }), | ||
reg, | ||
|
@@ -255,6 +263,7 @@ func NewQuerierHandler( | |
router.Path(path.Join(prefix, "/api/v1/label/{name}/values")).Methods("GET").Handler(promRouter) | ||
router.Path(path.Join(prefix, "/api/v1/series")).Methods("GET", "POST", "DELETE").Handler(promRouter) | ||
router.Path(path.Join(prefix, "/api/v1/metadata")).Methods("GET").Handler(promRouter) | ||
router.Path(path.Join(prefix, "/api/v1/status/buildinfo")).Methods("GET").Handler(promRouter) | ||
|
||
// TODO(gotjosh): This custom handler is temporary until we're able to vendor the changes in: | ||
// https://github.com/prometheus/prometheus/pull/7125/files | ||
|
@@ -268,6 +277,7 @@ func NewQuerierHandler( | |
router.Path(path.Join(legacyPrefix, "/api/v1/label/{name}/values")).Methods("GET").Handler(legacyPromRouter) | ||
router.Path(path.Join(legacyPrefix, "/api/v1/series")).Methods("GET", "POST", "DELETE").Handler(legacyPromRouter) | ||
router.Path(path.Join(legacyPrefix, "/api/v1/metadata")).Methods("GET").Handler(legacyPromRouter) | ||
router.Path(path.Join(legacyPrefix, "/api/v1/status/buildinfo")).Methods("GET").Handler(legacyPromRouter) | ||
|
||
// Track execution time. | ||
return stats.NewWallTimeMiddleware().Wrap(router) | ||
|
Uh oh!
There was an error while loading. Please reload this page.