Documentation
¶
Index ¶
- Constants
- Variables
- func AddExpander(name string, priority int64, e Expander)
- func EnvKey(sectionName string, keyName string) string
- func ExpandVar(s string) (string, error)
- func GetAlertmanagerDefaultConfiguration() string
- func GetAllowedOriginGlobs(originPatterns []string) ([]glob.Glob, error)
- func GetExpanderRegex() *regexp.Regexp
- func ReadFeatureTogglesFromInitFile(featureTogglesSection *ini.Section) (map[string]bool, error)
- func RedactedURL(value string) (string, error)
- func RedactedValue(key, value string) string
- func ToAbsUrl(relativeUrl string) string
- type AnnotationCleanupSettings
- type AuthJWTSettings
- type AuthProxySettings
- type Cfg
- func (cfg *Cfg) AddChangePasswordLink() bool
- func (cfg *Cfg) GetContentDeliveryURL(prefix string) (string, error)
- func (cfg *Cfg) Load(args CommandLineArgs) error
- func (cfg *Cfg) LogConfigSources()
- func (cfg *Cfg) ReadUnifiedAlertingSettings(iniFile *ini.File) error
- func (cfg *Cfg) SectionWithEnvOverrides(s string) *DynamicSection
- type CloudMigrationSettings
- type CommandLineArgs
- type DateFormatIntervals
- type DateFormats
- type DynamicSection
- type Expander
- type ExtJWTSettings
- type FeatureMgmtSettings
- type GlobalQuota
- type GrafanaJavascriptAgent
- type KeyValue
- type OSSImpl
- func (o *OSSImpl) Current() SettingsBag
- func (o *OSSImpl) CurrentVerbose() VerboseSettingsBag
- func (o *OSSImpl) KeyValue(section, key string) KeyValue
- func (*OSSImpl) RegisterReloadHandler(string, ReloadHandler)
- func (o *OSSImpl) Section(section string) Section
- func (OSSImpl) Update(SettingsBag, SettingsRemovals) error
- type OrgQuota
- type PluginSettings
- type Provider
- type QuotaSettings
- type ReloadHandler
- type RemoteAlertmanagerSettings
- type RemoteCacheOptions
- type Scheme
- type SearchSettings
- type Section
- type SecureSocksDSProxySettings
- type SettingsBag
- type SettingsRemovals
- type SmtpSettings
- type StorageSettings
- type UnifiedAlertingReservedLabelSettings
- type UnifiedAlertingScreenshotSettings
- type UnifiedAlertingSettings
- type UnifiedAlertingStateHistorySettings
- type UserQuota
- type ValidationError
- type VerboseSettingsBag
- type VerboseSourceType
Constants ¶
const ( RedactedPassword = "*********" DefaultHTTPAddr = "0.0.0.0" Dev = "development" Prod = "production" ApplicationName = "Grafana" )
const ( // SchedulerBaseInterval base interval of the scheduler. Controls how often the scheduler fetches database for new changes as well as schedules evaluation of a rule // changing this value is discouraged because this could cause existing alert definition // with intervals that are not exactly divided by this number not to be evaluated SchedulerBaseInterval = 10 * time.Second // DefaultRuleEvaluationInterval indicates a default interval of for how long a rule should be evaluated to change state from Pending to Alerting DefaultRuleEvaluationInterval = SchedulerBaseInterval * 6 // == 60 seconds )
Variables ¶
var ( // App settings. Env = Dev AppUrl string AppSubUrl string // build BuildVersion string BuildCommit string EnterpriseBuildCommit string BuildBranch string BuildStamp int64 IsEnterprise bool // packaging Packaging = "unknown" CookieSecure bool CookieSameSiteDisabled bool CookieSameSiteMode http.SameSite )
var (
ErrOperationNotPermitted = errors.New("operation not permitted")
)
Functions ¶
func AddExpander ¶
func GetAlertmanagerDefaultConfiguration ¶
func GetAlertmanagerDefaultConfiguration() string
func GetAllowedOriginGlobs ¶
func GetExpanderRegex ¶
Slightly hacky function to avoid code duplication. If this is eventually called in multiple places, consider refactoring or potentially adding more general helper functions to this package
func RedactedURL ¶
func RedactedValue ¶
Types ¶
type AuthJWTSettings ¶
type AuthJWTSettings struct { // JWT Auth Enabled bool HeaderName string URLLogin bool EmailClaim string UsernameClaim string ExpectClaims string JWKSetURL string CacheTTL time.Duration KeyFile string KeyID string JWKSetFile string AutoSignUp bool RoleAttributePath string RoleAttributeStrict bool AllowAssignGrafanaAdmin bool SkipOrgRoleSync bool GroupsAttributePath string EmailAttributePath string UsernameAttributePath string }
type AuthProxySettings ¶
type Cfg ¶
type Cfg struct { Target []string Raw *ini.File Logger log.Logger // HTTP Server Settings CertFile string KeyFile string CertWatchInterval time.Duration HTTPAddr string HTTPPort string Env string AppURL string AppSubURL string InstanceName string ServeFromSubPath bool StaticRootPath string Protocol Scheme SocketGid int SocketMode int SocketPath string RouterLogging bool Domain string CDNRootURL *url.URL ReadTimeout time.Duration EnableGzip bool EnforceDomain bool MinTLSVersion string // Security settings SecretKey string EmailCodeValidMinutes int // build BuildVersion string BuildCommit string EnterpriseBuildCommit string BuildBranch string BuildStamp int64 IsEnterprise bool // packaging Packaging string // Paths HomePath string ProvisioningPath string DataPath string LogsPath string PluginsPath string BundledPluginsPath string EnterpriseLicensePath string // SMTP email settings Smtp SmtpSettings // Rendering ImagesDir string CSVsDir string PDFsDir string RendererUrl string RendererCallbackUrl string RendererAuthToken string RendererConcurrentRequestLimit int RendererRenderKeyLifeTime time.Duration RendererDefaultImageWidth int RendererDefaultImageHeight int RendererDefaultImageScale float64 // Security DisableInitAdminCreation bool DisableBruteForceLoginProtection bool CookieSecure bool CookieSameSiteDisabled bool CookieSameSiteMode http.SameSite AllowEmbedding bool XSSProtectionHeader bool ContentTypeProtectionHeader bool StrictTransportSecurity bool StrictTransportSecurityMaxAge int StrictTransportSecurityPreload bool StrictTransportSecuritySubDomains bool // CSPEnabled toggles Content Security Policy support. CSPEnabled bool // CSPTemplate contains the Content Security Policy template. CSPTemplate string // CSPReportEnabled toggles Content Security Policy Report Only support. CSPReportOnlyEnabled bool // CSPReportOnlyTemplate contains the Content Security Policy Report Only template. CSPReportOnlyTemplate string AngularSupportEnabled bool DisableFrontendSandboxForPlugins []string DisableGravatar bool DataProxyWhiteList map[string]bool TempDataLifetime time.Duration // Plugins PluginsEnableAlpha bool PluginsAppsSkipVerifyTLS bool PluginSettings PluginSettings PluginsAllowUnsigned []string PluginCatalogURL string PluginCatalogHiddenPlugins []string PluginAdminEnabled bool PluginAdminExternalManageEnabled bool PluginForcePublicKeyDownload bool PluginSkipPublicKeyDownload bool DisablePlugins []string HideAngularDeprecation []string PluginInstallToken string ForwardHostEnvVars []string PluginsCDNURLTemplate string PluginLogBackendRequests bool // Panels DisableSanitizeHtml bool // Metrics MetricsEndpointEnabled bool MetricsEndpointBasicAuthUsername string MetricsEndpointBasicAuthPassword string MetricsEndpointDisableTotalStats bool // MetricsIncludeTeamLabel configures grafana to set a label for // the team responsible for the code at Grafana labs. We don't expect anyone else to // use this setting. MetricsIncludeTeamLabel bool MetricsTotalStatsIntervalSeconds int MetricsGrafanaEnvironmentInfo map[string]string // Dashboards DashboardVersionsToKeep int MinRefreshInterval string DefaultHomeDashboardPath string // Auth LoginCookieName string LoginMaxInactiveLifetime time.Duration LoginMaxLifetime time.Duration TokenRotationIntervalMinutes int SigV4AuthEnabled bool SigV4VerboseLogging bool AzureAuthEnabled bool AzureSkipOrgRoleSync bool BasicAuthEnabled bool BasicAuthStrongPasswordPolicy bool AdminUser string AdminPassword string DisableLogin bool AdminEmail string DisableLoginForm bool SignoutRedirectUrl string IDResponseHeaderEnabled bool IDResponseHeaderPrefix string IDResponseHeaderNamespaces map[string]struct{} // AWS Plugin Auth AWSAllowedAuthProviders []string AWSAssumeRoleEnabled bool AWSSessionDuration string AWSExternalId string AWSListMetricsPageLimit int AWSForwardSettingsPlugins []string // Azure Cloud settings Azure *azsettings.AzureSettings // Auth proxy settings AuthProxy AuthProxySettings // OAuth OAuthAutoLogin bool OAuthCookieMaxAge int OAuthAllowInsecureEmailLookup bool JWTAuth AuthJWTSettings ExtJWTAuth ExtJWTSettings // SSO Settings Auth SSOSettingsReloadInterval time.Duration SSOSettingsConfigurableProviders map[string]bool // Dataproxy SendUserHeader bool DataProxyLogging bool DataProxyTimeout int DataProxyDialTimeout int DataProxyTLSHandshakeTimeout int DataProxyExpectContinueTimeout int DataProxyMaxConnsPerHost int DataProxyMaxIdleConns int DataProxyKeepAlive int DataProxyIdleConnTimeout int ResponseLimit int64 DataProxyRowLimit int64 DataProxyUserAgent string // DistributedCache RemoteCacheOptions *RemoteCacheOptions ViewersCanEdit bool EditorsCanAdmin bool ApiKeyMaxSecondsToLive int64 // Check if a feature toggle is enabled // Deprecated: use featuremgmt.FeatureFlags IsFeatureToggleEnabled func(key string) bool // filled in dynamically AnonymousEnabled bool AnonymousOrgName string AnonymousOrgRole string AnonymousHideVersion bool AnonymousDeviceLimit int64 DateFormats DateFormats // User UserInviteMaxLifetime time.Duration HiddenUsers map[string]struct{} CaseInsensitiveLogin bool // Login and Email will be considered case insensitive VerificationEmailMaxLifetime time.Duration // Service Accounts SATokenExpirationDayLimit int // Annotations AnnotationCleanupJobBatchSize int64 AnnotationMaximumTagsLength int64 AlertingAnnotationCleanupSetting AnnotationCleanupSettings DashboardAnnotationCleanupSettings AnnotationCleanupSettings APIAnnotationCleanupSettings AnnotationCleanupSettings // GrafanaJavascriptAgent config GrafanaJavascriptAgent GrafanaJavascriptAgent // accessactionsets OnlyStoreAccessActionSets bool // Data sources DataSourceLimit int // Number of queries to be executed concurrently. Only for the datasource supports concurrency. ConcurrentQueryCount int // IP range access control IPRangeACEnabled bool IPRangeACAllowedURLs []*url.URL IPRangeACSecretKey string // SQL Data sources SqlDatasourceMaxOpenConnsDefault int SqlDatasourceMaxIdleConnsDefault int SqlDatasourceMaxConnLifetimeDefault int // Snapshots SnapshotEnabled bool ExternalSnapshotUrl string ExternalSnapshotName string ExternalEnabled bool // Deprecated: setting this to false adds deprecation warnings at runtime SnapShotRemoveExpired bool // Only used in https://snapshots.raintank.io/ SnapshotPublicMode bool ErrTemplateName string StackID string Slug string LocalFileSystemAvailable bool // Analytics CheckForGrafanaUpdates bool CheckForPluginUpdates bool ReportingDistributor string ReportingEnabled bool ApplicationInsightsConnectionString string ApplicationInsightsEndpointUrl string FeedbackLinksEnabled bool // Frontend analytics GoogleAnalyticsID string GoogleAnalytics4ID string GoogleAnalytics4SendManualPageViews bool GoogleTagManagerID string RudderstackDataPlaneURL string RudderstackWriteKey string RudderstackSDKURL string RudderstackConfigURL string RudderstackIntegrationsURL string IntercomSecret string // LDAP LDAPAuthEnabled bool LDAPSkipOrgRoleSync bool LDAPConfigFilePath string LDAPAllowSignup bool LDAPActiveSyncEnabled bool LDAPSyncCron string DefaultTheme string DefaultLanguage string HomePage string Quota QuotaSettings // User settings AllowUserSignUp bool AllowUserOrgCreate bool VerifyEmailEnabled bool LoginHint string PasswordHint string DisableSignoutMenu bool ExternalUserMngLinkUrl string ExternalUserMngLinkName string ExternalUserMngInfo string AutoAssignOrg bool AutoAssignOrgId int AutoAssignOrgRole string LoginDefaultOrgId int64 OAuthSkipOrgRoleUpdateSync bool // ExpressionsEnabled specifies whether expressions are enabled. ExpressionsEnabled bool ImageUploadProvider string // LiveMaxConnections is a maximum number of WebSocket connections to // Grafana Live ws endpoint (per Grafana server instance). 0 disables // Live, -1 means unlimited connections. LiveMaxConnections int // LiveHAEngine is a type of engine to use to achieve HA with Grafana Live. // Zero value means in-memory single node setup. LiveHAEngine string // LiveHAEngineAddress is a connection address for Live HA engine. LiveHAEngineAddress string LiveHAEnginePassword string // LiveAllowedOrigins is a set of origins accepted by Live. If not provided // then Live uses AppURL as the only allowed origin. LiveAllowedOrigins []string // Grafana.com URL, used for OAuth redirect. GrafanaComURL string // Grafana.com API URL. Can be set separately to GrafanaComURL // in case API is not publicly accessible. // Defaults to GrafanaComURL setting + "/api" if unset. GrafanaComAPIURL string // Grafana.com SSO API token used for Unified SSO between instances and Grafana.com. GrafanaComSSOAPIToken string // Geomap base layer config GeomapDefaultBaseLayerConfig map[string]any GeomapEnableCustomBaseLayers bool // Unified Alerting UnifiedAlerting UnifiedAlertingSettings // Query history QueryHistoryEnabled bool Storage StorageSettings Search SearchSettings SecureSocksDSProxy SecureSocksDSProxySettings // SAML Auth SAMLAuthEnabled bool SAMLSkipOrgRoleSync bool SAMLRoleValuesGrafanaAdmin string // OAuth2 Server OAuth2ServerEnabled bool // OAuth2Server supports the two recommended key types from the RFC https://www.rfc-editor.org/rfc/rfc7518#section-3.1: RS256 and ES256 OAuth2ServerGeneratedKeyTypeForClient string OAuth2ServerAccessTokenLifespan time.Duration // Access Control RBACPermissionCache bool // Enable Permission validation during role creation and provisioning RBACPermissionValidationEnabled bool // Reset basic roles permissions on start-up RBACResetBasicRoles bool // RBAC single organization. This configuration option is subject to change. RBACSingleOrganization bool // GRPC Server. GRPCServerNetwork string GRPCServerAddress string GRPCServerTLSConfig *tls.Config GRPCServerEnableLogging bool // log request and response of each unary gRPC call GRPCServerMaxRecvMsgSize int GRPCServerMaxSendMsgSize int CustomResponseHeaders map[string]string // This is used to override the general error message shown to users when we want to obfuscate a sensitive backend error UserFacingDefaultError string // DatabaseInstrumentQueries is used to decide if database queries // should be instrumented with metrics, logs and traces. // This needs to be on the global object since its used in the // sqlstore package and HTTP middlewares. DatabaseInstrumentQueries bool // Public dashboards PublicDashboardsEnabled bool // Cloud Migration CloudMigration CloudMigrationSettings // Feature Management Settings FeatureManagement FeatureMgmtSettings // Alerting AlertingEvaluationTimeout time.Duration AlertingNotificationTimeout time.Duration AlertingMaxAttempts int AlertingMinInterval int64 // Explore UI ExploreEnabled bool // Help UI HelpEnabled bool // Profile UI ProfileEnabled bool // News Feed NewsFeedEnabled bool // Experimental scope settings ScopesListScopesURL string ScopesListDashboardsURL string //Short Links ShortLinkExpiration int // contains filtered or unexported fields }
TODO move all global vars to this struct
func NewCfgFromArgs ¶
func NewCfgFromArgs(args CommandLineArgs) (*Cfg, error)
func NewCfgFromBytes ¶
NewCfgFromBytes specialized function to create a new Cfg from bytes (INI file).
func NewCfgFromINIFile ¶
NewCfgFromINIFile specialized function to create a new Cfg from an ini.File.
func NewCfgWithFeatures
deprecated
func (*Cfg) AddChangePasswordLink ¶
AddChangePasswordLink returns if login form is disabled or not since the same intention can be used to hide both features.
func (*Cfg) GetContentDeliveryURL ¶
GetContentDeliveryURL returns full content delivery URL with /<edition>/<version> added to URL
func (*Cfg) Load ¶
func (cfg *Cfg) Load(args CommandLineArgs) error
func (*Cfg) LogConfigSources ¶
func (cfg *Cfg) LogConfigSources()
func (*Cfg) ReadUnifiedAlertingSettings ¶
ReadUnifiedAlertingSettings reads both the `unified_alerting` and `alerting` sections of the configuration while preferring configuration the `alerting` section. It first reads the `unified_alerting` section, then looks for non-defaults on the `alerting` section and prefers those.
nolint: gocyclo
func (*Cfg) SectionWithEnvOverrides ¶
func (cfg *Cfg) SectionWithEnvOverrides(s string) *DynamicSection
SectionWithEnvOverrides dynamically overrides keys with environment variables. As a side effect, the value of the setting key will be updated if an environment variable is present.
type CloudMigrationSettings ¶
type CloudMigrationSettings struct { IsTarget bool GcomAPIToken string FetchInstanceTimeout time.Duration CreateAccessPolicyTimeout time.Duration FetchAccessPolicyTimeout time.Duration DeleteAccessPolicyTimeout time.Duration ListTokensTimeout time.Duration CreateTokenTimeout time.Duration DeleteTokenTimeout time.Duration TokenExpiresAfter time.Duration IsDeveloperMode bool }
type CommandLineArgs ¶
type DateFormatIntervals ¶
type DateFormats ¶
type DateFormats struct { FullDate string `json:"fullDate"` UseBrowserLocale bool `json:"useBrowserLocale"` Interval DateFormatIntervals `json:"interval"` DefaultTimezone string `json:"defaultTimezone"` DefaultWeekStart string `json:"defaultWeekStart"` }
type DynamicSection ¶
func (*DynamicSection) Key ¶
func (s *DynamicSection) Key(k string) *ini.Key
Key dynamically overrides keys with environment variables. As a side effect, the value of the setting key will be updated if an environment variable is present.
func (*DynamicSection) KeysHash ¶
func (s *DynamicSection) KeysHash() map[string]string
type ExtJWTSettings ¶
type FeatureMgmtSettings ¶
type GlobalQuota ¶
type GlobalQuota struct { Org int64 `target:"org"` User int64 `target:"user"` DataSource int64 `target:"data_source"` Dashboard int64 `target:"dashboard"` ApiKey int64 `target:"api_key"` Session int64 `target:"-"` AlertRule int64 `target:"alert_rule"` File int64 `target:"file"` Correlations int64 `target:"correlations"` }
type GrafanaJavascriptAgent ¶
type GrafanaJavascriptAgent struct { Enabled bool `json:"enabled"` CustomEndpoint string `json:"customEndpoint"` EndpointRPS int `json:"-"` EndpointBurst int `json:"-"` ErrorInstrumentalizationEnabled bool `json:"errorInstrumentalizationEnabled"` ConsoleInstrumentalizationEnabled bool `json:"consoleInstrumentalizationEnabled"` WebVitalsInstrumentalizationEnabled bool `json:"webVitalsInstrumentalizationEnabled"` InternalLoggerLevel int `json:"internalLoggerLevel"` ApiKey string `json:"apiKey"` }
type KeyValue ¶
type KeyValue interface { // Key returns pair's key. Key() string // Value returns pair's value. Value() string // MustString returns the value's string representation // If empty, then it returns the given default. MustString(defaultVal string) string // MustBool returns the value's boolean representation // Otherwise returns the given default. MustBool(defaultVal bool) bool // MustDuration returns the value's time.Duration // representation. Otherwise returns the given default. MustDuration(defaultVal time.Duration) time.Duration }
KeyValue represents a settings key-value for a given pair of section and key.
type OSSImpl ¶
type OSSImpl struct {
Cfg *Cfg
}
func ProvideProvider ¶
func (*OSSImpl) Current ¶
func (o *OSSImpl) Current() SettingsBag
func (*OSSImpl) CurrentVerbose ¶
func (o *OSSImpl) CurrentVerbose() VerboseSettingsBag
func (*OSSImpl) RegisterReloadHandler ¶
func (*OSSImpl) RegisterReloadHandler(string, ReloadHandler)
func (OSSImpl) Update ¶
func (OSSImpl) Update(SettingsBag, SettingsRemovals) error
type PluginSettings ¶
PluginSettings maps plugin id to map of key/value settings.
type Provider ¶
type Provider interface { // Current returns a SettingsBag with a static copy of // the current configured pairs of key/values for each // configuration section. Current() SettingsBag CurrentVerbose() VerboseSettingsBag // Update receives a SettingsBag with the pairs of key/values // to be updated per section and a SettingsRemovals with the // section keys to be removed. Update(updates SettingsBag, removals SettingsRemovals) error // KeyValue returns a key-value abstraction // for the given pair of section and key. KeyValue(section, key string) KeyValue // Section returns a settings section // abstraction for the given section name. Section(section string) Section // RegisterReloadHandler registers a handler for validation and reload // of configuration updates tied to a specific section RegisterReloadHandler(section string, handler ReloadHandler) }
Provider is a settings provider abstraction with thread-safety and runtime updates.
type QuotaSettings ¶
type QuotaSettings struct { Enabled bool Org OrgQuota User UserQuota Global GlobalQuota }
type ReloadHandler ¶
type ReloadHandler interface { // Reload handles reloading of configuration changes. ReloadSection(section Section) error // Validate validates the configuration, if the validation // fails the configuration will not be updated neither reloaded. ValidateSection(section Section) error }
ReloadHandler defines the expected behaviour from a service that have support for configuration reloads.
type RemoteAlertmanagerSettings ¶
type RemoteAlertmanagerSettings struct { Enable bool URL string TenantID string Password string SyncInterval time.Duration }
RemoteAlertmanagerSettings contains the configuration needed to disable the internal Alertmanager and use an external one instead.
type RemoteCacheOptions ¶
type SearchSettings ¶
type Section ¶
type Section interface { // KeyValue returns a key-value // abstraction for the given key. KeyValue(key string) KeyValue }
Section is a settings section copy with all of its pairs of keys-values.
type SettingsBag ¶
type SettingsRemovals ¶
type SmtpSettings ¶
type SmtpSettings struct { Enabled bool Host string User string Password string CertFile string KeyFile string FromAddress string FromName string EhloIdentity string StartTLSPolicy string SkipVerify bool StaticHeaders map[string]string EnableTracing bool SendWelcomeEmailOnSignUp bool TemplatesPatterns []string ContentTypes []string }
type StorageSettings ¶
type StorageSettings struct {
AllowUnsanitizedSvgUpload bool
}
type UnifiedAlertingReservedLabelSettings ¶
type UnifiedAlertingReservedLabelSettings struct {
DisabledLabels map[string]struct{}
}
func (*UnifiedAlertingReservedLabelSettings) IsReservedLabelDisabled ¶
func (u *UnifiedAlertingReservedLabelSettings) IsReservedLabelDisabled(label string) bool
IsReservedLabelDisabled returns true if UnifiedAlertingReservedLabelSettings.DisabledLabels contains the given reserved label.
type UnifiedAlertingSettings ¶
type UnifiedAlertingSettings struct { AdminConfigPollInterval time.Duration AlertmanagerConfigPollInterval time.Duration HAListenAddr string HAAdvertiseAddr string HAPeers []string HAPeerTimeout time.Duration HAGossipInterval time.Duration HAPushPullInterval time.Duration HALabel string HARedisClusterModeEnabled bool HARedisAddr string HARedisPeerName string HARedisPrefix string HARedisUsername string HARedisPassword string HARedisDB int HARedisMaxConns int HARedisTLSEnabled bool HARedisTLSConfig dstls.ClientConfig MaxAttempts int64 MinInterval time.Duration EvaluationTimeout time.Duration DisableJitter bool ExecuteAlerts bool DefaultConfiguration string Enabled *bool // determines whether unified alerting is enabled. If it is nil then user did not define it and therefore its value will be determined during migration. Services should not use it directly. DisabledOrgs map[int64]struct{} // BaseInterval interval of time the scheduler updates the rules and evaluates rules. // Only for internal use and not user configuration. BaseInterval time.Duration // DefaultRuleEvaluationInterval default interval between evaluations of a rule. DefaultRuleEvaluationInterval time.Duration Screenshots UnifiedAlertingScreenshotSettings ReservedLabels UnifiedAlertingReservedLabelSettings StateHistory UnifiedAlertingStateHistorySettings RemoteAlertmanager RemoteAlertmanagerSettings // MaxStateSaveConcurrency controls the number of goroutines (per rule) that can save alert state in parallel. MaxStateSaveConcurrency int StatePeriodicSaveInterval time.Duration RulesPerRuleGroupLimit int64 // Retention period for Alertmanager notification log entries. NotificationLogRetention time.Duration }
func (*UnifiedAlertingSettings) IsEnabled ¶
func (u *UnifiedAlertingSettings) IsEnabled() bool
IsEnabled returns true if UnifiedAlertingSettings.Enabled is either nil or true. It hides the implementation details of the Enabled and simplifies its usage.
type UnifiedAlertingStateHistorySettings ¶
type UnifiedAlertingStateHistorySettings struct { Enabled bool Backend string LokiRemoteURL string LokiReadURL string LokiWriteURL string LokiTenantID string // LokiBasicAuthUsername and LokiBasicAuthPassword are used for basic auth // if one of them is set. LokiBasicAuthPassword string LokiBasicAuthUsername string LokiMaxQueryLength time.Duration MultiPrimary string MultiSecondaries []string ExternalLabels map[string]string }
type ValidationError ¶
type ValidationError struct {
Errors []error
}
func (ValidationError) Error ¶
func (v ValidationError) Error() string
type VerboseSettingsBag ¶
type VerboseSettingsBag map[string]map[string]map[VerboseSourceType]string
type VerboseSourceType ¶
type VerboseSourceType string
const ( DB VerboseSourceType = "db" System VerboseSourceType = "system" )
Source Files
¶
- date_formats.go
- expanders.go
- provider.go
- setting.go
- setting_auth_proxy.go
- setting_azure.go
- setting_cloud_migration.go
- setting_data_proxy.go
- setting_feature_toggles.go
- setting_featuremgmt.go
- setting_grafana_javascript_agent.go
- setting_jwt.go
- setting_plugins.go
- setting_quota.go
- setting_search.go
- setting_secure_socks_proxy.go
- setting_smtp.go
- setting_storage.go
- setting_unified_alerting.go