Documentation ¶
Index ¶
- Constants
- func SetAgentMetadata(name string, value interface{})
- func SetCheckMetadata(checkID, key string, value interface{})
- func StartMetadataUpdatedGoroutine(sc schedulerInterface, minSendInterval time.Duration) error
- type AgentMetadata
- type AutoConfigInterface
- type CheckInstanceMetadata
- type CheckMetadata
- type CollectorInterface
- type Payload
Constants ¶
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 ¶
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 ¶
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) MarshalJSON ¶
MarshalJSON serialization a Payload to JSON