-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
pkg/api/alertmanager.go
Outdated
@@ -9,79 +9,79 @@ import ( | |||
"github.com/prometheus/alertmanager/config" | |||
) | |||
|
|||
// swagger:route POST /api/v1/config alertmanager RoutePostAlertingConfig | |||
// swagger:route POST /api/am/{DatasourceId}/v1/config alertmanager RoutePostAlertingConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re our discussion yesterday, to align with cloud, it should probably be: /alertmanager/{DatasourceId}/api/v1/config
, and likewise for other endpoitns
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In grafana we prefer identifying datasources using their UID. Also the datasourceId
property differs from the datasource name (it's an integer). Therefore, I would suggest changing it to DatasourceUID
. If that's not possible and we still need to use the datasource name, I would suggest to use DatasourceName
instead (for not confusing the grafana users).
|
pkg/api/alertmanager.go
Outdated
// | ||
// deletes the Alerting config for a tenant | ||
// | ||
// Responses: | ||
// 200: Ack | ||
// 400: ValidationError | ||
|
||
// swagger:route GET /api/v1/alerts alertmanager RouteGetAmAlerts | ||
// swagger:route GET /api/am/{DatasourceId}/v1/alerts alertmanager RouteGetAmAlerts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got the impression that for conformance with the existing API we cannot change the path just adding a prefix. Therefore I think that it should become:
/am/{DatasourceId}/api/v1/alerts
.
I've merged in master & readjusted the endpoints. The "config" endpoints now use |
This allows differentiating alerting backends based on a datasource ID.
Followup: replace the two
(Alertmanager, GrafanaManaged)
routing trees from theApiAlertingConfig
. Now that we can differentiate by datasource, we can validate a single routing tree based on which datasource it references.