Documentation
¶
Index ¶
Constants ¶
View Source
const ( API = "api" OTLPReceiver = "otlp_receiver" Prometheus = "prometheus" PromQL = "promql" PromQLFunctions = "promql_functions" PromQLOperators = "promql_operators" Rules = "rules" Scrape = "scrape" ServiceDiscoveryProviders = "service_discovery_providers" TemplatingFunctions = "templating_functions" TSDB = "tsdb" UI = "ui" )
Category constants define the standard feature flag categories used in Prometheus.
Variables ¶
View Source
var DefaultRegistry = NewRegistry()
DefaultRegistry is the package-level registry used by Prometheus.
Functions ¶
func Disable ¶
func Disable(category, name string)
Disable marks a feature as disabled in the default registry.
func Enable ¶
func Enable(category, name string)
Enable marks a feature as enabled in the default registry.
Types ¶
type Collector ¶
type Collector interface {
// Enable marks a feature as enabled in the registry.
// The category and name should use snake_case naming convention.
Enable(category, name string)
// Disable marks a feature as disabled in the registry.
// The category and name should use snake_case naming convention.
Disable(category, name string)
// Set sets a feature to the specified enabled state.
// The category and name should use snake_case naming convention.
Set(category, name string, enabled bool)
// Get returns a copy of all registered features organized by category.
// Returns a map where the keys are category names and values are maps
// of feature names to their enabled status.
Get() map[string]map[string]bool
}
Collector defines the interface for collecting and managing feature flags. It provides methods to enable, disable, and retrieve feature states.
Click to show internal directories.
Click to hide internal directories.