Documentation ¶
Overview ¶
Package externalhost implements the External Host Tags metadata provider.
In older versions of the Agent, it was the general metadata collector to invoke a special method on the check instance to collect a list of tags attached to a specific hostname, add this tuple to the metadata payload and send upstream. At this moment the approach has changed from the Agent "pulling" from the check, to the check "pushing" to the Agent. See the RFC at docs/proposal/metadata/external-host-tags.md for more details.
The collector keeps a cache of hostnames mapped to a list of tags called `externalHostCache` and exports the function `AddExternalTags` so that entries can be added from other packages. This metadata provider is different from the others because it doesn't actually collect any info, it only sends whatever it finds stored in the cache. The cache is cleared at every collection.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetExternalTags ¶
SetExternalTags adds external tags for a specific host and source type to the cache.
Types ¶
type ExternalTags ¶
ExternalTags maps SOURCE_TYPE -> list of tags, exported to ease testing
type Payload ¶
type Payload []hostTags
Payload handles the JSON unmarshalling of the external host tags payload
func GetPayload ¶
func GetPayload() *Payload
GetPayload fills and return the external host tags metadata payload