Documentation ¶
Index ¶
- Constants
- func GetEmbeddedFeatureList() (featuretoggle.FeatureList, error)
- type FeatureFlag
- type FeatureFlagStage
- type FeatureManager
- func (fm *FeatureManager) GetEnabled(ctx context.Context) map[string]bool
- func (fm *FeatureManager) GetFlags() []FeatureFlag
- func (fm *FeatureManager) GetStartupFlags() map[string]bool
- func (fm *FeatureManager) GetUsageStats(ctx context.Context) map[string]any
- func (fm *FeatureManager) GetWarning() map[string]string
- func (fm *FeatureManager) IsEditableFromAdminPage(key string) bool
- func (fm *FeatureManager) IsEnabled(ctx context.Context, flag string) bool
- func (fm *FeatureManager) IsEnabledGlobally(flag string) bool
- func (fm *FeatureManager) IsFeatureEditingAllowed() bool
- func (fm *FeatureManager) IsHiddenFromAdminPage(key string, lenient bool) bool
- func (fm *FeatureManager) IsRestartRequired() bool
- func (fm *FeatureManager) SetRestartRequired()
- type FeatureToggleWebhookPayload
- type FeatureToggles
Constants ¶
const ( // FlagDisableEnvelopeEncryption // Disable envelope encryption (emergency only) FlagDisableEnvelopeEncryption = "disableEnvelopeEncryption" // FlagLiveServiceWebWorker // This will use a webworker thread to processes events rather than the main thread FlagLiveServiceWebWorker = "live-service-web-worker" // FlagQueryOverLive // Use Grafana Live WebSocket to execute backend queries FlagQueryOverLive = "queryOverLive" // FlagPanelTitleSearch // Search for dashboards using panel title FlagPanelTitleSearch = "panelTitleSearch" // FlagPublicDashboards // [Deprecated] Public dashboards are now enabled by default; to disable them, use the configuration setting. This feature toggle will be removed in the next major version. FlagPublicDashboards = "publicDashboards" // FlagPublicDashboardsEmailSharing // Enables public dashboard sharing to be restricted to only allowed emails FlagPublicDashboardsEmailSharing = "publicDashboardsEmailSharing" // FlagPublicDashboardsScene // Enables public dashboard rendering using scenes FlagPublicDashboardsScene = "publicDashboardsScene" // FlagLokiExperimentalStreaming // Support new streaming approach for loki (prototype, needs special loki build) FlagLokiExperimentalStreaming = "lokiExperimentalStreaming" // FlagFeatureHighlights // Highlight Grafana Enterprise features FlagFeatureHighlights = "featureHighlights" // FlagStorage // Configurable storage for dashboards, datasources, and resources FlagStorage = "storage" // FlagCorrelations // Correlations page FlagCorrelations = "correlations" // FlagExploreContentOutline // Content outline sidebar FlagExploreContentOutline = "exploreContentOutline" // FlagDatasourceQueryMultiStatus // Introduce HTTP 207 Multi Status for api/ds/query FlagDatasourceQueryMultiStatus = "datasourceQueryMultiStatus" // FlagAutoMigrateOldPanels // Migrate old angular panels to supported versions (graph, table-old, worldmap, etc) FlagAutoMigrateOldPanels = "autoMigrateOldPanels" // FlagAutoMigrateGraphPanel // Migrate old graph panel to supported time series panel - broken out from autoMigrateOldPanels to enable granular tracking FlagAutoMigrateGraphPanel = "autoMigrateGraphPanel" // FlagAutoMigrateTablePanel // Migrate old table panel to supported table panel - broken out from autoMigrateOldPanels to enable granular tracking FlagAutoMigrateTablePanel = "autoMigrateTablePanel" // FlagAutoMigratePiechartPanel // Migrate old piechart panel to supported piechart panel - broken out from autoMigrateOldPanels to enable granular tracking FlagAutoMigratePiechartPanel = "autoMigratePiechartPanel" // FlagAutoMigrateWorldmapPanel // Migrate old worldmap panel to supported geomap panel - broken out from autoMigrateOldPanels to enable granular tracking FlagAutoMigrateWorldmapPanel = "autoMigrateWorldmapPanel" // FlagAutoMigrateStatPanel // Migrate old stat panel to supported stat panel - broken out from autoMigrateOldPanels to enable granular tracking FlagAutoMigrateStatPanel = "autoMigrateStatPanel" // FlagAutoMigrateXYChartPanel // Migrate old XYChart panel to new XYChart2 model FlagAutoMigrateXYChartPanel = "autoMigrateXYChartPanel" // FlagDisableAngular // Dynamic flag to disable angular at runtime. The preferred method is to set `angular_support_enabled` to `false` in the [security] settings, which allows you to change the state at runtime. FlagDisableAngular = "disableAngular" // FlagCanvasPanelNesting // Allow elements nesting FlagCanvasPanelNesting = "canvasPanelNesting" // FlagScenes // Experimental framework to build interactive dashboards FlagScenes = "scenes" // FlagDisableSecretsCompatibility // Disable duplicated secret storage in legacy tables FlagDisableSecretsCompatibility = "disableSecretsCompatibility" // FlagLogRequestsInstrumentedAsUnknown // Logs the path for requests that are instrumented as unknown FlagLogRequestsInstrumentedAsUnknown = "logRequestsInstrumentedAsUnknown" // Enables topnav support in external plugins. The new Grafana navigation cannot be disabled. FlagTopnav = "topnav" // FlagGrpcServer // Run the GRPC server FlagGrpcServer = "grpcServer" // FlagUnifiedStorage // SQL-based k8s storage FlagUnifiedStorage = "unifiedStorage" // FlagCloudWatchCrossAccountQuerying // Enables cross-account querying in CloudWatch datasources FlagCloudWatchCrossAccountQuerying = "cloudWatchCrossAccountQuerying" // FlagShowDashboardValidationWarnings // Show warnings when dashboards do not validate against the schema FlagShowDashboardValidationWarnings = "showDashboardValidationWarnings" // FlagMysqlAnsiQuotes // Use double quotes to escape keyword in a MySQL query FlagMysqlAnsiQuotes = "mysqlAnsiQuotes" // FlagAccessControlOnCall // Access control primitives for OnCall FlagAccessControlOnCall = "accessControlOnCall" // FlagNestedFolders // Enable folder nesting FlagNestedFolders = "nestedFolders" // FlagAlertingBacktesting // Rule backtesting API for alerting FlagAlertingBacktesting = "alertingBacktesting" // FlagEditPanelCSVDragAndDrop // Enables drag and drop for CSV and Excel files FlagEditPanelCSVDragAndDrop = "editPanelCSVDragAndDrop" // FlagAlertingNoNormalState // Stop maintaining state of alerts that are not firing FlagAlertingNoNormalState = "alertingNoNormalState" // FlagLogsContextDatasourceUi // Allow datasource to provide custom UI for context view FlagLogsContextDatasourceUi = "logsContextDatasourceUi" // FlagLokiQuerySplitting // Split large interval queries into subqueries with smaller time intervals FlagLokiQuerySplitting = "lokiQuerySplitting" // FlagLokiQuerySplittingConfig // Give users the option to configure split durations for Loki queries FlagLokiQuerySplittingConfig = "lokiQuerySplittingConfig" // FlagIndividualCookiePreferences // Support overriding cookie preferences per user FlagIndividualCookiePreferences = "individualCookiePreferences" // FlagPrometheusMetricEncyclopedia // Adds the metrics explorer component to the Prometheus query builder as an option in metric select FlagPrometheusMetricEncyclopedia = "prometheusMetricEncyclopedia" // FlagInfluxdbBackendMigration // Query InfluxDB InfluxQL without the proxy FlagInfluxdbBackendMigration = "influxdbBackendMigration" // FlagInfluxqlStreamingParser // Enable streaming JSON parser for InfluxDB datasource InfluxQL query language FlagInfluxqlStreamingParser = "influxqlStreamingParser" // FlagInfluxdbRunQueriesInParallel // Enables running InfluxDB Influxql queries in parallel FlagInfluxdbRunQueriesInParallel = "influxdbRunQueriesInParallel" // FlagPrometheusDataplane // Changes responses to from Prometheus to be compliant with the dataplane specification. In particular, when this feature toggle is active, the numeric `Field.Name` is set from 'Value' to the value of the `__name__` label. FlagPrometheusDataplane = "prometheusDataplane" // FlagLokiMetricDataplane // Changes metric responses from Loki to be compliant with the dataplane specification. FlagLokiMetricDataplane = "lokiMetricDataplane" // FlagLokiLogsDataplane // Changes logs responses from Loki to be compliant with the dataplane specification. FlagLokiLogsDataplane = "lokiLogsDataplane" // FlagDataplaneFrontendFallback // Support dataplane contract field name change for transformations and field name matchers where the name is different FlagDataplaneFrontendFallback = "dataplaneFrontendFallback" // FlagDisableSSEDataplane // Disables dataplane specific processing in server side expressions. FlagDisableSSEDataplane = "disableSSEDataplane" // FlagAlertStateHistoryLokiSecondary // Enable Grafana to write alert state history to an external Loki instance in addition to Grafana annotations. FlagAlertStateHistoryLokiSecondary = "alertStateHistoryLokiSecondary" // FlagAlertStateHistoryLokiPrimary // Enable a remote Loki instance as the primary source for state history reads. FlagAlertStateHistoryLokiPrimary = "alertStateHistoryLokiPrimary" // FlagAlertStateHistoryLokiOnly // Disable Grafana alerts from emitting annotations when a remote Loki instance is available. FlagAlertStateHistoryLokiOnly = "alertStateHistoryLokiOnly" // FlagUnifiedRequestLog // Writes error logs to the request logger FlagUnifiedRequestLog = "unifiedRequestLog" // FlagRenderAuthJWT // Uses JWT-based auth for rendering instead of relying on remote cache FlagRenderAuthJWT = "renderAuthJWT" // FlagRefactorVariablesTimeRange // Refactor time range variables flow to reduce number of API calls made when query variables are chained FlagRefactorVariablesTimeRange = "refactorVariablesTimeRange" // FlagFaroDatasourceSelector // Enable the data source selector within the Frontend Apps section of the Frontend Observability FlagFaroDatasourceSelector = "faroDatasourceSelector" // FlagEnableDatagridEditing // Enables the edit functionality in the datagrid panel FlagEnableDatagridEditing = "enableDatagridEditing" // FlagExtraThemes // Enables extra themes FlagExtraThemes = "extraThemes" // FlagLokiPredefinedOperations // Adds predefined query operations to Loki query editor FlagLokiPredefinedOperations = "lokiPredefinedOperations" // FlagPluginsFrontendSandbox // Enables the plugins frontend sandbox FlagPluginsFrontendSandbox = "pluginsFrontendSandbox" // FlagFrontendSandboxMonitorOnly // Enables monitor only in the plugin frontend sandbox (if enabled) FlagFrontendSandboxMonitorOnly = "frontendSandboxMonitorOnly" // FlagSqlDatasourceDatabaseSelection // Enables previous SQL data source dataset dropdown behavior FlagSqlDatasourceDatabaseSelection = "sqlDatasourceDatabaseSelection" // FlagRecordedQueriesMulti // Enables writing multiple items from a single query within Recorded Queries FlagRecordedQueriesMulti = "recordedQueriesMulti" // FlagVizAndWidgetSplit // Split panels between visualizations and widgets FlagVizAndWidgetSplit = "vizAndWidgetSplit" // FlagPrometheusIncrementalQueryInstrumentation // Adds RudderStack events to incremental queries FlagPrometheusIncrementalQueryInstrumentation = "prometheusIncrementalQueryInstrumentation" // FlagLogsExploreTableVisualisation // A table visualisation for logs in Explore FlagLogsExploreTableVisualisation = "logsExploreTableVisualisation" // FlagAwsDatasourcesTempCredentials // Support temporary security credentials in AWS plugins for Grafana Cloud customers FlagAwsDatasourcesTempCredentials = "awsDatasourcesTempCredentials" // FlagTransformationsRedesign // Enables the transformations redesign FlagTransformationsRedesign = "transformationsRedesign" // FlagMlExpressions // Enable support for Machine Learning in server-side expressions FlagMlExpressions = "mlExpressions" // FlagTraceQLStreaming // Enables response streaming of TraceQL queries of the Tempo data source FlagTraceQLStreaming = "traceQLStreaming" // FlagMetricsSummary // Enables metrics summary queries in the Tempo data source FlagMetricsSummary = "metricsSummary" // FlagGrafanaAPIServerWithExperimentalAPIs // Register experimental APIs with the k8s API server FlagGrafanaAPIServerWithExperimentalAPIs = "grafanaAPIServerWithExperimentalAPIs" // FlagGrafanaAPIServerEnsureKubectlAccess // Start an additional https handler and write kubectl options FlagGrafanaAPIServerEnsureKubectlAccess = "grafanaAPIServerEnsureKubectlAccess" // FlagFeatureToggleAdminPage // Enable admin page for managing feature toggles from the Grafana front-end. Grafana Cloud only. FlagFeatureToggleAdminPage = "featureToggleAdminPage" // FlagAwsAsyncQueryCaching // Enable caching for async queries for Redshift and Athena. Requires that the datasource has caching and async query support enabled FlagAwsAsyncQueryCaching = "awsAsyncQueryCaching" // FlagPermissionsFilterRemoveSubquery // Alternative permission filter implementation that does not use subqueries for fetching the dashboard folder FlagPermissionsFilterRemoveSubquery = "permissionsFilterRemoveSubquery" // FlagPrometheusConfigOverhaulAuth // Update the Prometheus configuration page with the new auth component FlagPrometheusConfigOverhaulAuth = "prometheusConfigOverhaulAuth" // FlagConfigurableSchedulerTick // Enable changing the scheduler base interval via configuration option unified_alerting.scheduler_tick_interval FlagConfigurableSchedulerTick = "configurableSchedulerTick" // FlagAlertingNoDataErrorExecution // Changes how Alerting state manager handles execution of NoData/Error FlagAlertingNoDataErrorExecution = "alertingNoDataErrorExecution" // FlagAngularDeprecationUI // Display Angular warnings in dashboards and panels FlagAngularDeprecationUI = "angularDeprecationUI" // FlagDashgpt // Enable AI powered features in dashboards FlagDashgpt = "dashgpt" // FlagAiGeneratedDashboardChanges // Enable AI powered features for dashboards to auto-summary changes when saving FlagAiGeneratedDashboardChanges = "aiGeneratedDashboardChanges" // FlagReportingRetries // Enables rendering retries for the reporting feature FlagReportingRetries = "reportingRetries" // FlagSseGroupByDatasource // 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" // FlagLibraryPanelRBAC // Enables RBAC support for library panels FlagLibraryPanelRBAC = "libraryPanelRBAC" // FlagLokiRunQueriesInParallel // Enables running Loki queries in parallel FlagLokiRunQueriesInParallel = "lokiRunQueriesInParallel" // FlagWargamesTesting // Placeholder feature flag for internal testing FlagWargamesTesting = "wargamesTesting" // FlagAlertingInsights // Show the new alerting insights landing page FlagAlertingInsights = "alertingInsights" // FlagExternalCorePlugins // Allow core plugins to be loaded as external FlagExternalCorePlugins = "externalCorePlugins" // FlagPluginsAPIMetrics // Sends metrics of public grafana packages usage by plugins FlagPluginsAPIMetrics = "pluginsAPIMetrics" // FlagIdForwarding // Generate signed id token for identity that can be forwarded to plugins and external services FlagIdForwarding = "idForwarding" // FlagExternalServiceAccounts // Automatic service account and token setup for plugins FlagExternalServiceAccounts = "externalServiceAccounts" // FlagPanelMonitoring // Enables panel monitoring through logs and measurements FlagPanelMonitoring = "panelMonitoring" // FlagEnableNativeHTTPHistogram // Enables native HTTP Histograms FlagEnableNativeHTTPHistogram = "enableNativeHTTPHistogram" // FlagFormatString // Enable format string transformer FlagFormatString = "formatString" // FlagTransformationsVariableSupport // Allows using variables in transformations FlagTransformationsVariableSupport = "transformationsVariableSupport" // FlagKubernetesPlaylists // Use the kubernetes API in the frontend for playlists, and route /api/playlist requests to k8s FlagKubernetesPlaylists = "kubernetesPlaylists" // FlagKubernetesSnapshots // Routes snapshot requests from /api to the /apis endpoint FlagKubernetesSnapshots = "kubernetesSnapshots" // FlagKubernetesDashboards // Use the kubernetes API in the frontend for dashboards FlagKubernetesDashboards = "kubernetesDashboards" // FlagDatasourceQueryTypes // Show query type endpoints in datasource API servers (currently hardcoded for testdata, expressions, and prometheus) FlagDatasourceQueryTypes = "datasourceQueryTypes" // FlagQueryService // Register /apis/query.grafana.app/ -- will eventually replace /api/ds/query FlagQueryService = "queryService" // FlagQueryServiceRewrite // Rewrite requests targeting /ds/query to the query service FlagQueryServiceRewrite = "queryServiceRewrite" // FlagQueryServiceFromUI // Routes requests to the new query service FlagQueryServiceFromUI = "queryServiceFromUI" // FlagCloudWatchBatchQueries // Runs CloudWatch metrics queries as separate batches FlagCloudWatchBatchQueries = "cloudWatchBatchQueries" // FlagRecoveryThreshold // Enables feature recovery threshold (aka hysteresis) for threshold server-side expression FlagRecoveryThreshold = "recoveryThreshold" // FlagLokiStructuredMetadata // Enables the loki data source to request structured metadata from the Loki server FlagLokiStructuredMetadata = "lokiStructuredMetadata" // FlagTeamHttpHeaders // Enables Team LBAC for datasources to apply team headers to the client requests FlagTeamHttpHeaders = "teamHttpHeaders" // FlagAwsDatasourcesNewFormStyling // Applies new form styling for configuration and query editors in AWS plugins FlagAwsDatasourcesNewFormStyling = "awsDatasourcesNewFormStyling" // FlagCachingOptimizeSerializationMemoryUsage // If enabled, the caching backend gradually serializes query responses for the cache, comparing against the configured `[caching]max_value_mb` value as it goes. This can can help prevent Grafana from running out of memory while attempting to cache very large query responses. FlagCachingOptimizeSerializationMemoryUsage = "cachingOptimizeSerializationMemoryUsage" // FlagPanelTitleSearchInV1 // Enable searching for dashboards using panel title in search v1 FlagPanelTitleSearchInV1 = "panelTitleSearchInV1" // FlagManagedPluginsInstall // Install managed plugins directly from plugins catalog FlagManagedPluginsInstall = "managedPluginsInstall" // FlagPrometheusPromQAIL // Prometheus and AI/ML to assist users in creating a query FlagPrometheusPromQAIL = "prometheusPromQAIL" // FlagPrometheusCodeModeMetricNamesSearch // Enables search for metric names in Code Mode, to improve performance when working with an enormous number of metric names FlagPrometheusCodeModeMetricNamesSearch = "prometheusCodeModeMetricNamesSearch" // FlagAddFieldFromCalculationStatFunctions // Add cumulative and window functions to the add field from calculation transformation FlagAddFieldFromCalculationStatFunctions = "addFieldFromCalculationStatFunctions" // FlagAlertmanagerRemoteSecondary // Enable Grafana to sync configuration and state with a remote Alertmanager. FlagAlertmanagerRemoteSecondary = "alertmanagerRemoteSecondary" // FlagAlertmanagerRemotePrimary // Enable Grafana to have a remote Alertmanager instance as the primary Alertmanager. FlagAlertmanagerRemotePrimary = "alertmanagerRemotePrimary" // FlagAlertmanagerRemoteOnly // Disable the internal Alertmanager and only use the external one defined. FlagAlertmanagerRemoteOnly = "alertmanagerRemoteOnly" // FlagAnnotationPermissionUpdate // Change the way annotation permissions work by scoping them to folders and dashboards. FlagAnnotationPermissionUpdate = "annotationPermissionUpdate" // FlagExtractFieldsNameDeduplication // Make sure extracted field names are unique in the dataframe FlagExtractFieldsNameDeduplication = "extractFieldsNameDeduplication" // FlagDashboardSceneForViewers // Enables dashboard rendering using Scenes for viewer roles FlagDashboardSceneForViewers = "dashboardSceneForViewers" // FlagDashboardSceneSolo // Enables rendering dashboards using scenes for solo panels FlagDashboardSceneSolo = "dashboardSceneSolo" // FlagDashboardScene // Enables dashboard rendering using scenes for all roles FlagDashboardScene = "dashboardScene" // FlagPanelFilterVariable // Enables use of the `systemPanelFilterVar` variable to filter panels in a dashboard FlagPanelFilterVariable = "panelFilterVariable" // FlagPdfTables // Enables generating table data as PDF in reporting FlagPdfTables = "pdfTables" // FlagSsoSettingsApi // Enables the SSO settings API and the OAuth configuration UIs in Grafana FlagSsoSettingsApi = "ssoSettingsApi" // FlagCanvasPanelPanZoom // Allow pan and zoom in canvas panel FlagCanvasPanelPanZoom = "canvasPanelPanZoom" // FlagLogsInfiniteScrolling // Enables infinite scrolling for the Logs panel in Explore and Dashboards FlagLogsInfiniteScrolling = "logsInfiniteScrolling" // FlagFlameGraphItemCollapsing // Allow collapsing of flame graph items FlagFlameGraphItemCollapsing = "flameGraphItemCollapsing" // FlagExploreMetrics // Enables the new Explore Metrics core app FlagExploreMetrics = "exploreMetrics" // FlagAlertingSimplifiedRouting // Enables users to easily configure alert notifications by specifying a contact point directly when editing or creating an alert rule FlagAlertingSimplifiedRouting = "alertingSimplifiedRouting" // FlagLogRowsPopoverMenu // Enable filtering menu displayed when text of a log line is selected FlagLogRowsPopoverMenu = "logRowsPopoverMenu" // FlagPluginsSkipHostEnvVars // Disables passing host environment variable to plugin processes FlagPluginsSkipHostEnvVars = "pluginsSkipHostEnvVars" // Enables shared crosshair in table panel FlagTableSharedCrosshair = "tableSharedCrosshair" // FlagRegressionTransformation // Enables regression analysis transformation FlagRegressionTransformation = "regressionTransformation" // FlagLokiQueryHints // Enables query hints for Loki FlagLokiQueryHints = "lokiQueryHints" // FlagKubernetesFeatureToggles // Use the kubernetes API for feature toggle management in the frontend FlagKubernetesFeatureToggles = "kubernetesFeatureToggles" // FlagCloudRBACRoles // Enabled grafana cloud specific RBAC roles FlagCloudRBACRoles = "cloudRBACRoles" // FlagAlertingQueryOptimization // Optimizes eligible queries in order to reduce load on datasources FlagAlertingQueryOptimization = "alertingQueryOptimization" // FlagNewFolderPicker // Enables the nested folder picker without having nested folders enabled FlagNewFolderPicker = "newFolderPicker" // FlagJitterAlertRulesWithinGroups // Distributes alert rule evaluations more evenly over time, including spreading out rules within the same group FlagJitterAlertRulesWithinGroups = "jitterAlertRulesWithinGroups" // FlagOnPremToCloudMigrations // In-development feature that will allow users to easily migrate their on-prem Grafana instances to Grafana Cloud. FlagOnPremToCloudMigrations = "onPremToCloudMigrations" // FlagAlertingSaveStatePeriodic // Writes the state periodically to the database, asynchronous to rule evaluation FlagAlertingSaveStatePeriodic = "alertingSaveStatePeriodic" // FlagPromQLScope // In-development feature that will allow injection of labels into prometheus queries. FlagPromQLScope = "promQLScope" // FlagSqlExpressions // Enables using SQL and DuckDB functions as Expressions. FlagSqlExpressions = "sqlExpressions" // FlagNodeGraphDotLayout // Changed the layout algorithm for the node graph FlagNodeGraphDotLayout = "nodeGraphDotLayout" // FlagGroupToNestedTableTransformation // Enables the group to nested table transformation FlagGroupToNestedTableTransformation = "groupToNestedTableTransformation" // FlagNewPDFRendering // New implementation for the dashboard-to-PDF rendering FlagNewPDFRendering = "newPDFRendering" // FlagTlsMemcached // Use TLS-enabled memcached in the enterprise caching feature FlagTlsMemcached = "tlsMemcached" // FlagKubernetesAggregator // Enable grafana aggregator FlagKubernetesAggregator = "kubernetesAggregator" // FlagExpressionParser // Enable new expression parser FlagExpressionParser = "expressionParser" // FlagGroupByVariable // Enable groupBy variable support in scenes dashboards FlagGroupByVariable = "groupByVariable" // FlagBetterPageScrolling // Removes CustomScrollbar from the UI, relying on native browser scrollbars FlagBetterPageScrolling = "betterPageScrolling" // FlagAuthAPIAccessTokenAuth // Enables the use of Auth API access tokens for authentication FlagAuthAPIAccessTokenAuth = "authAPIAccessTokenAuth" // FlagScopeFilters // Enables the use of scope filters in Grafana FlagScopeFilters = "scopeFilters" // FlagSsoSettingsSAML // Use the new SSO Settings API to configure the SAML connector FlagSsoSettingsSAML = "ssoSettingsSAML" // FlagOauthRequireSubClaim // Require that sub claims is present in oauth tokens. FlagOauthRequireSubClaim = "oauthRequireSubClaim" // FlagNewDashboardWithFiltersAndGroupBy // Enables filters and group by variables on all new dashboards. Variables are added only if default data source supports filtering. FlagNewDashboardWithFiltersAndGroupBy = "newDashboardWithFiltersAndGroupBy" // FlagCloudWatchNewLabelParsing // Updates CloudWatch label parsing to be more accurate FlagCloudWatchNewLabelParsing = "cloudWatchNewLabelParsing" // FlagAccessActionSets // Introduces action sets for resource permissions FlagAccessActionSets = "accessActionSets" // FlagDisableNumericMetricsSortingInExpressions // In server-side expressions, disable the sorting of numeric-kind metrics by their metric name or labels. FlagDisableNumericMetricsSortingInExpressions = "disableNumericMetricsSortingInExpressions" // FlagGrafanaManagedRecordingRules // Enables Grafana-managed recording rules. FlagGrafanaManagedRecordingRules = "grafanaManagedRecordingRules" // FlagQueryLibrary // Enables Query Library feature in Explore FlagQueryLibrary = "queryLibrary" // FlagAutofixDSUID // Automatically migrates invalid datasource UIDs FlagAutofixDSUID = "autofixDSUID" // FlagLogsExploreTableDefaultVisualization // Sets the logs table as default visualisation in logs explore FlagLogsExploreTableDefaultVisualization = "logsExploreTableDefaultVisualization" // FlagNewDashboardSharingComponent // Enables the new sharing drawer design FlagNewDashboardSharingComponent = "newDashboardSharingComponent" // FlagAlertingListViewV2 // Enables the new alert list view design FlagAlertingListViewV2 = "alertingListViewV2" // FlagNotificationBanner // Enables the notification banner UI and API FlagNotificationBanner = "notificationBanner" // FlagDashboardRestore // Enables deleted dashboard restore feature FlagDashboardRestore = "dashboardRestore" // FlagDatasourceProxyDisableRBAC // Disables applying a plugin route's ReqAction field to authorization FlagDatasourceProxyDisableRBAC = "datasourceProxyDisableRBAC" // FlagAlertingDisableSendAlertsExternal // Disables the ability to send alerts to an external Alertmanager datasource. FlagAlertingDisableSendAlertsExternal = "alertingDisableSendAlertsExternal" // Enables possibility to preserve dashboard variables and time range when navigating between dashboards FlagPreserveDashboardStateWhenNavigating = "preserveDashboardStateWhenNavigating" // FlagAlertingCentralAlertHistory // Enables the new central alert history. FlagAlertingCentralAlertHistory = "alertingCentralAlertHistory" // FlagPluginProxyPreserveTrailingSlash // Preserve plugin proxy trailing slash. FlagPluginProxyPreserveTrailingSlash = "pluginProxyPreserveTrailingSlash" // FlagAzureMonitorPrometheusExemplars // Allows configuration of Azure Monitor as a data source that can provide Prometheus exemplars FlagAzureMonitorPrometheusExemplars = "azureMonitorPrometheusExemplars" // FlagPrometheusAzureOverrideAudience // Deprecated. Allow override default AAD audience for Azure Prometheus endpoint. Enabled by default. This feature should no longer be used and will be removed in the future. FlagPrometheusAzureOverrideAudience = "prometheusAzureOverrideAudience" )
Variables ¶
This section is empty.
Functions ¶
func GetEmbeddedFeatureList ¶
func GetEmbeddedFeatureList() (featuretoggle.FeatureList, error)
Get the cached feature list (exposed as a k8s resource)
Types ¶
type FeatureFlag ¶
type FeatureFlag struct { Name string `json:"name" yaml:"name"` // Unique name Description string `json:"description"` Stage FeatureFlagStage `json:"stage,omitempty"` Owner codeowner `json:"-"` // Owner person or team that owns this feature flag // Recommended properties - control behavior of the feature toggle management page in the UI AllowSelfServe bool `json:"allowSelfServe,omitempty"` // allow users with the right privileges to toggle this from the UI (GeneralAvailability, PublicPreview, and Deprecated toggles only) HideFromAdminPage bool `json:"hideFromAdminPage,omitempty"` // GA, Deprecated, and PublicPreview toggles only: don't display this feature in the UI; if this is a GA toggle, add a comment with the reasoning // CEL-GO expression. Using the value "true" will mean this is on by default Expression string `json:"expression,omitempty"` // Special behavior properties RequiresDevMode bool `json:"requiresDevMode,omitempty"` // can not be enabled in production FrontendOnly bool `json:"frontend,omitempty"` // change is only seen in the frontend HideFromDocs bool `json:"hideFromDocs,omitempty"` // don't add the values to docs // The server must be initialized with the value RequiresRestart bool `json:"requiresRestart,omitempty"` }
These are properties about the feature, but not the current state or value for it
type FeatureFlagStage ¶
type FeatureFlagStage int
FeatureFlagStage indicates the quality level
const ( // FeatureStageUnknown indicates that no state is specified FeatureStageUnknown FeatureFlagStage = iota // FeatureStageExperimental -- Does this work for Grafana Labs? FeatureStageExperimental // FeatureStagePrivatePreview -- Does this work for a limited number of customers? FeatureStagePrivatePreview // FeatureStagePublicPreview -- Does this work for most customers? FeatureStagePublicPreview // FeatureStageGeneralAvailability -- Feature is available to all applicable customers FeatureStageGeneralAvailability // FeatureStageDeprecated the feature will be removed in the future FeatureStageDeprecated )
func (FeatureFlagStage) MarshalJSON ¶
func (s FeatureFlagStage) MarshalJSON() ([]byte, error)
MarshalJSON marshals the enum as a quoted json string
func (FeatureFlagStage) String ¶
func (s FeatureFlagStage) String() string
func (*FeatureFlagStage) UnmarshalJSON ¶
func (s *FeatureFlagStage) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals a quoted json string to the enum value
type FeatureManager ¶
type FeatureManager struct { Settings setting.FeatureMgmtSettings // contains filtered or unexported fields }
func ProvideManagerService ¶
func ProvideManagerService(cfg *setting.Cfg) (*FeatureManager, error)
func WithFeatureManager ¶
func WithFeatureManager(cfg setting.FeatureMgmtSettings, flags []*FeatureFlag, disabled ...string) *FeatureManager
WithFeatureManager is used to define feature toggle manager for testing. It should be used when your test feature toggles require metadata beyond `Name` and `Enabled`. You should provide a feature toggle Name at a minimum.
func WithManager ¶
func WithManager(spec ...any) *FeatureManager
WithFeatures is used to define feature toggles for testing. The arguments are a list of strings that are optionally followed by a boolean value for example: WithFeatures([]any{"my_feature", "other_feature"}) or WithFeatures([]any{"my_feature", true})
func (*FeatureManager) GetEnabled ¶
func (fm *FeatureManager) GetEnabled(ctx context.Context) map[string]bool
GetEnabled returns a map containing only the features that are enabled
func (*FeatureManager) GetFlags ¶
func (fm *FeatureManager) GetFlags() []FeatureFlag
GetFlags returns all flag definitions
func (*FeatureManager) GetStartupFlags ¶
func (fm *FeatureManager) GetStartupFlags() map[string]bool
Get the flags that were explicitly set on startup
func (*FeatureManager) GetUsageStats ¶
func (fm *FeatureManager) GetUsageStats(ctx context.Context) map[string]any
func (*FeatureManager) GetWarning ¶
func (fm *FeatureManager) GetWarning() map[string]string
Perhaps expose the flag warnings
func (*FeatureManager) IsEditableFromAdminPage ¶
func (fm *FeatureManager) IsEditableFromAdminPage(key string) bool
Flags that can be edited
func (*FeatureManager) IsEnabled ¶
func (fm *FeatureManager) IsEnabled(ctx context.Context, flag string) bool
IsEnabled checks if a feature is enabled
func (*FeatureManager) IsEnabledGlobally ¶
func (fm *FeatureManager) IsEnabledGlobally(flag string) bool
IsEnabledGlobally checks if a feature is for all tenants
func (*FeatureManager) IsFeatureEditingAllowed ¶
func (fm *FeatureManager) IsFeatureEditingAllowed() bool
isFeatureEditingAllowed checks if the backend is properly configured to allow feature toggle changes from the UI
func (*FeatureManager) IsHiddenFromAdminPage ¶
func (fm *FeatureManager) IsHiddenFromAdminPage(key string, lenient bool) bool
Flags that should not be shown in the UI (regardless of their state)
func (*FeatureManager) IsRestartRequired ¶
func (fm *FeatureManager) IsRestartRequired() bool
indicate if a change has been made (not that accurate, but better than nothing)
func (*FeatureManager) SetRestartRequired ¶
func (fm *FeatureManager) SetRestartRequired()
type FeatureToggles ¶
type FeatureToggles interface { // IsEnabled checks if a feature is enabled for a given context. // The settings may be per user, tenant, or globally set in the cloud IsEnabled(ctx context.Context, flag string) bool // IsEnabledGlobally checks if a flag is configured globally. For now, this is the same // as the function above, however it will move to only checking flags that // are configured by the operator and shared across all tenants. // Use of global feature flags should be limited and careful as they require // a full server restart for a change to take place. IsEnabledGlobally(flag string) bool // Get the enabled flags -- this *may* also include disabled flags (with value false) // but it is guaranteed to have the enabled ones listed GetEnabled(ctx context.Context) map[string]bool }
func ProvideToggles ¶
func ProvideToggles(mgmt *FeatureManager) FeatureToggles
ProvideToggles allows read-only access to the feature state
func WithFeatures ¶
func WithFeatures(spec ...any) FeatureToggles