Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(error tracking): add core agent and error tracking standalone settings #1553

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion api/datadoghq/v2alpha1/datadogagent_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,20 @@ type APMFeatureConfig struct {
// Enabled Default: false
// +optional
SingleStepInstrumentation *SingleStepInstrumentation `json:"instrumentation,omitempty"`

// ErrorTrackingStandalone contains the configuration for the Error Tracking standalone feature.
// Feature is in beta.
// +optional
ErrorTrackingStandalone *ErrorTrackingStandalone `json:"errorTrackingStandalone,omitempty"`
}

// ErrorTrackingStandalone contains the configuration for the Error Tracking standalone feature.
// +k8s:openapi-gen=true
type ErrorTrackingStandalone struct {
// Enables Error Tracking for backend services.
// Default: disabled
// +optional
Enabled *bool `json:"enabled,omitempty"`
}

// SingleStepInstrumentation contains the config for the namespaces to target and the library to inject.
Expand Down Expand Up @@ -1307,7 +1321,7 @@ type GlobalConfig struct {
// +listType=set
Tags []string `json:"tags,omitempty"`

//Env contains a list of environment variables that are set for all Agents.
// Env contains a list of environment variables that are set for all Agents.
// +optional
// +listType=map
// +listMapKey=name
Expand Down
25 changes: 25 additions & 0 deletions api/datadoghq/v2alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions api/datadoghq/v2alpha1/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions config/crd/bases/v1/datadoghq.com_datadogagents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,18 @@ spec:
Enabled enables Application Performance Monitoring.
Default: true
type: boolean
errorTrackingStandalone:
description: |-
ErrorTrackingStandalone contains the configuration for the Error Tracking standalone feature.
Feature is in beta.
properties:
enabled:
description: |-
Defines mode of operation of Error Tracking for backend services.
It can be "disabled", "standalone", or "full".
Default: disabled
type: boolean
type: object
hostPortConfig:
description: |-
HostPortConfig contains host port configuration.
Expand Down Expand Up @@ -7380,6 +7392,18 @@ spec:
Enabled enables Application Performance Monitoring.
Default: true
type: boolean
errorTrackingStandalone:
description: |-
ErrorTrackingStandalone contains the configuration for the Error Tracking standalone feature.
Feature is in beta.
properties:
enabled:
description: |-
Defines mode of operation of Error Tracking for backend services.
It can be "disabled", "standalone", or "full".
Default: disabled
type: boolean
type: object
hostPortConfig:
description: |-
HostPortConfig contains host port configuration.
Expand Down
22 changes: 22 additions & 0 deletions config/crd/bases/v1/datadoghq.com_datadogagents_v2alpha1.json
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,17 @@
"description": "Enabled enables Application Performance Monitoring.\nDefault: true",
"type": "boolean"
},
"errorTrackingStandalone": {
"additionalProperties": false,
"description": "ErrorTrackingStandalone contains the configuration for the Error Tracking standalone feature.\nFeature is in beta.",
"properties": {
"enabled": {
"description": "Defines mode of operation of Error Tracking for backend services.\nIt can be \"disabled\", \"standalone\", or \"full\".\nDefault: disabled",
"type": "boolean"
}
},
"type": "object"
},
"hostPortConfig": {
"additionalProperties": false,
"description": "HostPortConfig contains host port configuration.\nEnabled Default: false\nPort Default: 8126",
Expand Down Expand Up @@ -7326,6 +7337,17 @@
"description": "Enabled enables Application Performance Monitoring.\nDefault: true",
"type": "boolean"
},
"errorTrackingStandalone": {
"additionalProperties": false,
"description": "ErrorTrackingStandalone contains the configuration for the Error Tracking standalone feature.\nFeature is in beta.",
"properties": {
"enabled": {
"description": "Defines mode of operation of Error Tracking for backend services.\nIt can be \"disabled\", \"standalone\", or \"full\".\nDefault: disabled",
"type": "boolean"
}
},
"type": "object"
},
"hostPortConfig": {
"additionalProperties": false,
"description": "HostPortConfig contains host port configuration.\nEnabled Default: false\nPort Default: 8126",
Expand Down
1 change: 1 addition & 0 deletions docs/configuration.v2alpha1.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ spec:
| features.admissionController.validation.enabled | Enables the Admission Controller validation webhook. Default: true |
| features.admissionController.webhookName | WebhookName is a custom name for the MutatingWebhookConfiguration. Default: "datadog-webhook" |
| features.apm.enabled | Enables Application Performance Monitoring. Default: true |
| features.apm.errorTrackingStandalone.enabled | Defines mode of operation of Error Tracking for backend services. It can be "disabled", "standalone", or "full". Default: disabled |
| features.apm.hostPortConfig.enabled | Enables host port configuration |
| features.apm.hostPortConfig.hostPort | Port takes a port number (0 < x < 65536) to expose on the host. (Most containers do not need this.) If HostNetwork is enabled, this value must match the ContainerPort. |
| features.apm.instrumentation.disabledNamespaces | DisabledNamespaces disables injecting the Datadog APM libraries into pods in specific namespaces. |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: datadoghq.com/v2alpha1
kind: DatadogAgent
metadata:
name: datadog
spec:
features:
apm:
enabled: true
errorTrackingStandalone:
enabled: true
global:
env:
- name: DD_ENABLE_PAYLOADS_EVENTS
value: "false"
- name: DD_ENABLE_PAYLOADS_SERIES
value: "false"
- name: DD_ENABLE_PAYLOADS_SERVICE_CHECKS
value: "false"
- name: DD_ENABLE_PAYLOADS_SKETCHES
value: "false"
clusterName: local-k8s
credentials:
apiKey: <DATADOG_API_KEY>
appKey: <DATADOG_APP_KEY>
kubelet:
tlsVerify: false
39 changes: 20 additions & 19 deletions internal/controller/datadogagent/common/envvar.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,26 @@
package common

const (
DDAPMEnabled = "DD_APM_ENABLED"
DDAPMInstrumentationInstallTime = "DD_INSTRUMENTATION_INSTALL_TIME"
DDAPMInstrumentationInstallId = "DD_INSTRUMENTATION_INSTALL_ID"
DDAPMInstrumentationInstallType = "DD_INSTRUMENTATION_INSTALL_TYPE"
DDClusterAgentEnabled = "DD_CLUSTER_AGENT_ENABLED"
DDClusterAgentKubeServiceName = "DD_CLUSTER_AGENT_KUBERNETES_SERVICE_NAME"
DDClusterAgentTokenName = "DD_CLUSTER_AGENT_TOKEN_NAME"
DDContainerCollectionEnabled = "DD_PROCESS_CONFIG_CONTAINER_COLLECTION_ENABLED"
DDDogstatsdEnabled = "DD_USE_DOGSTATSD"
DDHealthPort = "DD_HEALTH_PORT"
DDHostRootEnvVar = "HOST_ROOT"
DDKubeletHost = "DD_KUBERNETES_KUBELET_HOST"
DDLeaderElection = "DD_LEADER_ELECTION"
DDLogsEnabled = "DD_LOGS_ENABLED"
DDProcessCollectionEnabled = "DD_PROCESS_CONFIG_PROCESS_COLLECTION_ENABLED"
DDProcessConfigRunInCoreAgent = "DD_PROCESS_CONFIG_RUN_IN_CORE_AGENT_ENABLED"
DDSystemProbeEnabled = "DD_SYSTEM_PROBE_ENABLED"
DDSystemProbeExternal = "DD_SYSTEM_PROBE_EXTERNAL"
DDSystemProbeSocket = "DD_SYSPROBE_SOCKET"
DDAPMEnabled = "DD_APM_ENABLED"
DDAPMInstrumentationInstallTime = "DD_INSTRUMENTATION_INSTALL_TIME"
DDAPMInstrumentationInstallId = "DD_INSTRUMENTATION_INSTALL_ID"
DDAPMInstrumentationInstallType = "DD_INSTRUMENTATION_INSTALL_TYPE"
DDAPMErrorTrackingStandaloneEnabled = "DD_APM_ERROR_TRACKING_STANDALONE_ENABLED"
DDClusterAgentEnabled = "DD_CLUSTER_AGENT_ENABLED"
DDClusterAgentKubeServiceName = "DD_CLUSTER_AGENT_KUBERNETES_SERVICE_NAME"
DDClusterAgentTokenName = "DD_CLUSTER_AGENT_TOKEN_NAME"
DDContainerCollectionEnabled = "DD_PROCESS_CONFIG_CONTAINER_COLLECTION_ENABLED"
DDDogstatsdEnabled = "DD_USE_DOGSTATSD"
DDHealthPort = "DD_HEALTH_PORT"
DDHostRootEnvVar = "HOST_ROOT"
DDKubeletHost = "DD_KUBERNETES_KUBELET_HOST"
DDLeaderElection = "DD_LEADER_ELECTION"
DDLogsEnabled = "DD_LOGS_ENABLED"
DDProcessCollectionEnabled = "DD_PROCESS_CONFIG_PROCESS_COLLECTION_ENABLED"
DDProcessConfigRunInCoreAgent = "DD_PROCESS_CONFIG_RUN_IN_CORE_AGENT_ENABLED"
DDSystemProbeEnabled = "DD_SYSTEM_PROBE_ENABLED"
DDSystemProbeExternal = "DD_SYSTEM_PROBE_EXTERNAL"
DDSystemProbeSocket = "DD_SYSPROBE_SOCKET"

// KubernetesEnvvarName Env var used by the Datadog Agent container entrypoint
// to add kubelet config provider and listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ func defaultEnvVars(dda metav1.Object) []corev1.EnvVar {
},
},
},
{
Name: common.DDAPMErrorTrackingStandaloneEnabled,
Value: "false",
},
}

return envVars
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const (
defaultCWSSyscallMonitorEnabled bool = false
defaultCWSNetworkEnabled bool = true
defaultCWSSecurityProfilesEnabled bool = true
defaultAPMErrorTrackingStandalone bool = false

defaultNPMEnabled bool = false
defaultNPMEnableConntrack bool = true
Expand Down Expand Up @@ -322,6 +323,12 @@ func defaultFeaturesConfig(ddaSpec *v2alpha1.DatadogAgentSpec) {

apiutils.DefaultBooleanIfUnset(&ddaSpec.Features.APM.SingleStepInstrumentation.Enabled, defaultAPMSingleStepInstrEnabled)
apiutils.DefaultBooleanIfUnset(&ddaSpec.Features.APM.SingleStepInstrumentation.LanguageDetection.Enabled, defaultLanguageDetectionEnabled)

if ddaSpec.Features.APM.ErrorTrackingStandalone == nil {
ddaSpec.Features.APM.ErrorTrackingStandalone = &v2alpha1.ErrorTrackingStandalone{}
}

apiutils.DefaultBooleanIfUnset(&ddaSpec.Features.APM.ErrorTrackingStandalone.Enabled, defaultAPMErrorTrackingStandalone)
}

// ASM Features
Expand Down
Loading
Loading