Skip to content

Commit

Permalink
Fix version in APIv1 deprecation notice (prometheus#3815)
Browse files Browse the repository at this point in the history
Signed-off-by: George Robinson <george.robinson@grafana.com>
  • Loading branch information
grobinson-grafana authored Apr 23, 2024
1 parent dc1e1a2 commit 7106bcc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func New(opts Options) (*API, error) {
// true for the concurrency limit, with the exception that it is only applied to
// GET requests.
func (api *API) Register(r *route.Router, routePrefix string) *http.ServeMux {
// TODO(gotjosh) API V1 was removed as of version 0.28, when we reach 1.0.0 we should removed these deprecation warnings.
// TODO(gotjosh) API V1 was removed as of version 0.27, when we reach 1.0.0 we should removed these deprecation warnings.
api.deprecationRouter.Register(r.WithPrefix("/api/v1"))

mux := http.NewServeMux()
Expand Down
2 changes: 1 addition & 1 deletion api/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Alerts struct {
}

// NewAlerts returns an *Alerts struct for the given API version.
// Since v1 was deprecated in 0.28, v2 is now hardcoded.
// Since v1 was deprecated in 0.27, v2 is now hardcoded.
func NewAlerts(r prometheus.Registerer) *Alerts {
numReceivedAlerts := prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "alertmanager_alerts_received_total",
Expand Down
2 changes: 1 addition & 1 deletion api/v1_deprecation_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (dr *V1DeprecationRouter) deprecationHandler(w http.ResponseWriter, req *ht
Error string `json:"error"`
}{
"deprecated",
"The Alertmanager v1 API was deprecated in version 0.16.0 and is removed as of version 0.28.0 - please use the equivalent route in the v2 API",
"The Alertmanager v1 API was deprecated in version 0.16.0 and is removed as of version 0.27.0 - please use the equivalent route in the v2 API",
}

w.Header().Set("Content-Type", "application/json")
Expand Down

0 comments on commit 7106bcc

Please sign in to comment.