featuremgmt

package
v0.0.1-test Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2022 License: AGPL-3.0 Imports: 16 Imported by: 0

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"

	// 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"

	// FlagTempoApmTable
	// Show APM table
	FlagTempoApmTable = "tempoApmTable"

	// FlagPrometheusAzureOverrideAudience
	// Experimental. Allow override default AAD audience for Azure Prometheus endpoint
	FlagPrometheusAzureOverrideAudience = "prometheusAzureOverrideAudience"

	// FlagInfluxdbBackendMigration
	// Query InfluxDB InfluxQL without the proxy
	FlagInfluxdbBackendMigration = "influxdbBackendMigration"

	// FlagShowFeatureFlagsInUI
	// Show feature flags in the settings UI
	FlagShowFeatureFlagsInUI = "showFeatureFlagsInUI"

	// FlagPublicDashboards
	// enables public access to dashboards
	FlagPublicDashboards = "publicDashboards"

	// FlagLokiLive
	// support websocket streaming for loki (early prototype)
	FlagLokiLive = "lokiLive"

	// FlagLokiDataframeApi
	// use experimental loki api for websocket streaming (early prototype)
	FlagLokiDataframeApi = "lokiDataframeApi"

	// 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"

	// FlagStorage
	// Configurable storage for dashboards, datasources, and resources
	FlagStorage = "storage"

	// FlagDashboardsFromStorage
	// Load dashboards from the generic storage interface
	FlagDashboardsFromStorage = "dashboardsFromStorage"

	// FlagExport
	// Export grafana instance (to git, etc)
	FlagExport = "export"

	// FlagAzureMonitorResourcePickerForMetrics
	// New UI for Azure Monitor Metrics Query
	FlagAzureMonitorResourcePickerForMetrics = "azureMonitorResourcePickerForMetrics"

	// FlagExplore2Dashboard
	// Experimental Explore to Dashboard workflow
	FlagExplore2Dashboard = "explore2Dashboard"

	// FlagExploreMixedDatasource
	// Enable mixed datasource in Explore
	FlagExploreMixedDatasource = "exploreMixedDatasource"

	// FlagTracing
	// Adds trace ID to error notifications
	FlagTracing = "tracing"

	// FlagCommandPalette
	// Enable command palette
	FlagCommandPalette = "commandPalette"

	// 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"

	// FlagPrometheusStreamingJSONParser
	// Enable streaming JSON parser for Prometheus datasource
	FlagPrometheusStreamingJSONParser = "prometheusStreamingJSONParser"

	// FlagPrometheusStreamingJSONParserTest
	// Run both old and streaming requests and log differences
	FlagPrometheusStreamingJSONParserTest = "prometheusStreamingJSONParserTest"

	// FlagValidateDashboardsOnSave
	// Validate dashboard JSON POSTed to api/dashboards/db
	FlagValidateDashboardsOnSave = "validateDashboardsOnSave"

	// FlagAutoMigrateGraphPanels
	// Replace the angular graph panel with timeseries
	FlagAutoMigrateGraphPanels = "autoMigrateGraphPanels"

	// 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"

	// FlagUseLegacyHeatmapPanel
	// Continue to use the angular/flot based heatmap panel
	FlagUseLegacyHeatmapPanel = "useLegacyHeatmapPanel"

	// 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 for better grouping of installing / configuring data sources and other plugins.
	FlagDataConnectionsConsole = "dataConnectionsConsole"

	// FlagInternationalization
	// Enables work-in-progress internationalization
	FlagInternationalization = "internationalization"

	// FlagTopnav
	// New top nav and page layouts
	FlagTopnav = "topnav"

	// FlagGrpcServer
	// Run GRPC server
	FlagGrpcServer = "grpcServer"

	// FlagTraceqlEditor
	// Show the TraceQL editor in the explore page
	FlagTraceqlEditor = "traceqlEditor"

	// FlagRedshiftAsyncQueryDataSupport
	// Enable async query data support for Redshift
	FlagRedshiftAsyncQueryDataSupport = "redshiftAsyncQueryDataSupport"

	// FlagAthenaAsyncQueryDataSupport
	// Enable async query data support for Athena
	FlagAthenaAsyncQueryDataSupport = "athenaAsyncQueryDataSupport"

	// FlagIncreaseInMemDatabaseQueryCache
	// Enable more in memory caching for database queries
	FlagIncreaseInMemDatabaseQueryCache = "increaseInMemDatabaseQueryCache"
)

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 ProvideManagerService(cfg *setting.Cfg, licensing models.Licensing) (*FeatureManager, error)

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) 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

type FeatureToggles interface {
	IsEnabled(flag string) bool
}

func ProvideToggles

func ProvideToggles(mgmt *FeatureManager) FeatureToggles

ProvideToggles allows read-only access to the feature state

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL