common

package
v0.0.0-...-7f64411 Latest Latest
Warning

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

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

Documentation

Overview

Package common defines the Setup structure that allows setup scripts to define packages and configurations to install.

Index

Constants

View Source
const (
	// DatadogInstallerPackage is the datadog installer package
	DatadogInstallerPackage string = "datadog-installer"
	// DatadogAgentPackage is the datadog agent package
	DatadogAgentPackage string = "datadog-agent"
	// DatadogAPMInjectPackage is the datadog apm inject package
	DatadogAPMInjectPackage string = "datadog-apm-inject"
	// DatadogAPMLibraryJavaPackage is the datadog apm library java package
	DatadogAPMLibraryJavaPackage string = "datadog-apm-library-java"
	// DatadogAPMLibraryPythonPackage is the datadog apm library python package
	DatadogAPMLibraryPythonPackage string = "datadog-apm-library-python"
	// DatadogAPMLibraryRubyPackage is the datadog apm library ruby package
	DatadogAPMLibraryRubyPackage string = "datadog-apm-library-ruby"
	// DatadogAPMLibraryJSPackage is the datadog apm library js package
	DatadogAPMLibraryJSPackage string = "datadog-apm-library-js"
	// DatadogAPMLibraryDotNetPackage is the datadog apm library dotnet package
	DatadogAPMLibraryDotNetPackage string = "datadog-apm-library-dotnet"
	// DatadogAPMLibraryPHPPackage is the datadog apm library php package
	DatadogAPMLibraryPHPPackage string = "datadog-apm-library-php"
)

Variables

View Source
var (
	// ErrNoAPIKey is returned when no API key is provided.
	ErrNoAPIKey = errors.New("no API key provided")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// DatadogYAML is the content of the datadog.yaml file
	DatadogYAML DatadogConfig
	// InjectTracerYAML is the content of the inject/tracer.yaml file
	InjectTracerYAML InjectTracerConfig
	// IntegrationConfigs is the content of the integration configuration files under conf.d/
	IntegrationConfigs map[string]IntegrationConfig
}

Config represents the configuration to write in /etc/datadog-agent

type DatadogConfig

type DatadogConfig struct {
	APIKey               string                     `yaml:"api_key"`
	Hostname             string                     `yaml:"hostname,omitempty"`
	Site                 string                     `yaml:"site,omitempty"`
	Proxy                DatadogConfigProxy         `yaml:"proxy,omitempty"`
	Env                  string                     `yaml:"env,omitempty"`
	Tags                 []string                   `yaml:"tags,omitempty"`
	LogsEnabled          bool                       `yaml:"logs_enabled,omitempty"`
	DJM                  DatadogConfigDJM           `yaml:"djm,omitempty"`
	ProcessConfig        DatadogConfigProcessConfig `yaml:"process_config,omitempty"`
	ExpectedTagsDuration string                     `yaml:"expected_tags_duration,omitempty"`
}

DatadogConfig represents the configuration to write in /etc/datadog-agent/datadog.yaml

type DatadogConfigDJM

type DatadogConfigDJM struct {
	Enabled bool `yaml:"enabled,omitempty"`
}

DatadogConfigDJM represents the configuration for the Data Jobs Monitoring

type DatadogConfigProcessConfig

type DatadogConfigProcessConfig struct {
	ExpvarPort int `yaml:"expvar_port,omitempty"`
}

DatadogConfigProcessConfig represents the configuration for the process agent

type DatadogConfigProxy

type DatadogConfigProxy struct {
	HTTP    string   `yaml:"http,omitempty"`
	HTTPS   string   `yaml:"https,omitempty"`
	NoProxy []string `yaml:"no_proxy,omitempty"`
}

DatadogConfigProxy represents the configuration for the proxy

type InjectTracerConfig

type InjectTracerConfig struct {
	Version                        int                        `yaml:"version,omitempty"`
	ConfigSources                  string                     `yaml:"config_sources,omitempty"`
	AdditionalEnvironmentVariables []InjectTracerConfigEnvVar `yaml:"additional_environment_variables,omitempty"`
}

InjectTracerConfig represents the configuration to write in /etc/datadog-agent/inject/tracer.yaml

type InjectTracerConfigEnvVar

type InjectTracerConfigEnvVar struct {
	Key   string `yaml:"key"`
	Value string `yaml:"value"`
}

InjectTracerConfigEnvVar represents an environment variable to inject

type IntegrationConfig

type IntegrationConfig struct {
	InitConfig []any                   `yaml:"init_config"`
	Instances  []any                   `yaml:"instances,omitempty"`
	Logs       []IntegrationConfigLogs `yaml:"logs,omitempty"`
}

IntegrationConfig represents the configuration for an integration under conf.d/

type IntegrationConfigInstanceSpark

type IntegrationConfigInstanceSpark struct {
	SparkURL         string `yaml:"spark_url"`
	SparkClusterMode string `yaml:"spark_cluster_mode"`
	ClusterName      string `yaml:"cluster_name"`
	StreamingMetrics bool   `yaml:"streaming_metrics"`
}

IntegrationConfigInstanceSpark represents the configuration for the Spark integration

type IntegrationConfigLogs

type IntegrationConfigLogs struct {
	Type    string `yaml:"type,omitempty"`
	Path    string `yaml:"path,omitempty"`
	Service string `yaml:"service,omitempty"`
	Source  string `yaml:"source,omitempty"`
}

IntegrationConfigLogs represents the configuration for the logs of an integration

type Output

type Output struct {
	// contains filtered or unexported fields
}

Output is a writer for the output. It will support some ANSI escape sequences to format the output.

func (*Output) WriteString

func (o *Output) WriteString(s string)

WriteString writes a string to the output.

type Packages

type Packages struct {
	// contains filtered or unexported fields
}

Packages is a list of packages to install

func (*Packages) Install

func (p *Packages) Install(pkg string, version string)

Install marks a package to be installed

type Setup

type Setup struct {
	Out      *Output
	Env      *env.Env
	Ctx      context.Context
	Span     *telemetry.Span
	Packages Packages
	Config   Config
	// contains filtered or unexported fields
}

Setup allows setup scripts to define packages and configurations to install.

func NewSetup

func NewSetup(ctx context.Context, env *env.Env, flavor string, flavorPath string, logOutput io.Writer) (*Setup, error)

NewSetup creates a new Setup structure with some default values.

func (*Setup) Run

func (s *Setup) Run() (err error)

Run installs the packages and writes the configurations

Jump to

Keyboard shortcuts

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