@@ -25,7 +25,6 @@ import (
25
25
"github.com/prometheus/common/model"
26
26
"github.com/prometheus/common/route"
27
27
28
- apiv1 "github.com/prometheus/alertmanager/api/v1"
29
28
apiv2 "github.com/prometheus/alertmanager/api/v2"
30
29
"github.com/prometheus/alertmanager/cluster"
31
30
"github.com/prometheus/alertmanager/config"
@@ -37,7 +36,6 @@ import (
37
36
38
37
// API represents all APIs of Alertmanager.
39
38
type API struct {
40
- v1 * apiv1.API
41
39
v2 * apiv2.API
42
40
requestsInFlight prometheus.Gauge
43
41
concurrencyLimitExceeded prometheus.Counter
@@ -110,15 +108,6 @@ func New(opts Options) (*API, error) {
110
108
}
111
109
}
112
110
113
- v1 := apiv1 .New (
114
- opts .Alerts ,
115
- opts .Silences ,
116
- opts .StatusFunc ,
117
- opts .Peer ,
118
- log .With (l , "version" , "v1" ),
119
- opts .Registry ,
120
- )
121
-
122
111
v2 , err := apiv2 .NewAPI (
123
112
opts .Alerts ,
124
113
opts .GroupFunc ,
@@ -154,7 +143,6 @@ func New(opts Options) (*API, error) {
154
143
}
155
144
156
145
return & API {
157
- v1 : v1 ,
158
146
v2 : v2 ,
159
147
requestsInFlight : requestsInFlight ,
160
148
concurrencyLimitExceeded : concurrencyLimitExceeded ,
@@ -163,17 +151,14 @@ func New(opts Options) (*API, error) {
163
151
}, nil
164
152
}
165
153
166
- // Register all APIs. It registers APIv1 with the provided router directly. As
167
- // APIv2 works on the http.Handler level, this method also creates a new
154
+ // Register all APIs. As APIv2 works on the http.Handler level, this method also creates a new
168
155
// http.ServeMux and then uses it to register both the provided router (to
169
156
// handle "/") and APIv2 (to handle "<routePrefix>/api/v2"). The method returns
170
157
// the newly created http.ServeMux. If a timeout has been set on construction of
171
158
// API, it is enforced for all HTTP request going through this mux. The same is
172
159
// true for the concurrency limit, with the exception that it is only applied to
173
160
// GET requests.
174
161
func (api * API ) Register (r * route.Router , routePrefix string ) * http.ServeMux {
175
- api .v1 .Register (r .WithPrefix ("/api/v1" ))
176
-
177
162
mux := http .NewServeMux ()
178
163
mux .Handle ("/" , api .limitHandler (r ))
179
164
@@ -196,7 +181,6 @@ func (api *API) Register(r *route.Router, routePrefix string) *http.ServeMux {
196
181
// Update config and resolve timeout of each API. APIv2 also needs
197
182
// setAlertStatus to be updated.
198
183
func (api * API ) Update (cfg * config.Config , setAlertStatus func (model.LabelSet )) {
199
- api .v1 .Update (cfg )
200
184
api .v2 .Update (cfg , setAlertStatus )
201
185
}
202
186
0 commit comments