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) GetSubmissionURL() (*Trap, error)
- func (cm *CheckManager) Initialize()
- 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]*api.CheckBundleMetric)
- type CheckSecretType
- type CheckTagsType
- type CheckTargetType
- type CheckTypeType
- type Config
- type Trap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BrokerConfig ¶
type BrokerConfig struct { // 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 // TLS configuration to use when communicating within broker TLSConfig *tls.Config }
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 // 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" ForceMetricActivation string // Type of check to use (default: httptrap) Type string // Custom check config fields (default: none) CustomConfigFields map[string]string }
CheckConfig options for check
type CheckDisplayNameType ¶
type CheckDisplayNameType string
CheckDisplayNameType check display name
type CheckManager ¶
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) GetSubmissionURL ¶
func (cm *CheckManager) GetSubmissionURL() (*Trap, error)
GetSubmissionURL returns submission url for circonus
func (*CheckManager) Initialize ¶
func (cm *CheckManager) Initialize()
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 initialied 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]*api.CheckBundleMetric)
UpdateCheck determines if the check needs to be updated (new metrics, tags, etc.)
type Config ¶
type Config struct { Log *log.Logger Debug bool // Circonus API config API api.Config // Check specific configuration options Check CheckConfig // Broker specific configuration options Broker BrokerConfig }
Config options