integration

package
v0.0.0-...-3dd6856 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

README

package integration

This package is responsible of defining the types representing an integration which can be used by several components of the agent to configure checks or logs collectors for example.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonInstanceConfig

type CommonInstanceConfig struct {
	MinCollectionInterval int      `yaml:"min_collection_interval"`
	EmptyDefaultHostname  bool     `yaml:"empty_default_hostname"`
	Tags                  []string `yaml:"tags"`
	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
	Instances       []Data       `json:"instances"`      // array of Yaml configurations
	InitConfig      Data         `json:"init_config"`    // the init_config in Yaml (python check only)
	MetricConfig    Data         `json:"metric_config"`  // the metric config in Yaml (jmx check only)
	LogsConfig      Data         `json:"logs"`           // the logs config in Yaml (logs-agent only)
	ADIdentifiers   []string     `json:"ad_identifiers"` // the list of AutoDiscovery identifiers (optional)
	Provider        string       `json:"provider"`       // the provider that issued the config
	Entity          string       `json:"-"`              // the id of the entity (optional)
	ClusterCheck    bool         `json:"cluster_check"`  // cluster-check configuration flag
	EndpointsChecks []Config     `json:"-"`              // endpoints check configs related to a service
	CreationTime    CreationTime `json:"-"`              // creation time of service
}

Config is a generic container for configuration files

func (*Config) AddMetrics

func (c *Config) AddMetrics(metrics Data) error

AddMetrics adds metrics to a check configuration

func (*Config) Digest

func (c *Config) Digest() string

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) Equal

func (c *Config) Equal(cfg *Config) bool

Equal determines whether the passed config is the same

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) IsTemplate

func (c *Config) IsTemplate() bool

IsTemplate returns if the config has AD identifiers

func (*Config) String

func (c *Config) String() string

String YAML representation of the config

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

func (c *Data) GetNameForInstance() string

GetNameForInstance returns the name from an instance if specified, fallback on namespace

func (*Data) MergeAdditionalTags

func (c *Data) MergeAdditionalTags(tags []string) error

MergeAdditionalTags merges additional tags to possible existing config tags

func (*Data) SetField

func (c *Data) SetField(key string, value interface{}) error

SetField allows to set an arbitrary field to a given value, overriding the existing value if present

type JSONMap

type JSONMap map[string]interface{}

JSONMap is the generic type to hold JSON configurations

type RawMap

type RawMap map[interface{}]interface{}

RawMap is the generic type to hold YAML configurations

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL