Documentation ¶
Overview ¶
Package checkmgr provides a check management interface to circonus-gometrics
Index ¶
- type BrokerCNType
- type BrokerConfig
- type CACert
- type CheckConfig
- type CheckDisplayNameType
- type CheckInstanceIDType
- type CheckManager
- func (cm *CheckManager) ActivateMetric(name string) bool
- func (cm *CheckManager) AddMetricTags(metricName string, tags []string, appendTags bool) bool
- func (cm *CheckManager) BrokerTLSConfig() *tls.Config
- func (cm *CheckManager) GetCheckBundle() *apiclient.CheckBundle
- func (cm *CheckManager) GetSubmissionURL() (*Trap, error)
- func (cm *CheckManager) Initialize() error
- func (cm *CheckManager) IsMetricActive(name string) bool
- func (cm *CheckManager) IsReady() bool
- func (cm *CheckManager) RefreshTrap() error
- func (cm *CheckManager) ResetTrap() error
- func (cm *CheckManager) UpdateCheck(newMetrics map[string]*apiclient.CheckBundleMetric)
- type CheckSecretType
- type CheckTagsType
- type CheckTargetType
- type CheckTypeType
- type Config
- type Logger
- type MetricFilter
- type Trap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BrokerConfig ¶
type BrokerConfig struct { // TLS configuration to use when communicating within broker TLSConfig *tls.Config // a specific broker id (numeric portion of cid) ID string // one or more tags used to select 1-n brokers from which to select // when creating a new check (e.g. datacenter:abc or loc:dfw,dc:abc) SelectTag string // for a broker to be considered viable it must respond to a // connection attempt within this amount of time e.g. 200ms, 2s, 1m MaxResponseTime string }
BrokerConfig options for broker
type CACert ¶
type CACert struct {
Contents string `json:"contents"`
}
CACert contains cert returned from Circonus API
type CheckConfig ¶
type CheckConfig struct { // a specific submission url SubmissionURL string // a specific check id (not check bundle id) ID string // unique instance id string // used to search for a check to use // used as check.target when creating a check InstanceID string // explicitly set check.target (default: instance id) TargetHost string // a custom display name for the check (as viewed in UI Checks) // default: instance id DisplayName string // unique check searching tag (or tags) // used to search for a check to use (combined with instanceid) // used as a regular tag when creating a check SearchTag string // httptrap check secret (for creating a check) Secret string // additional tags to add to a check (when creating a check) // these tags will not be added to an existing check Tags string // max amount of time to to hold on to a submission url // when a given submission fails (due to retries) if the // time the url was last updated is > than this, the trap // url will be refreshed (e.g. if the broker is changed // in the UI) **only relevant when check management is enabled** // e.g. 5m, 30m, 1h, etc. MaxURLAge string // Type of check to use (default: httptrap) Type string // force metric activation - if a metric has been disabled via the UI // the default behavior is to *not* re-activate the metric; this setting // overrides the behavior and will re-activate the metric when it is // encountered. "(true|false)", default "false" // NOTE: ONLY applies to checks without metric_filters ForceMetricActivation string // Custom check config fields (default: none) CustomConfigFields map[string]string // MetricFilters list of regular expression filters defining what metrics // will be automatically enabled. These are evaluated in order and the first // match stops evaluation. Default []MetricFilter{{"deny","^$",""},{"allow","^.+$",""}} MetricFilters []MetricFilter }
CheckConfig options for check
type CheckDisplayNameType ¶
type CheckDisplayNameType string
CheckDisplayNameType check display name
type CheckManager ¶
type CheckManager struct { Log Logger // general Debug bool // general // contains filtered or unexported fields }
CheckManager settings
func NewCheckManager ¶
func NewCheckManager(cfg *Config) (*CheckManager, error)
NewCheckManager returns a new check manager
func (*CheckManager) ActivateMetric ¶
func (cm *CheckManager) ActivateMetric(name string) bool
ActivateMetric determines if a given metric should be activated
func (*CheckManager) AddMetricTags ¶
func (cm *CheckManager) AddMetricTags(metricName string, tags []string, appendTags bool) bool
AddMetricTags updates check bundle metrics with tags
func (*CheckManager) BrokerTLSConfig ¶ added in v3.4.2
func (cm *CheckManager) BrokerTLSConfig() *tls.Config
func (*CheckManager) GetCheckBundle ¶ added in v3.4.2
func (cm *CheckManager) GetCheckBundle() *apiclient.CheckBundle
func (*CheckManager) GetSubmissionURL ¶
func (cm *CheckManager) GetSubmissionURL() (*Trap, error)
GetSubmissionURL returns submission url for circonus
func (*CheckManager) Initialize ¶
func (cm *CheckManager) Initialize() error
Initialize for sending metrics
func (*CheckManager) IsMetricActive ¶
func (cm *CheckManager) IsMetricActive(name string) bool
IsMetricActive checks whether a given metric name is currently active(enabled)
func (*CheckManager) IsReady ¶
func (cm *CheckManager) IsReady() bool
IsReady reflects if the check has been initialized and metrics can be sent to Circonus
func (*CheckManager) RefreshTrap ¶
func (cm *CheckManager) RefreshTrap() error
RefreshTrap check when the last time the URL was reset, reset if needed
func (*CheckManager) ResetTrap ¶
func (cm *CheckManager) ResetTrap() error
ResetTrap URL, force request to the API for the submission URL and broker ca cert
func (*CheckManager) UpdateCheck ¶
func (cm *CheckManager) UpdateCheck(newMetrics map[string]*apiclient.CheckBundleMetric)
UpdateCheck determines if the check needs to be updated (new metrics, tags, etc.)
type Config ¶
type Config struct { Log Logger Broker BrokerConfig // Broker specific configuration options Check CheckConfig // Check specific configuration options API apiclient.Config // Circonus API config SerialInit bool // serial initialization (not background) Debug bool }
Config options
type Logger ¶
type Logger interface {
Printf(string, ...interface{})
}
Logger facilitates use of any logger supporting the required methods rather than just standard log package log.Logger