api: new v2 metrics query endpoint
Requests to endpoint will currently will error unless expressions feature flag is true. Co-authored-by: Sofia Papagiannaki <papagian@gmail.com>
This commit is contained in:
committed by
Kyle Brandt
co-authored by
Sofia Papagiannaki
parent
24183ba390
commit
771f21ed09
@@ -45,21 +45,13 @@ type DataSourcePlugin struct {
|
||||
client *plugin.Client
|
||||
}
|
||||
|
||||
func isExpressionsEnabled() bool {
|
||||
v, ok := setting.FeatureToggles["expressions"]
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
func (p *DataSourcePlugin) Load(decoder *json.Decoder, pluginDir string) error {
|
||||
if err := decoder.Decode(&p); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !p.isVersionOne() && !isExpressionsEnabled() {
|
||||
return errors.New("A plugin version 2 was found but expressions feature toggle are not enabled")
|
||||
if !p.isVersionOne() && !setting.IsExpressionsEnabled() {
|
||||
return errors.New("A plugin version 2 was found but expressions feature toggle is not enabled")
|
||||
}
|
||||
|
||||
if err := p.registerPlugin(pluginDir); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user