env

package
v0.0.0-...-23465b2 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectFeatures

func DetectFeatures(cfg conf.ConfigReader)

DetectFeatures runs the feature detection. We guarantee that Datadog configuration is entirely loaded (env + YAML) before this function is called

func GetEnvDefault

func GetEnvDefault(key, def string) string

GetEnvDefault retrieves a value from the environment named by the key or return def if not set.

func IsAnyContainerFeaturePresent

func IsAnyContainerFeaturePresent() bool

IsAnyContainerFeaturePresent checks if any of known container features is present

func IsAutoconfigEnabled

func IsAutoconfigEnabled(cfg conf.ConfigReader) bool

IsAutoconfigEnabled returns if autoconfig from environment is activated or not

func IsContainerized

func IsContainerized() bool

IsContainerized returns whether the Agent is running on a Docker container DOCKER_DD_AGENT is set in our official Dockerfile

func IsDockerRuntime

func IsDockerRuntime() bool

IsDockerRuntime returns true if we are to find the /.dockerenv file which is typically only set by Docker

func IsECS

func IsECS() bool

func IsECSFargate

func IsECSFargate() bool

IsECSFargate returns whether the Agent is running in ECS Fargate

func IsFeaturePresent

func IsFeaturePresent(feature Feature) bool

IsFeaturePresent returns if a particular feature is activated

func IsHostProcAvailable

func IsHostProcAvailable() bool

IsHostProcAvailable returns whether host proc is available or not

func IsHostSysAvailable

func IsHostSysAvailable() bool

IsHostSysAvailable returns whether host proc is available or not

func IsKubernetes

func IsKubernetes() bool

IsKubernetes returns whether the Agent is running on a kubernetes cluster

func IsServerless

func IsServerless() bool

IsServerless returns whether the Agent is running in a Lambda function

Types

type Feature

type Feature string

Feature represents a feature of current environment

const (
	// Docker socket present
	Docker Feature = "docker"
	// Containerd socket present
	Containerd Feature = "containerd"
	// Cri is any cri socket present
	Cri Feature = "cri"
	// Kubernetes environment
	Kubernetes Feature = "kubernetes"
	// ECSEC2 environment
	ECSEC2 Feature = "ecsec2"
	// ECSFargate environment
	ECSFargate Feature = "ecsfargate"
	// EKSFargate environment
	EKSFargate Feature = "eksfargate"
	// KubeOrchestratorExplorer can be enabled
	KubeOrchestratorExplorer Feature = "orchestratorexplorer"
	// CloudFoundry socket present
	CloudFoundry Feature = "cloudfoundry"
	// Podman containers storage path accessible
	Podman Feature = "podman"
)

Remember to also register feature in init()

type FeatureMap

type FeatureMap map[Feature]struct{}

FeatureMap represents all detected features

func GetDetectedFeatures

func GetDetectedFeatures() FeatureMap

GetDetectedFeatures returns all detected features (detection only performed once)

func (FeatureMap) String

func (fm FeatureMap) String() string

Jump to

Keyboard shortcuts

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