Alerting: Log expression command types during evaluation (#84614)
This commit is contained in:
@@ -31,6 +31,8 @@ type Command interface {
|
||||
// Execute creates a payload send request to the ML API by calling the function argument sendRequest, and then parses response.
|
||||
// Function sendRequest is supposed to abstract the client configuration such creating http request, adding authorization parameters, host etc.
|
||||
Execute(from, to time.Time, sendRequest func(method string, path string, payload []byte) (response.Response, error)) (*backend.QueryDataResponse, error)
|
||||
|
||||
Type() string
|
||||
}
|
||||
|
||||
// UnmarshalCommand parses a config parameters and creates a command. Requires key `type` to be specified.
|
||||
|
||||
@@ -19,6 +19,10 @@ type OutlierCommand struct {
|
||||
|
||||
var _ Command = OutlierCommand{}
|
||||
|
||||
func (c OutlierCommand) Type() string {
|
||||
return "outlier"
|
||||
}
|
||||
|
||||
func (c OutlierCommand) DatasourceUID() string {
|
||||
return c.config.DatasourceUID
|
||||
}
|
||||
|
||||
@@ -42,3 +42,7 @@ func (f *FakeCommand) Execute(from, to time.Time, executor func(method string, p
|
||||
}
|
||||
return f.Response, f.Error
|
||||
}
|
||||
|
||||
func (f *FakeCommand) Type() string {
|
||||
return "fake"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user