mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Plugins: Add optional logger for plugin requests sent to backend plugins (#62981)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
"github.com/grafana/grafana-azure-sdk-go/azsettings"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
)
|
||||
|
||||
@@ -64,7 +63,7 @@ func NewCfg(settingProvider setting.Provider, grafanaCfg *setting.Cfg) *Cfg {
|
||||
AWSAllowedAuthProviders: allowedAuth,
|
||||
AWSAssumeRoleEnabled: aws.KeyValue("assume_role_enabled").MustBool(grafanaCfg.AWSAssumeRoleEnabled),
|
||||
Azure: grafanaCfg.Azure,
|
||||
LogDatasourceRequests: grafanaCfg.IsFeatureToggleEnabled(featuremgmt.FlagDatasourceLogger),
|
||||
LogDatasourceRequests: grafanaCfg.PluginLogBackendRequests,
|
||||
PluginsCDNURLTemplate: grafanaCfg.PluginsCDNURLTemplate,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,11 +306,6 @@ var (
|
||||
Description: "Use double quotes to escape keyword in a MySQL query",
|
||||
State: FeatureStateAlpha,
|
||||
},
|
||||
{
|
||||
Name: "datasourceLogger",
|
||||
Description: "Logs all datasource requests",
|
||||
State: FeatureStateBeta,
|
||||
},
|
||||
{
|
||||
Name: "accessControlOnCall",
|
||||
Description: "Access control primitives for OnCall",
|
||||
|
||||
@@ -223,10 +223,6 @@ const (
|
||||
// Use double quotes to escape keyword in a MySQL query
|
||||
FlagMysqlAnsiQuotes = "mysqlAnsiQuotes"
|
||||
|
||||
// FlagDatasourceLogger
|
||||
// Logs all datasource requests
|
||||
FlagDatasourceLogger = "datasourceLogger"
|
||||
|
||||
// FlagAccessControlOnCall
|
||||
// Access control primitives for OnCall
|
||||
FlagAccessControlOnCall = "accessControlOnCall"
|
||||
|
||||
@@ -276,7 +276,8 @@ type Cfg struct {
|
||||
PluginAdminEnabled bool
|
||||
PluginAdminExternalManageEnabled bool
|
||||
|
||||
PluginsCDNURLTemplate string
|
||||
PluginsCDNURLTemplate string
|
||||
PluginLogBackendRequests bool
|
||||
|
||||
// Panels
|
||||
DisableSanitizeHtml bool
|
||||
|
||||
@@ -50,6 +50,7 @@ func (cfg *Cfg) readPluginSettings(iniFile *ini.File) error {
|
||||
|
||||
// Plugins CDN settings
|
||||
cfg.PluginsCDNURLTemplate = strings.TrimRight(pluginsSection.Key("cdn_base_url").MustString(""), "/")
|
||||
cfg.PluginLogBackendRequests = pluginsSection.Key("log_backend_requests").MustBool(false)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user