inventories

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CloudProviderMetatadaName is the field name to use to set the cloud
	// provider name in the agent metadata.
	CloudProviderMetatadaName = "cloud_provider"
)

Variables

This section is empty.

Functions

func SetAgentMetadata

func SetAgentMetadata(name string, value interface{})

SetAgentMetadata updates the agent metadata value in the cache

func SetCheckMetadata

func SetCheckMetadata(checkID, key string, value interface{})

SetCheckMetadata updates a metadata value for one check instance in the cache.

func StartMetadataUpdatedGoroutine

func StartMetadataUpdatedGoroutine(sc schedulerInterface, minSendInterval time.Duration) error

StartMetadataUpdatedGoroutine starts a routine that listens to the metadataUpdatedC signal to run the collector out of its regular interval.

Types

type AgentMetadata

type AgentMetadata map[string]interface{}

AgentMetadata contains metadata provided by the agent itself

type AutoConfigInterface

type AutoConfigInterface interface {
	GetLoadedConfigs() map[string]integration.Config
}

AutoConfigInterface is an interface for the GetLoadedConfigs method of autodiscovery

type CheckInstanceMetadata

type CheckInstanceMetadata map[string]interface{}

CheckInstanceMetadata contains metadata provided by an instance of an integration.

type CheckMetadata

type CheckMetadata map[string][]*CheckInstanceMetadata

CheckMetadata contains metadata provided by all integrations. Each check has an entry in the top level map, each containing an array with all its instances, each containing its metadata.

type CollectorInterface

type CollectorInterface interface {
	GetAllInstanceIDs(checkName string) []check.ID
}

CollectorInterface is an interface for the GetAllInstanceIDs method of the collector

type Payload

type Payload struct {
	Hostname      string         `json:"hostname"`
	Timestamp     int64          `json:"timestamp"`
	CheckMetadata *CheckMetadata `json:"check_metadata"`
	AgentMetadata *AgentMetadata `json:"agent_metadata"`
}

Payload handles the JSON unmarshalling of the metadata payload

func CreatePayload

func CreatePayload(hostname string, ac AutoConfigInterface, coll CollectorInterface) *Payload

CreatePayload fills and returns the inventory metadata payload

func GetPayload

func GetPayload(hostname string, ac AutoConfigInterface, coll CollectorInterface) *Payload

GetPayload returns a new inventory metadata payload and updates lastGetPayload

func (*Payload) Marshal

func (p *Payload) Marshal() ([]byte, error)

Marshal not implemented

func (*Payload) MarshalJSON

func (p *Payload) MarshalJSON() ([]byte, error)

MarshalJSON serialization a Payload to JSON

func (*Payload) SplitPayload

func (p *Payload) SplitPayload(times int) ([]marshaler.Marshaler, error)

SplitPayload breaks the payload into times number of pieces

Jump to

Keyboard shortcuts

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