diff --git a/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md b/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md index 9c4317b8f0a..e9c5199ded5 100644 --- a/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md +++ b/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md @@ -140,12 +140,10 @@ Experimental features might be changed or removed without prior notice. | `permissionsFilterRemoveSubquery` | Alternative permission filter implementation that does not use subqueries for fetching the dashboard folder | | `angularDeprecationUI` | Display new Angular deprecation-related UI features | | `sseGroupByDatasource` | Send query to the same datasource in a single request when using server side expressions. The `cloudWatchBatchQueries` feature toggle should be enabled if this used with CloudWatch. | -| `requestInstrumentationStatusSource` | Include a status source label for request metrics and logs | | `libraryPanelRBAC` | Enables RBAC support for library panels | | `wargamesTesting` | Placeholder feature flag for internal testing | | `externalCorePlugins` | Allow core plugins to be loaded as external | | `pluginsAPIMetrics` | Sends metrics of public grafana packages usage by plugins | -| `httpSLOLevels` | Adds SLO level to http request metrics | | `idForwarding` | Generate signed id token for identity that can be forwarded to plugins and external services | | `panelMonitoring` | Enables panel monitoring through logs and measurements | | `enableNativeHTTPHistogram` | Enables native HTTP Histograms | diff --git a/packages/grafana-data/src/types/featureToggles.gen.ts b/packages/grafana-data/src/types/featureToggles.gen.ts index b77af68741e..9a833fc0e81 100644 --- a/packages/grafana-data/src/types/featureToggles.gen.ts +++ b/packages/grafana-data/src/types/featureToggles.gen.ts @@ -114,14 +114,12 @@ export interface FeatureToggles { dashgpt?: boolean; reportingRetries?: boolean; sseGroupByDatasource?: boolean; - requestInstrumentationStatusSource?: boolean; libraryPanelRBAC?: boolean; lokiRunQueriesInParallel?: boolean; wargamesTesting?: boolean; alertingInsights?: boolean; externalCorePlugins?: boolean; pluginsAPIMetrics?: boolean; - httpSLOLevels?: boolean; idForwarding?: boolean; cloudWatchWildCardDimensionValues?: boolean; externalServiceAccounts?: boolean; diff --git a/pkg/middleware/loggermw/logger.go b/pkg/middleware/loggermw/logger.go index a4bfe1003bc..b0bba7d3fdb 100644 --- a/pkg/middleware/loggermw/logger.go +++ b/pkg/middleware/loggermw/logger.go @@ -128,10 +128,8 @@ func (l *loggerImpl) prepareLogParams(c *contextmodel.ReqContext, duration time. logParams = append(logParams, "handler", handler) } - if l.flags.IsEnabled(r.Context(), featuremgmt.FlagRequestInstrumentationStatusSource) { - rmd := requestmeta.GetRequestMetaData(c.Req.Context()) - logParams = append(logParams, "status_source", rmd.StatusSource) - } + rmd := requestmeta.GetRequestMetaData(c.Req.Context()) + logParams = append(logParams, "status_source", rmd.StatusSource) logParams = append(logParams, errorLogParams(c.Error)...) diff --git a/pkg/middleware/request_metrics.go b/pkg/middleware/request_metrics.go index ad614581a0b..b109a52a56f 100644 --- a/pkg/middleware/request_metrics.go +++ b/pkg/middleware/request_metrics.go @@ -35,20 +35,12 @@ func RequestMetrics(features featuremgmt.FeatureToggles, cfg *setting.Cfg, promR }, ) - histogramLabels := []string{"handler", "status_code", "method"} - - if features.IsEnabledGlobally(featuremgmt.FlagRequestInstrumentationStatusSource) { - histogramLabels = append(histogramLabels, "status_source") - } + histogramLabels := []string{"handler", "status_code", "method", "status_source", "slo_group"} if cfg.MetricsIncludeTeamLabel { histogramLabels = append(histogramLabels, "grafana_team") } - if features.IsEnabledGlobally(featuremgmt.FlagHttpSLOLevels) { - histogramLabels = append(histogramLabels, "slo_group") - } - histogramOptions := prometheus.HistogramOpts{ Namespace: "grafana", Name: "http_request_duration_seconds", @@ -104,18 +96,12 @@ func RequestMetrics(features featuremgmt.FeatureToggles, cfg *setting.Cfg, promR labelValues := []string{handler, code, r.Method} rmd := requestmeta.GetRequestMetaData(r.Context()) - if features.IsEnabled(r.Context(), featuremgmt.FlagRequestInstrumentationStatusSource) { - labelValues = append(labelValues, string(rmd.StatusSource)) - } + labelValues = append(labelValues, string(rmd.StatusSource), string(rmd.SLOGroup)) if cfg.MetricsIncludeTeamLabel { labelValues = append(labelValues, rmd.Team) } - if features.IsEnabled(r.Context(), featuremgmt.FlagHttpSLOLevels) { - labelValues = append(labelValues, string(rmd.SLOGroup)) - } - // avoiding the sanitize functions for in the new instrumentation // since they dont make much sense. We should remove them later. histogram := httpRequestDurationHistogram. diff --git a/pkg/services/featuremgmt/registry.go b/pkg/services/featuremgmt/registry.go index 86dcfac0f2e..e9e85ae9f58 100644 --- a/pkg/services/featuremgmt/registry.go +++ b/pkg/services/featuremgmt/registry.go @@ -818,14 +818,6 @@ var ( Owner: grafanaObservabilityMetricsSquad, Created: time.Date(2023, time.September, 7, 12, 0, 0, 0, time.UTC), }, - { - Name: "requestInstrumentationStatusSource", - Description: "Include a status source label for request metrics and logs", - Stage: FeatureStageExperimental, - FrontendOnly: false, - Owner: grafanaPluginsPlatformSquad, - Created: time.Date(2023, time.September, 11, 12, 0, 0, 0, time.UTC), - }, { Name: "libraryPanelRBAC", Description: "Enables RBAC support for library panels", @@ -877,15 +869,6 @@ var ( Owner: grafanaPluginsPlatformSquad, Created: time.Date(2023, time.September, 21, 12, 0, 0, 0, time.UTC), }, - { - Name: "httpSLOLevels", - Description: "Adds SLO level to http request metrics", - Stage: FeatureStageExperimental, - FrontendOnly: false, - Owner: hostedGrafanaTeam, - RequiresRestart: true, - Created: time.Date(2023, time.September, 22, 12, 0, 0, 0, time.UTC), - }, { Name: "idForwarding", Description: "Generate signed id token for identity that can be forwarded to plugins and external services", diff --git a/pkg/services/featuremgmt/toggles_gen.csv b/pkg/services/featuremgmt/toggles_gen.csv index 1b924499fca..0f12326443a 100644 --- a/pkg/services/featuremgmt/toggles_gen.csv +++ b/pkg/services/featuremgmt/toggles_gen.csv @@ -95,14 +95,12 @@ angularDeprecationUI,experimental,@grafana/plugins-platform-backend,2023-08-29,f dashgpt,preview,@grafana/dashboards-squad,2023-11-17,false,false,true reportingRetries,preview,@grafana/sharing-squad,2023-08-31,false,true,false sseGroupByDatasource,experimental,@grafana/observability-metrics,2023-09-07,false,false,false -requestInstrumentationStatusSource,experimental,@grafana/plugins-platform-backend,2023-09-11,false,false,false libraryPanelRBAC,experimental,@grafana/dashboards-squad,2023-10-11,false,true,false lokiRunQueriesInParallel,privatePreview,@grafana/observability-logs,2023-09-19,false,false,false wargamesTesting,experimental,@grafana/hosted-grafana-team,2023-09-13,false,false,false alertingInsights,GA,@grafana/alerting-squad,2023-09-14,false,false,true externalCorePlugins,experimental,@grafana/plugins-platform-backend,2023-09-22,false,false,false pluginsAPIMetrics,experimental,@grafana/plugins-platform-backend,2023-09-21,false,false,true -httpSLOLevels,experimental,@grafana/hosted-grafana-team,2023-09-22,false,true,false idForwarding,experimental,@grafana/identity-access-team,2023-09-25,false,false,false cloudWatchWildCardDimensionValues,GA,@grafana/aws-datasources,2023-09-27,false,false,false externalServiceAccounts,preview,@grafana/identity-access-team,2023-09-28,false,false,false diff --git a/pkg/services/featuremgmt/toggles_gen.go b/pkg/services/featuremgmt/toggles_gen.go index 5d06415a45c..7cb886c35d0 100644 --- a/pkg/services/featuremgmt/toggles_gen.go +++ b/pkg/services/featuremgmt/toggles_gen.go @@ -391,10 +391,6 @@ const ( // Send query to the same datasource in a single request when using server side expressions. The `cloudWatchBatchQueries` feature toggle should be enabled if this used with CloudWatch. FlagSseGroupByDatasource = "sseGroupByDatasource" - // FlagRequestInstrumentationStatusSource - // Include a status source label for request metrics and logs - FlagRequestInstrumentationStatusSource = "requestInstrumentationStatusSource" - // FlagLibraryPanelRBAC // Enables RBAC support for library panels FlagLibraryPanelRBAC = "libraryPanelRBAC" @@ -419,10 +415,6 @@ const ( // Sends metrics of public grafana packages usage by plugins FlagPluginsAPIMetrics = "pluginsAPIMetrics" - // FlagHttpSLOLevels - // Adds SLO level to http request metrics - FlagHttpSLOLevels = "httpSLOLevels" - // FlagIdForwarding // Generate signed id token for identity that can be forwarded to plugins and external services FlagIdForwarding = "idForwarding"