externalhost

package
v0.0.0-...-8ccce41 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

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

func SetExternalTags(hostname, sourceType string, tags []string)

SetExternalTags adds external tags for a specific host and source type to the cache.

Types

type ExternalTags

type ExternalTags map[string][]string

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

Jump to

Keyboard shortcuts

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