mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Plugins: Removed feature toggle enablePluginsTracingByDefault (#85953)
This commit is contained in:
@@ -58,7 +58,6 @@ Some features are enabled by default. You can disable these feature by setting t
|
||||
| `alertingSimplifiedRouting` | Enables users to easily configure alert notifications by specifying a contact point directly when editing or creating an alert rule | Yes |
|
||||
| `logRowsPopoverMenu` | Enable filtering menu displayed when text of a log line is selected | Yes |
|
||||
| `lokiQueryHints` | Enables query hints for Loki | Yes |
|
||||
| `enablePluginsTracingByDefault` | Enable plugin tracing for all external plugins | Yes |
|
||||
| `alertingQueryOptimization` | Optimizes eligible queries in order to reduce load on datasources | |
|
||||
| `betterPageScrolling` | Removes CustomScrollbar from the UI, relying on native browser scrollbars | Yes |
|
||||
| `cloudWatchNewLabelParsing` | Updates CloudWatch label parsing to be more accurate | Yes |
|
||||
|
||||
@@ -157,7 +157,6 @@ export interface FeatureToggles {
|
||||
regressionTransformation?: boolean;
|
||||
lokiQueryHints?: boolean;
|
||||
kubernetesFeatureToggles?: boolean;
|
||||
enablePluginsTracingByDefault?: boolean;
|
||||
cloudRBACRoles?: boolean;
|
||||
alertingQueryOptimization?: boolean;
|
||||
newFolderPicker?: boolean;
|
||||
|
||||
@@ -1035,15 +1035,6 @@ var (
|
||||
AllowSelfServe: false,
|
||||
HideFromAdminPage: true,
|
||||
},
|
||||
{
|
||||
Name: "enablePluginsTracingByDefault",
|
||||
Description: "Enable plugin tracing for all external plugins",
|
||||
FrontendOnly: false,
|
||||
Stage: FeatureStageGeneralAvailability,
|
||||
Owner: grafanaPluginsPlatformSquad,
|
||||
RequiresRestart: true,
|
||||
Expression: "true", // enabled by default
|
||||
},
|
||||
{
|
||||
Name: "cloudRBACRoles",
|
||||
Description: "Enabled grafana cloud specific RBAC roles",
|
||||
|
||||
@@ -138,7 +138,6 @@ tableSharedCrosshair,experimental,@grafana/dataviz-squad,false,false,true
|
||||
regressionTransformation,preview,@grafana/dataviz-squad,false,false,true
|
||||
lokiQueryHints,GA,@grafana/observability-logs,false,false,true
|
||||
kubernetesFeatureToggles,experimental,@grafana/grafana-operator-experience-squad,false,false,true
|
||||
enablePluginsTracingByDefault,GA,@grafana/plugins-platform-backend,false,true,false
|
||||
cloudRBACRoles,experimental,@grafana/identity-access-team,false,true,false
|
||||
alertingQueryOptimization,GA,@grafana/alerting-squad,false,false,false
|
||||
newFolderPicker,experimental,@grafana/grafana-frontend-platform,false,false,true
|
||||
|
||||
|
@@ -563,10 +563,6 @@ const (
|
||||
// Use the kubernetes API for feature toggle management in the frontend
|
||||
FlagKubernetesFeatureToggles = "kubernetesFeatureToggles"
|
||||
|
||||
// FlagEnablePluginsTracingByDefault
|
||||
// Enable plugin tracing for all external plugins
|
||||
FlagEnablePluginsTracingByDefault = "enablePluginsTracingByDefault"
|
||||
|
||||
// FlagCloudRBACRoles
|
||||
// Enabled grafana cloud specific RBAC roles
|
||||
FlagCloudRBACRoles = "cloudRBACRoles"
|
||||
|
||||
@@ -627,7 +627,8 @@
|
||||
"metadata": {
|
||||
"name": "enablePluginsTracingByDefault",
|
||||
"resourceVersion": "1712639261786",
|
||||
"creationTimestamp": "2024-04-09T05:07:41Z"
|
||||
"creationTimestamp": "2024-04-09T05:07:41Z",
|
||||
"deletionTimestamp": "2024-04-11T13:21:52Z"
|
||||
},
|
||||
"spec": {
|
||||
"description": "Enable plugin tracing for all external plugins",
|
||||
|
||||
@@ -14,7 +14,6 @@ import (
|
||||
|
||||
"github.com/grafana/grafana/pkg/plugins"
|
||||
"github.com/grafana/grafana/pkg/plugins/envvars"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
)
|
||||
|
||||
var _ envvars.Provider = (*EnvVarsProvider)(nil)
|
||||
@@ -142,12 +141,7 @@ func (p *EnvVarsProvider) secureSocksProxyEnvVars() []string {
|
||||
}
|
||||
|
||||
func (p *EnvVarsProvider) tracingEnvVars(plugin *plugins.Plugin) []string {
|
||||
pluginTracingEnabled := p.cfg.Features.IsEnabledGlobally(featuremgmt.FlagEnablePluginsTracingByDefault)
|
||||
if v, exists := p.cfg.PluginSettings[plugin.ID]["tracing"]; exists && !pluginTracingEnabled {
|
||||
pluginTracingEnabled = v == "true"
|
||||
}
|
||||
|
||||
if !p.cfg.Tracing.IsEnabled() || !pluginTracingEnabled {
|
||||
if !p.cfg.Tracing.IsEnabled() {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -216,53 +216,24 @@ func TestPluginEnvVarsProvider_tracingEnvironmentVariables(t *testing.T) {
|
||||
cfg: &PluginInstanceCfg{
|
||||
AWSAssumeRoleEnabled: false,
|
||||
Tracing: config.Tracing{},
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
},
|
||||
plugin: defaultPlugin,
|
||||
exp: expNoTracing,
|
||||
},
|
||||
{
|
||||
name: "otel not configured but plugin-tracing enabled",
|
||||
name: "otlp no propagation",
|
||||
cfg: &PluginInstanceCfg{
|
||||
PluginSettings: map[string]map[string]string{pluginID: {"tracing": "true"}},
|
||||
Tracing: config.Tracing{},
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
},
|
||||
plugin: defaultPlugin,
|
||||
exp: expNoTracing,
|
||||
},
|
||||
{
|
||||
name: "otlp no propagation plugin enabled",
|
||||
cfg: &PluginInstanceCfg{
|
||||
PluginSettings: map[string]map[string]string{
|
||||
pluginID: {"tracing": "true"},
|
||||
},
|
||||
Tracing: config.Tracing{
|
||||
OpenTelemetry: defaultOTelCfg,
|
||||
},
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
},
|
||||
|
||||
plugin: defaultPlugin,
|
||||
exp: expDefaultOtlp,
|
||||
},
|
||||
{
|
||||
name: "otlp no propagation disabled by default",
|
||||
cfg: &PluginInstanceCfg{
|
||||
Tracing: config.Tracing{
|
||||
OpenTelemetry: defaultOTelCfg,
|
||||
},
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
},
|
||||
plugin: defaultPlugin,
|
||||
exp: expNoTracing,
|
||||
},
|
||||
{
|
||||
name: "otlp propagation plugin enabled",
|
||||
cfg: &PluginInstanceCfg{
|
||||
PluginSettings: map[string]map[string]string{
|
||||
pluginID: {"tracing": "true"},
|
||||
},
|
||||
AWSAssumeRoleEnabled: true,
|
||||
Tracing: config.Tracing{
|
||||
OpenTelemetry: config.OpenTelemetryCfg{
|
||||
@@ -275,11 +246,10 @@ func TestPluginEnvVarsProvider_tracingEnvironmentVariables(t *testing.T) {
|
||||
SamplerRemoteURL: "",
|
||||
},
|
||||
},
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
},
|
||||
plugin: defaultPlugin,
|
||||
exp: func(t *testing.T, envVars []string) {
|
||||
assert.Len(t, envVars, 8)
|
||||
assert.Len(t, envVars, 7)
|
||||
assert.Equal(t, "GF_VERSION=", envVars[0])
|
||||
assert.Equal(t, "GF_INSTANCE_OTLP_ADDRESS=127.0.0.1:4317", envVars[1])
|
||||
assert.Equal(t, "GF_INSTANCE_OTLP_PROPAGATION=w3c", envVars[2])
|
||||
@@ -287,15 +257,11 @@ func TestPluginEnvVarsProvider_tracingEnvironmentVariables(t *testing.T) {
|
||||
assert.Equal(t, "GF_INSTANCE_OTLP_SAMPLER_PARAM=1.000000", envVars[4])
|
||||
assert.Equal(t, "GF_INSTANCE_OTLP_SAMPLER_REMOTE_URL=", envVars[5])
|
||||
assert.Equal(t, "GF_PLUGIN_VERSION=1.0.0", envVars[6])
|
||||
assert.Equal(t, "GF_PLUGIN_TRACING=true", envVars[7])
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "otlp enabled composite propagation",
|
||||
cfg: &PluginInstanceCfg{
|
||||
PluginSettings: map[string]map[string]string{
|
||||
pluginID: {"tracing": "true"},
|
||||
},
|
||||
AWSAssumeRoleEnabled: true,
|
||||
Tracing: config.Tracing{
|
||||
OpenTelemetry: config.OpenTelemetryCfg{
|
||||
@@ -308,11 +274,10 @@ func TestPluginEnvVarsProvider_tracingEnvironmentVariables(t *testing.T) {
|
||||
SamplerRemoteURL: "",
|
||||
},
|
||||
},
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
},
|
||||
plugin: defaultPlugin,
|
||||
exp: func(t *testing.T, envVars []string) {
|
||||
assert.Len(t, envVars, 8)
|
||||
assert.Len(t, envVars, 7)
|
||||
assert.Equal(t, "GF_VERSION=", envVars[0])
|
||||
assert.Equal(t, "GF_INSTANCE_OTLP_ADDRESS=127.0.0.1:4317", envVars[1])
|
||||
assert.Equal(t, "GF_INSTANCE_OTLP_PROPAGATION=w3c,jaeger", envVars[2])
|
||||
@@ -320,98 +285,14 @@ func TestPluginEnvVarsProvider_tracingEnvironmentVariables(t *testing.T) {
|
||||
assert.Equal(t, "GF_INSTANCE_OTLP_SAMPLER_PARAM=1.000000", envVars[4])
|
||||
assert.Equal(t, "GF_INSTANCE_OTLP_SAMPLER_REMOTE_URL=", envVars[5])
|
||||
assert.Equal(t, "GF_PLUGIN_VERSION=1.0.0", envVars[6])
|
||||
assert.Equal(t, "GF_PLUGIN_TRACING=true", envVars[7])
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "otlp no propagation disabled by default",
|
||||
cfg: &PluginInstanceCfg{
|
||||
Tracing: config.Tracing{
|
||||
OpenTelemetry: config.OpenTelemetryCfg{
|
||||
Address: "127.0.0.1:4317",
|
||||
Propagation: "w3c",
|
||||
},
|
||||
},
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
},
|
||||
plugin: defaultPlugin,
|
||||
exp: expNoTracing,
|
||||
},
|
||||
{
|
||||
name: "disabled on plugin",
|
||||
cfg: &PluginInstanceCfg{
|
||||
PluginSettings: setting.PluginSettings{
|
||||
pluginID: map[string]string{"tracing": "false"},
|
||||
},
|
||||
Tracing: config.Tracing{
|
||||
OpenTelemetry: defaultOTelCfg,
|
||||
},
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
},
|
||||
plugin: defaultPlugin,
|
||||
exp: expNoTracing,
|
||||
},
|
||||
{
|
||||
name: "disabled on plugin with other plugin settings",
|
||||
cfg: &PluginInstanceCfg{
|
||||
PluginSettings: map[string]map[string]string{
|
||||
pluginID: {"some_other_option": "true"},
|
||||
},
|
||||
AWSAssumeRoleEnabled: true,
|
||||
Tracing: config.Tracing{
|
||||
OpenTelemetry: defaultOTelCfg,
|
||||
},
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
},
|
||||
plugin: defaultPlugin,
|
||||
exp: expNoTracing,
|
||||
},
|
||||
{
|
||||
name: "enabled on plugin with other plugin settings",
|
||||
cfg: &PluginInstanceCfg{
|
||||
PluginSettings: map[string]map[string]string{
|
||||
pluginID: {"some_other_option": "true", "tracing": "true"},
|
||||
},
|
||||
Tracing: config.Tracing{
|
||||
OpenTelemetry: defaultOTelCfg,
|
||||
},
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
},
|
||||
plugin: defaultPlugin,
|
||||
exp: expDefaultOtlp,
|
||||
},
|
||||
{
|
||||
name: `enabled on plugin with no "tracing" plugin setting but with enablePluginsTracingByDefault feature flag`,
|
||||
cfg: &PluginInstanceCfg{
|
||||
PluginSettings: map[string]map[string]string{pluginID: {}},
|
||||
Tracing: config.Tracing{
|
||||
OpenTelemetry: defaultOTelCfg,
|
||||
},
|
||||
Features: featuremgmt.WithFeatures(featuremgmt.FlagEnablePluginsTracingByDefault),
|
||||
},
|
||||
plugin: defaultPlugin,
|
||||
exp: expDefaultOtlp,
|
||||
},
|
||||
{
|
||||
name: `enabled on plugin with plugin setting "tracing=false" but with enablePluginsTracingByDefault feature flag`,
|
||||
cfg: &PluginInstanceCfg{
|
||||
PluginSettings: map[string]map[string]string{pluginID: {"tracing": "false"}},
|
||||
Tracing: config.Tracing{
|
||||
OpenTelemetry: defaultOTelCfg,
|
||||
},
|
||||
Features: featuremgmt.WithFeatures(featuremgmt.FlagEnablePluginsTracingByDefault),
|
||||
},
|
||||
plugin: defaultPlugin,
|
||||
exp: expDefaultOtlp,
|
||||
},
|
||||
{
|
||||
name: "GF_PLUGIN_VERSION is not present if tracing is disabled",
|
||||
cfg: &PluginInstanceCfg{
|
||||
PluginSettings: map[string]map[string]string{pluginID: {"tracing": "true"}},
|
||||
Tracing: config.Tracing{
|
||||
OpenTelemetry: config.OpenTelemetryCfg{},
|
||||
},
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
},
|
||||
plugin: defaultPlugin,
|
||||
exp: expGfPluginVersionNotPresent,
|
||||
@@ -419,11 +300,9 @@ func TestPluginEnvVarsProvider_tracingEnvironmentVariables(t *testing.T) {
|
||||
{
|
||||
name: "GF_PLUGIN_VERSION is present if tracing is enabled and plugin has version",
|
||||
cfg: &PluginInstanceCfg{
|
||||
PluginSettings: map[string]map[string]string{pluginID: {"tracing": "true"}},
|
||||
Tracing: config.Tracing{
|
||||
OpenTelemetry: defaultOTelCfg,
|
||||
},
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
},
|
||||
plugin: defaultPlugin,
|
||||
exp: expGfPluginVersionPresent,
|
||||
@@ -431,11 +310,9 @@ func TestPluginEnvVarsProvider_tracingEnvironmentVariables(t *testing.T) {
|
||||
{
|
||||
name: "GF_PLUGIN_VERSION is not present if tracing is enabled but plugin doesn't have a version",
|
||||
cfg: &PluginInstanceCfg{
|
||||
PluginSettings: map[string]map[string]string{pluginID: {"tracing": "true"}},
|
||||
Tracing: config.Tracing{
|
||||
OpenTelemetry: config.OpenTelemetryCfg{},
|
||||
},
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
},
|
||||
plugin: pluginWithoutVersion,
|
||||
exp: expGfPluginVersionNotPresent,
|
||||
@@ -443,7 +320,6 @@ func TestPluginEnvVarsProvider_tracingEnvironmentVariables(t *testing.T) {
|
||||
{
|
||||
name: "no sampling (neversample)",
|
||||
cfg: &PluginInstanceCfg{
|
||||
PluginSettings: map[string]map[string]string{pluginID: {"tracing": "true"}},
|
||||
Tracing: config.Tracing{
|
||||
OpenTelemetry: config.OpenTelemetryCfg{
|
||||
Address: "127.0.0.1:4317",
|
||||
@@ -453,7 +329,6 @@ func TestPluginEnvVarsProvider_tracingEnvironmentVariables(t *testing.T) {
|
||||
SamplerRemoteURL: "",
|
||||
},
|
||||
},
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
},
|
||||
plugin: defaultPlugin,
|
||||
exp: func(t *testing.T, envVars []string) {
|
||||
@@ -465,7 +340,6 @@ func TestPluginEnvVarsProvider_tracingEnvironmentVariables(t *testing.T) {
|
||||
{
|
||||
name: "empty sampler with param",
|
||||
cfg: &PluginInstanceCfg{
|
||||
PluginSettings: map[string]map[string]string{pluginID: {"tracing": "true"}},
|
||||
Tracing: config.Tracing{
|
||||
OpenTelemetry: config.OpenTelemetryCfg{
|
||||
Address: "127.0.0.1:4317",
|
||||
@@ -475,7 +349,6 @@ func TestPluginEnvVarsProvider_tracingEnvironmentVariables(t *testing.T) {
|
||||
SamplerRemoteURL: "",
|
||||
},
|
||||
},
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
},
|
||||
plugin: defaultPlugin,
|
||||
exp: func(t *testing.T, envVars []string) {
|
||||
@@ -487,7 +360,6 @@ func TestPluginEnvVarsProvider_tracingEnvironmentVariables(t *testing.T) {
|
||||
{
|
||||
name: "const sampler with param",
|
||||
cfg: &PluginInstanceCfg{
|
||||
PluginSettings: map[string]map[string]string{pluginID: {"tracing": "true"}},
|
||||
Tracing: config.Tracing{
|
||||
OpenTelemetry: config.OpenTelemetryCfg{
|
||||
Address: "127.0.0.1:4317",
|
||||
@@ -497,7 +369,6 @@ func TestPluginEnvVarsProvider_tracingEnvironmentVariables(t *testing.T) {
|
||||
SamplerRemoteURL: "",
|
||||
},
|
||||
},
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
},
|
||||
plugin: defaultPlugin,
|
||||
exp: func(t *testing.T, envVars []string) {
|
||||
@@ -509,7 +380,6 @@ func TestPluginEnvVarsProvider_tracingEnvironmentVariables(t *testing.T) {
|
||||
{
|
||||
name: "rateLimiting sampler",
|
||||
cfg: &PluginInstanceCfg{
|
||||
PluginSettings: map[string]map[string]string{pluginID: {"tracing": "true"}},
|
||||
Tracing: config.Tracing{
|
||||
OpenTelemetry: config.OpenTelemetryCfg{
|
||||
Address: "127.0.0.1:4317",
|
||||
@@ -519,7 +389,6 @@ func TestPluginEnvVarsProvider_tracingEnvironmentVariables(t *testing.T) {
|
||||
SamplerRemoteURL: "",
|
||||
},
|
||||
},
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
},
|
||||
plugin: defaultPlugin,
|
||||
exp: func(t *testing.T, envVars []string) {
|
||||
@@ -531,8 +400,6 @@ func TestPluginEnvVarsProvider_tracingEnvironmentVariables(t *testing.T) {
|
||||
{
|
||||
name: "remote sampler",
|
||||
cfg: &PluginInstanceCfg{
|
||||
PluginSettings: map[string]map[string]string{pluginID: {"tracing": "true"}},
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
Tracing: config.Tracing{
|
||||
OpenTelemetry: config.OpenTelemetryCfg{
|
||||
Address: "127.0.0.1:4317",
|
||||
|
||||
Reference in New Issue
Block a user