Documentation ¶
Index ¶
- Constants
- type FeatureFlag
- type FeatureFlagState
- type FeatureManager
- func (fm *FeatureManager) GetEnabled(ctx context.Context) map[string]bool
- func (fm *FeatureManager) GetFlags() []FeatureFlag
- func (fm *FeatureManager) GetUsageStats(ctx context.Context) map[string]interface{}
- func (fm *FeatureManager) HandleGetSettings(c *models.ReqContext)
- func (fm *FeatureManager) IsEnabled(flag string) bool
- type FeatureToggles
Constants ¶
View Source
const ( // FlagTrimDefaults // Use cue schema to remove values that will be applied automatically FlagTrimDefaults = "trimDefaults" // FlagEnvelopeEncryption // encrypt secrets FlagEnvelopeEncryption = "envelopeEncryption" // FlagHttpclientproviderAzureAuth // Experimental. Allow datasources to configure Azure authentication directly via JsonData FlagHttpclientproviderAzureAuth = "httpclientprovider_azure_auth" // FlagServiceAccounts // support service accounts FlagServiceAccounts = "serviceAccounts" // FlagDatabaseMetrics // Add prometheus metrics for database tables FlagDatabaseMetrics = "database_metrics" // FlagDashboardPreviews // Create and show thumbnails for dashboard search results FlagDashboardPreviews = "dashboardPreviews" // FlagDashboardPreviewsScheduler // Schedule automatic updates to dashboard previews FlagDashboardPreviewsScheduler = "dashboardPreviewsScheduler" // FlagDashboardPreviewsAdmin // Manage the dashboard previews crawler process from the UI FlagDashboardPreviewsAdmin = "dashboardPreviewsAdmin" // FlagLiveConfig // Save grafana live configuration in SQL tables FlagLiveConfig = "live-config" // FlagLivePipeline // enable a generic live processing pipeline FlagLivePipeline = "live-pipeline" // 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" // FlagTempoSearch // Enable searching in tempo datasources FlagTempoSearch = "tempoSearch" // FlagTempoBackendSearch // Use backend for tempo search FlagTempoBackendSearch = "tempoBackendSearch" // FlagTempoServiceGraph // show service FlagTempoServiceGraph = "tempoServiceGraph" // FlagLokiBackendMode // Loki datasource works as backend datasource FlagLokiBackendMode = "lokiBackendMode" // FlagAccesscontrol // Support robust access control FlagAccesscontrol = "accesscontrol" // FlagAccesscontrolBuiltins // Simplify access control builtin roles FlagAccesscontrolBuiltins = "accesscontrol-builtins" // FlagPrometheusAzureAuth // Experimental. Azure authentication for Prometheus datasource FlagPrometheusAzureAuth = "prometheus_azure_auth" // FlagInfluxdbBackendMigration // Query InfluxDB InfluxQL without the proxy FlagInfluxdbBackendMigration = "influxdbBackendMigration" // Try the next gen navigation model FlagNewNavigation = "newNavigation" // FlagShowFeatureFlagsInUI // Show feature flags in the settings UI FlagShowFeatureFlagsInUI = "showFeatureFlagsInUI" // FlagDisableHttpRequestHistogram // Do not create histograms for http requests FlagDisableHttpRequestHistogram = "disable_http_request_histogram" // FlagValidatedQueries // only execute the query saved in a panel FlagValidatedQueries = "validatedQueries" // FlagLokiLive // support websocket streaming for loki (early prototype) FlagLokiLive = "lokiLive" // FlagSwaggerUi // Serves swagger UI FlagSwaggerUi = "swaggerUi" // FlagFeatureHighlights // Highlight Enterprise features FlagFeatureHighlights = "featureHighlights" // FlagDashboardComments // Enable dashboard-wide comments FlagDashboardComments = "dashboardComments" // FlagAnnotationComments // Enable annotation comments FlagAnnotationComments = "annotationComments" // FlagMigrationLocking // Lock database during migrations FlagMigrationLocking = "migrationLocking" // FlagSaveDashboardDrawer // Use a drawer to show save dashboard dialog FlagSaveDashboardDrawer = "saveDashboardDrawer" // FlagStorage // Configurable storage for dashboards, datasources, and resources FlagStorage = "storage" // FlagAlertProvisioning // Provisioning-friendly routes for alerting FlagAlertProvisioning = "alertProvisioning" // FlagStorageLocalUpload // allow uploads to local storage FlagStorageLocalUpload = "storageLocalUpload" // FlagAzureMonitorResourcePickerForMetrics // New UI for Azure Monitor Metrics Query FlagAzureMonitorResourcePickerForMetrics = "azureMonitorResourcePickerForMetrics" // FlagExplore2Dashboard // Experimental Explore to Dashboard workflow FlagExplore2Dashboard = "explore2Dashboard" // FlagTracing // Adds trace ID to error notifications FlagTracing = "tracing" // FlagPersistNotifications // PoC Notifications page FlagPersistNotifications = "persistNotifications" // FlagDatasourceQueryMultiStatus // Introduce HTTP 207 Multi Status for api/ds/query FlagDatasourceQueryMultiStatus = "datasourceQueryMultiStatus" )
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"` // 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
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) HandleGetSettings ¶
func (fm *FeatureManager) HandleGetSettings(c *models.ReqContext)
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.