metadata

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AttributeDatadogHostname the datadog host name attribute
	AttributeDatadogHostname = "datadog.host.name"
	// AttributeK8sNodeName the datadog k8s node name attribute
	AttributeK8sNodeName = "k8s.node.name"
)

Variables

This section is empty.

Functions

func GetHost

func GetHost(logger *zap.Logger, cfg *config.Config) string

GetHost gets the hostname according to configuration. It checks in the following order 1. Configuration 2. Cache 3. EC2 instance metadata 4. System

func HostnameFromAttributes

func HostnameFromAttributes(attrs pdata.AttributeMap) (string, bool)

HostnameFromAttributes tries to get a valid hostname from attributes by checking, in order:

  1. a custom Datadog hostname provided by the "datadog.host.name" attribute

  2. the Kubernetes node name (and cluster name if available),

  3. cloud provider specific hostname for AWS or GCP

  4. the container ID,

  5. the cloud provider host ID and

  6. the host.name attribute.

    It returns a boolean value indicated if any name was found

func Pusher

Pusher pushes host metadata payloads periodically to Datadog intake

Types

type HostMetadata

type HostMetadata struct {
	// Meta includes metadata about the host.
	Meta *Meta `json:"meta"`

	// InternalHostname is the canonical hostname
	InternalHostname string `json:"internalHostname"`

	// Version is the OpenTelemetry Collector version.
	// This is used for correctly identifying the Collector in the backend,
	// and for telemetry purposes.
	Version string `json:"otel_version"`

	// Flavor is always set to "opentelemetry-collector".
	// It is used for telemetry purposes in the backend.
	Flavor string `json:"agent-flavor"`

	// Tags includes the host tags
	Tags *HostTags `json:"host-tags"`
}

HostMetadata includes metadata about the host tags, host aliases and identifies the host as an OpenTelemetry host

type HostTags

type HostTags struct {
	// OTel are host tags set in the configuration
	OTel []string `json:"otel,omitempty"`

	// GCP are Google Cloud Platform tags
	GCP []string `json:"google cloud platform,omitempty"`
}

HostTags are the host tags. Currently only system (configuration) tags are considered.

type Meta

type Meta struct {
	// InstanceID is the EC2 instance id the Collector is running on, if available
	InstanceID string `json:"instance-id,omitempty"`

	// EC2Hostname is the hostname from the EC2 metadata API
	EC2Hostname string `json:"ec2-hostname,omitempty"`

	// Hostname is the canonical hostname
	Hostname string `json:"hostname"`

	// SocketHostname is the OS hostname
	SocketHostname string `json:"socket-hostname,omitempty"`

	// SocketFqdn is the FQDN hostname
	SocketFqdn string `json:"socket-fqdn,omitempty"`

	// HostAliases are other available host names
	HostAliases []string `json:"host-aliases,omitempty"`
}

Meta includes metadata about the host aliases

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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