Documentation ¶
Index ¶
Constants ¶
View Source
const ( // FlagAlertingBigTransactions // Use big transactions for alerting database writes FlagAlertingBigTransactions = "alertingBigTransactions" // FlagTrimDefaults // Use cue schema to remove values that will be applied automatically FlagTrimDefaults = "trimDefaults" // FlagDisableEnvelopeEncryption // Disable envelope encryption (emergency only) FlagDisableEnvelopeEncryption = "disableEnvelopeEncryption" // FlagDatabaseMetrics // Add Prometheus metrics for database tables FlagDatabaseMetrics = "database_metrics" // FlagDashboardPreviews // Create and show thumbnails for dashboard search results FlagDashboardPreviews = "dashboardPreviews" // 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" // FlagPrometheusAzureOverrideAudience // Experimental. Allow override default AAD audience for Azure Prometheus endpoint FlagPrometheusAzureOverrideAudience = "prometheusAzureOverrideAudience" // FlagPublicDashboards // Enables public access to dashboards FlagPublicDashboards = "publicDashboards" // FlagPublicDashboardsEmailSharing // Enables public dashboard sharing to be restricted to only allowed emails FlagPublicDashboardsEmailSharing = "publicDashboardsEmailSharing" // FlagLokiLive // Support WebSocket streaming for loki (early prototype) FlagLokiLive = "lokiLive" // FlagLokiDataframeApi // Use experimental loki api for WebSocket streaming (early prototype) FlagLokiDataframeApi = "lokiDataframeApi" // FlagFeatureHighlights // Highlight Grafana Enterprise features FlagFeatureHighlights = "featureHighlights" // FlagMigrationLocking // Lock database during migrations FlagMigrationLocking = "migrationLocking" // FlagStorage // Configurable storage for dashboards, datasources, and resources FlagStorage = "storage" // FlagK8S // Explore native k8s integrations FlagK8S = "k8s" // FlagExploreMixedDatasource // Enable mixed datasource in Explore FlagExploreMixedDatasource = "exploreMixedDatasource" // FlagNewTraceView // Shows the new trace view design FlagNewTraceView = "newTraceView" // FlagCorrelations // Correlations page FlagCorrelations = "correlations" // FlagCloudWatchDynamicLabels // Use dynamic labels instead of alias patterns in CloudWatch datasource FlagCloudWatchDynamicLabels = "cloudWatchDynamicLabels" // FlagDatasourceQueryMultiStatus // Introduce HTTP 207 Multi Status for api/ds/query FlagDatasourceQueryMultiStatus = "datasourceQueryMultiStatus" // FlagTraceToMetrics // Enable trace to metrics links FlagTraceToMetrics = "traceToMetrics" // FlagNewDBLibrary // Use jmoiron/sqlx rather than xorm for a few backend services FlagNewDBLibrary = "newDBLibrary" // FlagValidateDashboardsOnSave // Validate dashboard JSON POSTed to api/dashboards/db FlagValidateDashboardsOnSave = "validateDashboardsOnSave" // FlagAutoMigrateOldPanels // Migrate old angular panels to supported versions (graph, table-old, worldmap, etc) FlagAutoMigrateOldPanels = "autoMigrateOldPanels" // 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" // FlagPrometheusWideSeries // Enable wide series responses in the Prometheus datasource FlagPrometheusWideSeries = "prometheusWideSeries" // 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" // FlagDataConnectionsConsole // Enables a new top-level page called Connections. This page is an experiment that provides a better experience when you install and configure data sources and other plugins. FlagDataConnectionsConsole = "dataConnectionsConsole" // FlagInternationalization // Enables internationalization FlagInternationalization = "internationalization" // Enables new top navigation and page layouts FlagTopnav = "topnav" // FlagGrpcServer // Run GRPC server FlagGrpcServer = "grpcServer" // FlagEntityStore // SQL-based entity store (requires storage flag also) FlagEntityStore = "entityStore" // FlagCloudWatchCrossAccountQuerying // Enables cross-account querying in CloudWatch datasources FlagCloudWatchCrossAccountQuerying = "cloudWatchCrossAccountQuerying" // FlagRedshiftAsyncQueryDataSupport // Enable async query data support for Redshift FlagRedshiftAsyncQueryDataSupport = "redshiftAsyncQueryDataSupport" // FlagAthenaAsyncQueryDataSupport // Enable async query data support for Athena FlagAthenaAsyncQueryDataSupport = "athenaAsyncQueryDataSupport" // FlagNewPanelChromeUI // Show updated look and feel of grafana-ui PanelChrome: panel header, icons, and menu FlagNewPanelChromeUI = "newPanelChromeUI" // 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" // FlagAccessTokenExpirationCheck // Enable OAuth access_token expiration check and token refresh using the refresh_token FlagAccessTokenExpirationCheck = "accessTokenExpirationCheck" // FlagElasticsearchBackendMigration // Use Elasticsearch as backend data source FlagElasticsearchBackendMigration = "elasticsearchBackendMigration" // FlagDatasourceOnboarding // Enable data source onboarding page FlagDatasourceOnboarding = "datasourceOnboarding" // FlagEmptyDashboardPage // Enable the redesigned user interface of a dashboard page that includes no panels FlagEmptyDashboardPage = "emptyDashboardPage" // FlagSecureSocksDatasourceProxy // Enable secure socks tunneling for supported core datasources FlagSecureSocksDatasourceProxy = "secureSocksDatasourceProxy" // FlagAuthnService // Use new auth service to perform authentication FlagAuthnService = "authnService" // FlagDisablePrometheusExemplarSampling // Disable Prometheus exemplar sampling FlagDisablePrometheusExemplarSampling = "disablePrometheusExemplarSampling" // 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" // FlagLogsSampleInExplore // Enables access to the logs sample feature in Explore FlagLogsSampleInExplore = "logsSampleInExplore" // 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" // FlagOnlyExternalOrgRoleSync // Prohibits a user from changing organization roles synced with external auth providers FlagOnlyExternalOrgRoleSync = "onlyExternalOrgRoleSync" // FlagDrawerDataSourcePicker // Changes the user experience for data source selection to a drawer. FlagDrawerDataSourcePicker = "drawerDataSourcePicker" // FlagTraceqlSearch // Enables the 'TraceQL Search' tab for the Tempo datasource which provides a UI to generate TraceQL queries FlagTraceqlSearch = "traceqlSearch" // FlagPrometheusMetricEncyclopedia // Replaces the Prometheus query builder metric select option with a paginated and filterable component FlagPrometheusMetricEncyclopedia = "prometheusMetricEncyclopedia" // FlagTimeSeriesTable // Enable time series table transformer & sparkline cell type FlagTimeSeriesTable = "timeSeriesTable" // FlagInfluxdbBackendMigration // Query InfluxDB InfluxQL without the proxy FlagInfluxdbBackendMigration = "influxdbBackendMigration" // FlagClientTokenRotation // Replaces the current in-request token rotation so that the client initiates the rotation FlagClientTokenRotation = "clientTokenRotation" // FlagDisableElasticsearchBackendExploreQuery // Disable executing of Elasticsearch Explore queries trough backend FlagDisableElasticsearchBackendExploreQuery = "disableElasticsearchBackendExploreQuery" // FlagPrometheusDataplane // Changes responses to from Prometheus to be compliant with the dataplane specification. In particular it sets the numeric Field.Name from 'Value' to the value of the `__name__` label when present. FlagPrometheusDataplane = "prometheusDataplane" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FeatureFlag ¶
type FeatureFlag struct { Name string `json:"name" yaml:"name"` // Unique name Description string `json:"description"` State FeatureFlagState `json:"state,omitempty"` DocsURL string `json:"docsURL,omitempty"` // Owner person or team that owns this feature flag Owner codeowner `json:"-"` // CEL-GO expression. Using the value "true" will mean this is on by default Expression string `json:"expression,omitempty"` // Special behavior flags RequiresDevMode bool `json:"requiresDevMode,omitempty"` // can not be enabled in production RequiresRestart bool `json:"requiresRestart,omitempty"` // The server must be initialized with the value RequiresLicense bool `json:"requiresLicense,omitempty"` // Must be enabled in the license FrontendOnly bool `json:"frontend,omitempty"` // change is only seen in the frontend }
type FeatureFlagState ¶
type FeatureFlagState int
FeatureFlagState indicates the quality level
const ( // FeatureStateUnknown indicates that no state is specified FeatureStateUnknown FeatureFlagState = iota // FeatureStateAlpha the feature is in active development and may change at any time FeatureStateAlpha // FeatureStateBeta the feature is still in development, but settings will have migrations FeatureStateBeta // FeatureStateStable this is a stable feature FeatureStateStable // FeatureStateDeprecated the feature will be removed in the future FeatureStateDeprecated )
func (FeatureFlagState) MarshalJSON ¶
func (s FeatureFlagState) MarshalJSON() ([]byte, error)
MarshalJSON marshals the enum as a quoted json string
func (FeatureFlagState) String ¶
func (s FeatureFlagState) String() string
func (*FeatureFlagState) UnmarshalJSON ¶
func (s *FeatureFlagState) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals a quoted json string to the enum value
type FeatureManager ¶
type FeatureManager struct {
// contains filtered or unexported fields
}
func ProvideManagerService ¶
func WithFeatures ¶
func WithFeatures(spec ...interface{}) *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([]interface{}{"my_feature", "other_feature"}) or WithFeatures([]interface{}{"my_feature", true})
func (*FeatureManager) GetEnabled ¶
func (fm *FeatureManager) GetEnabled(ctx context.Context) map[string]bool
GetEnabled returns a map contaning only the features that are enabled
func (*FeatureManager) GetFlags ¶
func (fm *FeatureManager) GetFlags() []FeatureFlag
GetFlags returns all flag definitions
func (*FeatureManager) GetUsageStats ¶
func (fm *FeatureManager) GetUsageStats(ctx context.Context) map[string]interface{}
func (*FeatureManager) IsEnabled ¶
func (fm *FeatureManager) IsEnabled(flag string) bool
IsEnabled checks if a feature is enabled
type FeatureToggles ¶
func ProvideToggles ¶
func ProvideToggles(mgmt *FeatureManager) FeatureToggles
ProvideToggles allows read-only access to the feature state
Source Files ¶
Click to show internal directories.
Click to hide internal directories.