Documentation ¶
Index ¶
- Variables
- func RegisterCollector(name string, metadataCollector Collector)
- func SetupInventories(sc *Scheduler, ac inventories.AutoConfigInterface, ...) error
- func SetupInventoriesExpvar(ac inventories.AutoConfigInterface, coll inventories.CollectorInterface)
- func SetupMetadataCollection(sch *Scheduler, additionalCollectors []string) error
- type Collector
- type CollectorWithInit
- type HostCollector
- type Payload
- type ResourcesCollector
- type Scheduler
Constants ¶
This section is empty.
Variables ¶
var ( // AllDefaultCollectors the names of all the available default collectors AllDefaultCollectors = []string{} )
Functions ¶
func RegisterCollector ¶
RegisterCollector adds a Metadata Collector to the catalog
func SetupInventories ¶
func SetupInventories(sc *Scheduler, ac inventories.AutoConfigInterface, coll inventories.CollectorInterface) error
SetupInventories registers the inventories collector into the Scheduler and, if configured, schedules it
func SetupInventoriesExpvar ¶
func SetupInventoriesExpvar(ac inventories.AutoConfigInterface, coll inventories.CollectorInterface)
SetupInventoriesExpvar init the expvar function for inventories
func SetupMetadataCollection ¶
SetupMetadataCollection initializes the metadata scheduler and its collectors based on the config. This function also starts the default collectors listed in 'additionalCollectors' if they're not listed in the configuration.
Types ¶
type Collector ¶
type Collector interface {
Send(s *serializer.Serializer) error
}
Collector is anything capable to collect and send metadata payloads through the forwarder. A Metadata Collector normally uses a Metadata Provider to fill the payload.
type CollectorWithInit ¶
type CollectorWithInit interface {
Init() error
}
CollectorWithInit is an optional interface that collectors that need to be initialized can implement. If implemented, the Init method will be called when the collector is scheduled
type HostCollector ¶
type HostCollector struct{}
HostCollector fills and sends the old metadata payload used in the Agent v5
func (*HostCollector) Send ¶
func (hp *HostCollector) Send(s *serializer.Serializer) error
Send collects the data needed and submits the payload
type Payload ¶
Payload is an interface shared by the output of the newer metadata providers. Right now this interface simply satisfies the Protobuf interface.
type ResourcesCollector ¶
type ResourcesCollector struct{}
ResourcesCollector sends the old metadata payload used in the Agent v5
func (*ResourcesCollector) Send ¶
func (rp *ResourcesCollector) Send(s *serializer.Serializer) error
Send collects the data needed and submits the payload
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler takes care of sending metadata at specific time intervals
func NewScheduler ¶
func NewScheduler(s *serializer.Serializer) *Scheduler
NewScheduler builds and returns a new Metadata Scheduler
func (*Scheduler) AddCollector ¶
AddCollector schedules a Metadata Collector at the given interval
func (*Scheduler) IsScheduled ¶
IsScheduled returns wether a given Collector has been added to this Scheduler
func (*Scheduler) TriggerAndResetCollectorTimer ¶
TriggerAndResetCollectorTimer runs a collector manually, on demand. The delay parameter can be set to 0 to run it immediately, or to a duration after which the collector will run. The runs at regular intervals of the collector will be resumed *after* this manual run. Calling TriggerAndResetCollectorTimer on a stopped Scheduler does nothing, since the goroutine that waits on the Timer will not be running.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package ecs provides functionalities to collect ECS metadata
|
Package ecs provides functionalities to collect ECS metadata |
Package externalhost implements the External Host Tags metadata provider.
|
Package externalhost implements the External Host Tags metadata provider. |