Documentation ¶
Index ¶
- func GetLastPayload() ([]byte, error)
- func InitializeData()
- func SetAgentMetadata(name AgentMetadataName, value interface{})
- func SetCheckMetadata(checkID, key string, value interface{})
- func StartMetadataUpdatedGoroutine(sc schedulerInterface, minSendInterval time.Duration) error
- type AgentMetadata
- type AgentMetadataName
- type AutoConfigInterface
- type CheckInstanceMetadata
- type CheckMetadata
- type CollectorInterface
- type Payload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLastPayload ¶
GetLastPayload returns the last payload created by the inventories metadata collector as JSON.
func InitializeData ¶
func InitializeData()
InitializeData inits the inventories payload with basic and static information (agent version, flavor name, ...)
func SetAgentMetadata ¶
func SetAgentMetadata(name AgentMetadataName, 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 AgentMetadataName ¶
type AgentMetadataName string
AgentMetadataName is an enum type containing all defined keys for SetAgentMetadata.
const ( AgentCloudProvider AgentMetadataName = "cloud_provider" AgentHostnameSource AgentMetadataName = "hostname_source" AgentVersion AgentMetadataName = "agent_version" AgentFlavor AgentMetadataName = "flavor" AgentConfigAPMDDURL AgentMetadataName = "config_apm_dd_url" AgentConfigDDURL AgentMetadataName = "config_dd_url" AgentConfigSite AgentMetadataName = "config_site" AgentConfigLogsDDURL AgentMetadataName = "config_logs_dd_url" AgentConfigLogsSocks5ProxyAddress AgentMetadataName = "config_logs_socks5_proxy_address" AgentConfigNoProxy AgentMetadataName = "config_no_proxy" AgentConfigProcessDDURL AgentMetadataName = "config_process_dd_url" AgentConfigProxyHTTP AgentMetadataName = "config_proxy_http" AgentConfigProxyHTTPS AgentMetadataName = "config_proxy_https" AgentInstallMethodInstallerVersion AgentMetadataName = "install_method_installer_version" AgentInstallMethodTool AgentMetadataName = "install_method_tool" AgentInstallMethodToolVersion AgentMetadataName = "install_method_tool_version" AgentLogsTransport AgentMetadataName = "logs_transport" AgentCWSEnabled AgentMetadataName = "feature_cws_enabled" AgentProcessEnabled AgentMetadataName = "feature_process_enabled" AgentNetworksEnabled AgentMetadataName = "feature_networks_enabled" AgentLogsEnabled AgentMetadataName = "feature_logs_enabled" AgentCSPMEnabled AgentMetadataName = "feature_cspm_enabled" AgentAPMEnabled AgentMetadataName = "feature_apm_enabled" )
Constants for the metadata names; these are defined in pkg/metadata/inventories/README.md and any additions should be updated there as well.
type AutoConfigInterface ¶
type AutoConfigInterface interface {
MapOverLoadedConfigs(func(map[string]integration.Config))
}
AutoConfigInterface is an interface for the MapOverLoadedConfigs 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(ctx context.Context, hostname string, ac AutoConfigInterface, coll CollectorInterface) *Payload
CreatePayload fills and returns the inventory metadata payload
func GetPayload ¶
func GetPayload(ctx context.Context, 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
func (*Payload) MarshalSplitCompress ¶
func (p *Payload) MarshalSplitCompress(bufferContext *marshaler.BufferContext) ([]*[]byte, error)
MarshalSplitCompress not implemented
func (*Payload) SplitPayload ¶
func (p *Payload) SplitPayload(times int) ([]marshaler.AbstractMarshaler, error)
SplitPayload breaks the payload into times number of pieces