Documentation ¶
Index ¶
- func DetectFeatures(cfg conf.ConfigReader)
- func GetEnvDefault(key, def string) string
- func IsAnyContainerFeaturePresent() bool
- func IsAutoconfigEnabled(cfg conf.ConfigReader) bool
- func IsContainerized() bool
- func IsDockerRuntime() bool
- func IsECS() bool
- func IsECSFargate() bool
- func IsFeaturePresent(feature Feature) bool
- func IsHostProcAvailable() bool
- func IsHostSysAvailable() bool
- func IsKubernetes() bool
- func IsServerless() bool
- type Feature
- type FeatureMap
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 ¶
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 IsECSFargate ¶
func IsECSFargate() bool
IsECSFargate returns whether the Agent is running in ECS Fargate
func IsFeaturePresent ¶
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