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

Merged
merged 17 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from 6 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
29 changes: 28 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 Error Tracking backends standalone.
// Feature is in beta.
// +optional
ErrorTrackingStandalone *ErrorTrackingStandalone `json:"errorTrackingStandalone,omitempty"`
}

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

// SingleStepInstrumentation contains the config for the namespaces to target and the library to inject.
Expand Down Expand Up @@ -1295,7 +1309,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 Expand Up @@ -1394,6 +1408,19 @@ type GlobalConfig struct {
// Default: 'false'
// +optional
RunProcessChecksInCoreAgent *bool `json:"runProcessChecksInCoreAgent,omitempty"`

// CoreAgent contains the settings for the core agent.
// +optional
CoreAgent *CoreAgent `json:"coreAgent,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This config doesn't really enabled/disable core agent. The value is just added as an env var to bunch of components.
What is this configuration for? How would customer determine whether to set it to true or false?

}

// CoreAgent contains the core agent configuration.
// +k8s:openapi-gen=true
type CoreAgent struct {
// Enabled enables the Core Agent.
// Default: true
// +optional
Enabled *bool `json:"enabled,omitempty"`
}

// DatadogCredentials is a generic structure that holds credentials to access Datadog.
Expand Down
2 changes: 2 additions & 0 deletions api/datadoghq/v2alpha1/envvar.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const (
DDAPMInstrumentationInstallTime = "DD_INSTRUMENTATION_INSTALL_TIME"
DDAPMInstrumentationInstallId = "DD_INSTRUMENTATION_INSTALL_ID"
DDAPMInstrumentationInstallType = "DD_INSTRUMENTATION_INSTALL_TYPE"
DDAPMErrorTrackingStandaloneEnabled = "DD_APM_ERROR_TRACKING_STANDALONE_ENABLED"
DDAuthTokenFilePath = "DD_AUTH_TOKEN_FILE_PATH"
DDChecksTagCardinality = "DD_CHECKS_TAG_CARDINALITY"
DDClcRunnerEnabled = "DD_CLC_RUNNER_ENABLED"
Expand Down Expand Up @@ -56,6 +57,7 @@ const (
DDPodName = "DD_POD_NAME"
DDProcessCollectionEnabled = "DD_PROCESS_CONFIG_PROCESS_COLLECTION_ENABLED"
DDProcessConfigRunInCoreAgent = "DD_PROCESS_CONFIG_RUN_IN_CORE_AGENT_ENABLED"
DDCoreAgentEnabled = "DD_CORE_AGENT_ENABLED"
DDSecretBackendCommand = "DD_SECRET_BACKEND_COMMAND"
DDSecretBackendArguments = "DD_SECRET_BACKEND_ARGUMENTS"
DDSecretBackendTimeout = "DD_SECRET_BACKEND_TIMEOUT"
Expand Down
50 changes: 50 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.

42 changes: 42 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.

31 changes: 31 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,17 @@ spec:
Enabled enables Application Performance Monitoring.
Default: true
type: boolean
errorTrackingStandalone:
description: |-
ErrorTrackingStandalone contains the configuration for Error Tracking backends standalone.
Feature is in beta.
properties:
enabled:
description: |-
Enabled enables Error Tracking backend standalone.
Default: false
type: boolean
type: object
hostPortConfig:
description: |-
HostPortConfig contains host port configuration.
Expand Down Expand Up @@ -1646,6 +1657,15 @@ spec:
ContainerStrategy determines whether agents run in a single or multiple containers.
Default: 'optimized'
type: string
coreAgent:
description: CoreAgent contains the settings for the core agent.
properties:
enabled:
description: |-
Enabled enables the Core Agent.
Default: true
type: boolean
type: object
credentials:
description: Credentials defines the Datadog credentials used to submit data to/query data from Datadog.
properties:
Expand Down Expand Up @@ -7371,6 +7391,17 @@ spec:
Enabled enables Application Performance Monitoring.
Default: true
type: boolean
errorTrackingStandalone:
description: |-
ErrorTrackingStandalone contains the configuration for Error Tracking backends standalone.
Feature is in beta.
properties:
enabled:
description: |-
Enabled enables Error Tracking backend standalone.
Default: false
type: boolean
type: object
hostPortConfig:
description: |-
HostPortConfig contains host port configuration.
Expand Down
33 changes: 33 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 Error Tracking backends standalone.\nFeature is in beta.",
"properties": {
"enabled": {
"description": "Enabled enables Error Tracking backend standalone.\nDefault: false",
"type": "boolean"
}
},
"type": "object"
},
"hostPortConfig": {
"additionalProperties": false,
"description": "HostPortConfig contains host port configuration.\nEnabled Default: false\nPort Default: 8126",
Expand Down Expand Up @@ -1737,6 +1748,17 @@
"description": "ContainerStrategy determines whether agents run in a single or multiple containers.\nDefault: 'optimized'",
"type": "string"
},
"coreAgent": {
"additionalProperties": false,
"description": "CoreAgent contains the settings for the core agent.",
"properties": {
"enabled": {
"description": "Enabled enables the Core Agent.\nDefault: true",
"type": "boolean"
}
},
"type": "object"
},
"credentials": {
"additionalProperties": false,
"description": "Credentials defines the Datadog credentials used to submit data to/query data from Datadog.",
Expand Down Expand Up @@ -7315,6 +7337,17 @@
"description": "Enabled enables Application Performance Monitoring.\nDefault: true",
"type": "boolean"
},
"errorTrackingStandalone": {
"additionalProperties": false,
"description": "ErrorTrackingStandalone contains the configuration for Error Tracking backends standalone.\nFeature is in beta.",
"properties": {
"enabled": {
"description": "Enabled enables Error Tracking backend standalone.\nDefault: false",
"type": "boolean"
}
},
"type": "object"
},
"hostPortConfig": {
"additionalProperties": false,
"description": "HostPortConfig contains host port configuration.\nEnabled Default: false\nPort Default: 8126",
Expand Down
2 changes: 2 additions & 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 | Enables Error Tracking backend standalone. Default: false |
| 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 Expand Up @@ -182,6 +183,7 @@ spec:
| global.clusterAgentTokenSecret.secretName | SecretName is the name of the secret. |
| global.clusterName | ClusterName sets a unique cluster name for the deployment to easily scope monitoring data in the Datadog app. |
| global.containerStrategy | ContainerStrategy determines whether agents run in a single or multiple containers. Default: 'optimized' |
| global.coreAgent.enabled | Enables the Core Agent. Default: true |
| global.credentials.apiKey | APIKey configures your Datadog API key. See also: https://app.datadoghq.com/account/settings#agent/kubernetes |
| global.credentials.apiSecret.keyName | KeyName is the key of the secret to use. |
| global.credentials.apiSecret.secretName | SecretName is the name of the secret. |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: datadoghq.com/v2alpha1
kind: DatadogAgent
metadata:
name: datadog
spec:
features:
apm:
enabled: true
errorTrackingStandalone:
enabled: true
global:
clusterName: local-k8s
credentials:
apiKey: <DATADOG_API_KEY>
appKey: <DATADOG_APP_KEY>
kubelet:
tlsVerify: false
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,14 @@
},
},
},
{
Name: apicommon.DDAPMErrorTrackingStandaloneEnabled,

Check failure on line 254 in internal/controller/datadogagent/component/clusterchecksrunner/default.go

View workflow job for this annotation

GitHub Actions / build

undefined: apicommon.DDAPMErrorTrackingStandaloneEnabled

Check failure on line 254 in internal/controller/datadogagent/component/clusterchecksrunner/default.go

View workflow job for this annotation

GitHub Actions / build

undefined: apicommon.DDAPMErrorTrackingStandaloneEnabled

Check failure on line 254 in internal/controller/datadogagent/component/clusterchecksrunner/default.go

View workflow job for this annotation

GitHub Actions / build

undefined: apicommon.DDAPMErrorTrackingStandaloneEnabled

Check failure on line 254 in internal/controller/datadogagent/component/clusterchecksrunner/default.go

View workflow job for this annotation

GitHub Actions / build

undefined: apicommon.DDAPMErrorTrackingStandaloneEnabled
Value: "false",
},
{
Name: apicommon.DDCoreAgentEnabled,

Check failure on line 258 in internal/controller/datadogagent/component/clusterchecksrunner/default.go

View workflow job for this annotation

GitHub Actions / build

undefined: apicommon.DDCoreAgentEnabled

Check failure on line 258 in internal/controller/datadogagent/component/clusterchecksrunner/default.go

View workflow job for this annotation

GitHub Actions / build

undefined: apicommon.DDCoreAgentEnabled
Value: "true",
},
}

return envVars
Expand Down
Loading
Loading