Documentation ¶
Index ¶
- type CommonGlobalConfig
- type CommonInstanceConfig
- type Config
- func (c *Config) AddMetrics(metrics Data) error
- func (c *Config) Digest() string
- func (c *Config) Equal(cfg *Config) bool
- func (c *Config) GetTemplateVariablesForInstance(i int) []tmplvar.TemplateVar
- func (c *Config) HasFilter(filter containers.FilterType) bool
- func (c *Config) IsCheckConfig() bool
- func (c *Config) IsLogConfig() bool
- func (c *Config) IsTemplate() bool
- func (c *Config) String() string
- type CreationTime
- type Data
- type JSONMap
- type RawMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommonGlobalConfig ¶
type CommonGlobalConfig struct {
Service string `yaml:"service"`
}
CommonGlobalConfig holds the reserved fields for the yaml init_config data
type CommonInstanceConfig ¶
type CommonInstanceConfig struct { MinCollectionInterval int `yaml:"min_collection_interval"` EmptyDefaultHostname bool `yaml:"empty_default_hostname"` Tags []string `yaml:"tags"` Service string `yaml:"service"` Name string `yaml:"name"` Namespace string `yaml:"namespace"` }
CommonInstanceConfig holds the reserved fields for the yaml instance data
type Config ¶
type Config struct { Name string `json:"check_name"` // the name of the check (include in digest: true) Instances []Data `json:"instances"` // the list of instances in Yaml (include in digest: true) InitConfig Data `json:"init_config"` // the init_config in Yaml (include in digest: true) MetricConfig Data `json:"metric_config"` // the metric config in Yaml (jmx check only) (include in digest: false) LogsConfig Data `json:"logs"` // the logs config in Yaml (logs-agent only) (include in digest: true) ADIdentifiers []string `json:"ad_identifiers"` // the list of AutoDiscovery identifiers (optional) (include in digest: true) Provider string `json:"provider"` // the provider that issued the config (include in digest: false) Entity string `json:"-"` // the entity ID (optional) (include in digest: true) TaggerEntity string `json:"-"` // the tagger entity ID (optional) (include in digest: false) ClusterCheck bool `json:"cluster_check"` // cluster-check configuration flag (include in digest: false) NodeName string `json:"node_name"` // node name in case of an endpoint check backed by a pod (include in digest: true) CreationTime CreationTime `json:"-"` // creation time of service (include in digest: false) Source string `json:"source"` // the source of the configuration (include in digest: false) IgnoreAutodiscoveryTags bool `json:"ignore_autodiscovery_tags"` // used to ignore tags coming from autodiscovery (include in digest: true) MetricsExcluded bool `json:"metrics_excluded"` // whether metrics collection is disabled (set by container listeners only) (include in digest: false) LogsExcluded bool `json:"logs_excluded"` // whether logs collection is disabled (set by container listeners only) (include in digest: false) }
Config is a generic container for configuration files When a new field is added to this struct, please evaluate whether it should be computed in the config Digest and update the field's documentation and the Digest method accordingly
func (*Config) AddMetrics ¶
AddMetrics adds metrics to a check configuration
func (*Config) Digest ¶
Digest returns an hash value representing the data stored in this configuration. The ClusterCheck field is intentionally left out to keep a stable digest between the cluster-agent and the node-agents
func (*Config) GetTemplateVariablesForInstance ¶
func (c *Config) GetTemplateVariablesForInstance(i int) []tmplvar.TemplateVar
GetTemplateVariablesForInstance returns a slice of raw template variables it found in a config instance template.
func (*Config) HasFilter ¶
func (c *Config) HasFilter(filter containers.FilterType) bool
HasFilter returns true if metrics or logs collection must be disabled for this config. no containers.GlobalFilter case here because we don't create services that are globally excluded in AD
func (*Config) IsCheckConfig ¶
IsCheckConfig returns true if the config is a node-agent check configuration,
func (*Config) IsLogConfig ¶
IsLogConfig returns true if config contains a logs config.
func (*Config) IsTemplate ¶
IsTemplate returns if the config has AD identifiers
type CreationTime ¶
type CreationTime int
CreationTime represents the moment when the service was launched compare to the agent start.
const ( // Before indicates the service was launched before the agent start Before CreationTime = iota // After indicates the service was launched after the agent start After )
type Data ¶
type Data []byte
Data contains YAML code
func (*Data) GetNameForInstance ¶
GetNameForInstance returns the name from an instance if specified, fallback on namespace
func (*Data) MergeAdditionalTags ¶
MergeAdditionalTags merges additional tags to possible existing config tags