Documentation
¶
Overview ¶
Package common defines the Setup structure that allows setup scripts to define packages and configurations to install.
Index ¶
Constants ¶
const ( // DatadogAgentPackage is the datadog agent package DatadogAgentPackage string = "datadog-agent" // DatadogAgentDDOTPackage is the datadog agent ddot package DatadogAgentDDOTPackage string = "datadog-ddot" // 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 ¶
var ( // ApmLibraries is a list of all the apm libraries ApmLibraries = []string{ DatadogAPMLibraryJavaPackage, DatadogAPMLibraryPythonPackage, DatadogAPMLibraryRubyPackage, DatadogAPMLibraryJSPackage, DatadogAPMLibraryDotNetPackage, DatadogAPMLibraryPHPPackage, } )
var ExecuteCommandWithTimeout = func(s *Setup, command string, args ...string) (output []byte, err error) { span, _ := telemetry.StartSpanFromContext(s.Ctx, "setup.command") span.SetResourceName(command) defer func() { span.Finish(err) }() ctx, cancel := context.WithTimeout(context.Background(), commandTimeoutDuration) defer cancel() cmd := exec.CommandContext(ctx, command, args...) output, err = cmd.Output() if output != nil { span.SetTag("command_output", string(output)) } if err != nil { span.SetTag("command_error", err.Error()) span.Finish(err) return nil, err } return output, nil }
ExecuteCommandWithTimeout executes a bash command with args and times out if the command has not finished
Functions ¶
Types ¶
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 ¶
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) WriteSSIInstaller ¶ added in v0.68.0
func (p *Packages) WriteSSIInstaller()
WriteSSIInstaller marks that the installer should be copied to /opt/datadog-packages/run/datadog-installer-ssi Use this when installing SSI without the agent, so that the installer can be used later to remove the packages.
type Setup ¶
type Setup struct {
Out *Output
Env *env.Env
Ctx context.Context
Span *telemetry.Span
Packages Packages
Config config.Config
DdAgentAdditionalGroups []string
DelayedAgentRestartConfig config.DelayedAgentRestartConfig
NoConfig bool
// contains filtered or unexported fields
}
Setup allows setup scripts to define packages and configurations to install.