config

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultSite is the default site of the Datadog intake to send data to
	DefaultSite = "datadoghq.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIConfig

type APIConfig struct {
	// Key is the Datadog API key to associate your Agent's data with your organization.
	// Create a new API key here: https://app.datadoghq.com/account/settings
	Key string `mapstructure:"key"`

	// Site is the site of the Datadog intake to send data to.
	// The default value is "datadoghq.com".
	Site string `mapstructure:"site"`
}

APIConfig defines the API configuration options

func (*APIConfig) GetCensoredKey

func (api *APIConfig) GetCensoredKey() string

GetCensoredKey returns the API key censored for logging purposes

type Config

type Config struct {
	configmodels.ExporterSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.

	TagsConfig `mapstructure:",squash"`

	// API defines the Datadog API configuration.
	API APIConfig `mapstructure:"api"`

	// Metrics defines the Metrics exporter specific configuration
	Metrics MetricsConfig `mapstructure:"metrics"`

	// Traces defines the Traces exporter specific configuration
	Traces TracesConfig `mapstructure:"traces"`

	// SendMetadata defines whether to send host metadata
	SendMetadata bool `mapstructure:"send_metadata"`
	// contains filtered or unexported fields
}

Config defines configuration for the Datadog exporter.

func (*Config) OnceMetadata

func (c *Config) OnceMetadata() *sync.Once

func (*Config) Sanitize

func (c *Config) Sanitize() error

Sanitize tries to sanitize a given configuration

type MetricsConfig

type MetricsConfig struct {
	// Buckets states whether to report buckets from distribution metrics
	Buckets bool `mapstructure:"report_buckets"`

	// TCPAddr.Endpoint is the host of the Datadog intake server to send metrics to.
	// If unset, the value is obtained from the Site.
	confignet.TCPAddr `mapstructure:",squash"`
}

MetricsConfig defines the metrics exporter specific configuration options

type TagsConfig

type TagsConfig struct {
	// Hostname is the host name for unified service tagging.
	// If unset, it is determined automatically.
	// See https://docs.datadoghq.com/agent/faq/how-datadog-agent-determines-the-hostname
	// for more details.
	Hostname string `mapstructure:"hostname"`

	// Env is the environment for unified service tagging.
	Env string `mapstructure:"env"`

	// Service is the service for unified service tagging.
	Service string `mapstructure:"service"`

	// Version is the version for unified service tagging.
	Version string `mapstructure:"version"`

	// Tags is the list of default tags to add to every metric or trace.
	Tags []string `mapstructure:"tags"`
}

TagsConfig defines the tag-related configuration It is embedded in the configuration

func (*TagsConfig) GetHostTags

func (t *TagsConfig) GetHostTags() []string

GetHostTags gets the host tags extracted from the configuration

type TracesConfig

type TracesConfig struct {
	// TCPAddr.Endpoint is the host of the Datadog intake server to send traces to.
	// If unset, the value is obtained from the Site.
	confignet.TCPAddr `mapstructure:",squash"`

	// SampleRate is the rate at which to sample this event. Default is 1,
	// meaning no sampling. If you want to send one event out of every 250
	// times Send() is called, you would specify 250 here.
	SampleRate uint `mapstructure:"sample_rate"`
}

TracesConfig defines the traces exporter specific configuration options

Jump to

Keyboard shortcuts

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