package
0.9.0
Repository: https://github.com/datadog/datadog-agent.git
Documentation: pkg.go.dev

# README

package metadata

This package is responsible to provide metadata in the right form to be directly sent to the backend. Metadata collection is iterated during Agent execution at different time intervals for different use cases.

Providers

Single metadata providers are defined in the form of insulated sub packages exposing a public method like:

func GetPayload() *Payload

along with their specific Payload definition. Payload formats can be different, that's why metadata providers are not implemented as interfaces. These components should be loosely coupled with the rest of the Agent, this way they can be used as independent go packages in different projects and different environments.

Collectors

Collectors are used by the Agent and are supposed to be run periodically. They are responsible to invoke the relevant Provider, collect all the info needed, fill the appropriate payload and send it to the specific endpoint in the intake. Collectors are allowed to be strongly coupled to the rest of the Agent components because they're not supposed to be used elsewhere. Collectors can be user configurable, except for the host metadata collector that is always scheduled with a default interval.

Notice: For the time being, several providers collect a piece of information that is used in the v5 package to compose a single metadata payload compatible with the one from Agent v.5. This way we can send metadata through the current backend endpoints (see HostCollector and ResourcesCollector), waiting for the new ones to be deployed. At that point, all the subpackages will be required to define a payload with either the new Protobuf format or a custom JSON compatible with the v2 intake API.

# Packages

No description provided by the author
Package ecs provides functionalities to collect ECS metadata.
Package externalhost implements the External Host Tags metadata provider.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

NewScheduler builds and returns a new Metadata Scheduler.
RegisterCollector adds a Metadata Collector to the catalog.
SetupInventories registers the inventories collector into the Scheduler and, if configured, schedules it.
SetupInventoriesExpvar init the expvar function for inventories.
SetupMetadataCollection initializes the metadata scheduler and its collectors based on the config.

# Variables

AllDefaultCollectors the names of all the available default collectors.

# Structs

HostCollector fills and sends the old metadata payload used in the Agent v5.
ResourcesCollector sends the old metadata payload used in the Agent v5.
Scheduler takes care of sending metadata at specific time intervals.

# Interfaces

Collector is anything capable to collect and send metadata payloads through the forwarder.
CollectorWithInit is an optional interface that collectors that need to be initialized can implement.
Payload is an interface shared by the output of the newer metadata providers.