Skip to content

Commit 1ad328d

Browse files
authored
Remove unnecessary code from render_config (#45929)
### What does this PR do? - Migrate APM example to a static file: APM example doesn't contain any setting nor use any templating. There is no reason to use render_config for this. - Remove unused template: APM Injection was removed with #44358 but the template was never updated ### Describe how you validated your changes For the APM team: check that `application_monitoring.yaml.example` is still correctly shipped for linux. Co-authored-by: maxime.mouial <maxime.mouial@datadoghq.com>
1 parent 0958291 commit 1ad328d

5 files changed

Lines changed: 72 additions & 151 deletions

File tree

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@
509509
/pkg/config/ @DataDog/agent-configuration
510510
/pkg/config/config_template.yaml @DataDog/agent-configuration @DataDog/documentation
511511
/pkg/config/setup/apm.go @DataDog/agent-apm @DataDog/agent-configuration
512+
/pkg/config/example/application_monitoring.yaml.example @DataDog/agent-apm
512513
/pkg/config/autodiscovery/ @DataDog/container-integrations @DataDog/container-platform @DataDog/agent-configuration
513514
/pkg/config/env @DataDog/container-integrations @DataDog/container-platform @DataDog/agent-configuration
514515
/pkg/config/setup @DataDog/agent-configuration

omnibus/config/software/datadog-agent.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,7 @@
283283

284284
# APM Hands Off config file
285285
if linux_target?
286-
command "dda inv -- agent.generate-config --build-type application-monitoring --output-file ./bin/agent/dist/application_monitoring.yaml", :env => env
287-
move 'bin/agent/dist/application_monitoring.yaml', "#{conf_dir}/application_monitoring.yaml.example"
286+
copy 'pkg/config/example/application_monitoring.yaml.example', "#{conf_dir}/application_monitoring.yaml.example"
288287
end
289288

290289
# Allows the agent to be installed in a custom location

pkg/config/config_template.yaml

Lines changed: 0 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -4953,142 +4953,3 @@ api_key:
49534953
#
49544954
# verbosity: normal
49554955
{{ end -}}
4956-
{{- if .APMInjection -}}
4957-
##############################################
4958-
## Datadog APM Auto-injection Configuration ##
4959-
##############################################
4960-
4961-
## @param injection_controller_config - custom object
4962-
## This section configures the Datadog APM Auto Injection controller.
4963-
## Uncomment this parameter and the one below to enable them.
4964-
#
4965-
# injection_controller_config:
4966-
4967-
# # @param enabled - boolean - optional - default: false
4968-
# # Set to true to enable the APM Auto-injection.
4969-
# # Please note that enabling this service will result in a kernel driver being loaded.
4970-
#
4971-
# enabled: false
4972-
4973-
# # @param log_file - string - optional - default: c:\programdata\datadog\logs\apm-inject.log
4974-
# # The full path to the file where injection controller logs are written.
4975-
#
4976-
# log_file: c:\programdata\datadog\logs\apm-inject.log
4977-
4978-
# # @param log_level - string - optional - default: info
4979-
# # Minimum log level of the injection controller.
4980-
# # Valid log levels are: debug, info, warn, and error.
4981-
#
4982-
# log_level: 'info'
4983-
4984-
# # @param log_to_console - boolean - optional - default: true
4985-
# # Set to 'false' to disable injection controller logging to stdout.
4986-
#
4987-
# log_to_console: true
4988-
4989-
# # @param socket_port - integer - optional - default: 3030
4990-
# # The port used for the injection controller communications API (served on localhost).
4991-
#
4992-
# socket_port: 3030
4993-
4994-
# internal_profiling:
4995-
#
4996-
# # @param enabled - boolean - optional - default: false
4997-
# # Enable internal profiling for the injection controller process.
4998-
#
4999-
# enabled: false
5000-
5001-
## @param service_configs - list of custom objects
5002-
## This section configures the services which will be automatically injected with APM
5003-
## configurations, as well as the APM configurations which will be injected.
5004-
#
5005-
# service_configs:
5006-
5007-
# # @param service configuration - custom object
5008-
# # In order to configure APM auto-injection for a service or set of services, an injection condition
5009-
# # and APM configuration must be provided.
5010-
# #
5011-
# # Example:
5012-
# # - conditions:
5013-
# # command_line_regex: executable_name.exe
5014-
# # configuration:
5015-
# # service_language: dotnet
5016-
# # dd_env: staging
5017-
# # dd_service: exampleService
5018-
# # dd_version: 1.2.3
5019-
# #
5020-
# # To learn about all the available service matching conditions & configuration options, visit
5021-
# # https://docs.datadoghq.com/tracing/trace_collection/library_injection_local
5022-
{{ end -}}
5023-
{{- if .ApplicationMonitoring -}}
5024-
###############################
5025-
## Datadog APM Configuration ##
5026-
###############################
5027-
5028-
## @section APM Configuration Rules
5029-
##
5030-
## Enable and configure APM, profiling, and security monitoring features.
5031-
##
5032-
## Settings can be configured via environment variables or the application_monitoring.yaml file.
5033-
## Configuration precedence (highest to lowest priority):
5034-
## 1. Fleet-managed config file
5035-
## (etc/datadog-agent/managed/datadog-agent/stable/application_monitoring.yaml)
5036-
## 2. Environment variables
5037-
## 3. Local config file
5038-
## (etc/datadog-agent/application_monitoring.yaml)
5039-
# apm_configuration_default:
5040-
5041-
# # @param DD_APM_TRACING_ENABLED - boolean - optional - default: true
5042-
# # Enable Datadog tracing.
5043-
# # Docs: https://docs.datadoghq.com/tracing/trace_collection/
5044-
# DD_APM_TRACING_ENABLED: true
5045-
5046-
# # @param DD_RUNTIME_METRICS_ENABLED - boolean - optional - default: false
5047-
# # Enable runtime metrics.
5048-
# # Docs: https://docs.datadoghq.com/tracing/metrics/runtime_metrics/?tab=java#environment-variables
5049-
# DD_RUNTIME_METRICS_ENABLED: false
5050-
5051-
# # @param DD_LOGS_INJECTION - boolean - optional - default: false
5052-
# # Enable automatic trace and span ID injection into logs.
5053-
# # Docs: https://docs.datadoghq.com/tracing/other_telemetry/connect_logs_and_traces/
5054-
# DD_LOGS_INJECTION: false
5055-
5056-
# # @param DD_PROFILING_ENABLED - boolean - optional - default: false
5057-
# # Enable continuous profiling.
5058-
# # Docs: https://docs.datadoghq.com/profiler/
5059-
# DD_PROFILING_ENABLED: false
5060-
5061-
# # @param DD_DATA_STREAMS_ENABLED - boolean - optional - default: false
5062-
# # Enable data streams monitoring.
5063-
# # Docs: https://docs.datadoghq.com/data_streams/
5064-
# DD_DATA_STREAMS_ENABLED: false
5065-
5066-
# # @param DD_APPSEC_ENABLED - boolean - optional - default: false
5067-
# # Enable the Application Security product.
5068-
# # Docs: https://docs.datadoghq.com/security/application_security/
5069-
# DD_APPSEC_ENABLED: false
5070-
5071-
# # @param DD_IAST_ENABLED - boolean - optional - default: false
5072-
# # Enable Interactive Application Security Testing (IAST).
5073-
# # Docs: https://docs.datadoghq.com/security/code_security/iast/setup/#amazon-ecs
5074-
# DD_IAST_ENABLED: false
5075-
5076-
# # @param DD_DYNAMIC_INSTRUMENTATION_ENABLED - boolean - optional - default: false
5077-
# # Enable Dynamic Instrumentation.
5078-
# # Docs: https://docs.datadoghq.com/dynamic_instrumentation/
5079-
# DD_DYNAMIC_INSTRUMENTATION_ENABLED: false
5080-
5081-
# # @param DD_DATA_JOBS_ENABLED - boolean - optional - default: false
5082-
# # Enable data jobs visibility.
5083-
# DD_DATA_JOBS_ENABLED: false
5084-
5085-
# # @param DD_APPSEC_SCA_ENABLED - boolean - optional - default: false
5086-
# # Enable Software Composition Analysis.
5087-
# # Docs: https://docs.datadoghq.com/security/code_security/software_composition_analysis/
5088-
# DD_APPSEC_SCA_ENABLED: false
5089-
5090-
# # @param DD_TRACE_DEBUG - boolean - optional - default: false
5091-
# # Enable debug logging for the tracer.
5092-
# # Docs: https://docs.datadoghq.com/tracing/troubleshooting/tracer_debug_logs
5093-
# DD_TRACE_DEBUG: false
5094-
{{ end -}}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
###############################
2+
## Datadog APM Configuration ##
3+
###############################
4+
5+
## @section APM Configuration Rules
6+
##
7+
## Enable and configure APM, profiling, and security monitoring features.
8+
##
9+
## Settings can be configured via environment variables or the application_monitoring.yaml file.
10+
## Configuration precedence (highest to lowest priority):
11+
## 1. Fleet-managed config file
12+
## (etc/datadog-agent/managed/datadog-agent/stable/application_monitoring.yaml)
13+
## 2. Environment variables
14+
## 3. Local config file
15+
## (etc/datadog-agent/application_monitoring.yaml)
16+
# apm_configuration_default:
17+
18+
# # @param DD_APM_TRACING_ENABLED - boolean - optional - default: true
19+
# # Enable Datadog tracing.
20+
# # Docs: https://docs.datadoghq.com/tracing/trace_collection/
21+
# DD_APM_TRACING_ENABLED: true
22+
23+
# # @param DD_RUNTIME_METRICS_ENABLED - boolean - optional - default: false
24+
# # Enable runtime metrics.
25+
# # Docs: https://docs.datadoghq.com/tracing/metrics/runtime_metrics/?tab=java#environment-variables
26+
# DD_RUNTIME_METRICS_ENABLED: false
27+
28+
# # @param DD_LOGS_INJECTION - boolean - optional - default: false
29+
# # Enable automatic trace and span ID injection into logs.
30+
# # Docs: https://docs.datadoghq.com/tracing/other_telemetry/connect_logs_and_traces/
31+
# DD_LOGS_INJECTION: false
32+
33+
# # @param DD_PROFILING_ENABLED - boolean - optional - default: false
34+
# # Enable continuous profiling.
35+
# # Docs: https://docs.datadoghq.com/profiler/
36+
# DD_PROFILING_ENABLED: false
37+
38+
# # @param DD_DATA_STREAMS_ENABLED - boolean - optional - default: false
39+
# # Enable data streams monitoring.
40+
# # Docs: https://docs.datadoghq.com/data_streams/
41+
# DD_DATA_STREAMS_ENABLED: false
42+
43+
# # @param DD_APPSEC_ENABLED - boolean - optional - default: false
44+
# # Enable the Application Security product.
45+
# # Docs: https://docs.datadoghq.com/security/application_security/
46+
# DD_APPSEC_ENABLED: false
47+
48+
# # @param DD_IAST_ENABLED - boolean - optional - default: false
49+
# # Enable Interactive Application Security Testing (IAST).
50+
# # Docs: https://docs.datadoghq.com/security/code_security/iast/setup/#amazon-ecs
51+
# DD_IAST_ENABLED: false
52+
53+
# # @param DD_DYNAMIC_INSTRUMENTATION_ENABLED - boolean - optional - default: false
54+
# # Enable Dynamic Instrumentation.
55+
# # Docs: https://docs.datadoghq.com/dynamic_instrumentation/
56+
# DD_DYNAMIC_INSTRUMENTATION_ENABLED: false
57+
58+
# # @param DD_DATA_JOBS_ENABLED - boolean - optional - default: false
59+
# # Enable data jobs visibility.
60+
# DD_DATA_JOBS_ENABLED: false
61+
62+
# # @param DD_APPSEC_SCA_ENABLED - boolean - optional - default: false
63+
# # Enable Software Composition Analysis.
64+
# # Docs: https://docs.datadoghq.com/security/code_security/software_composition_analysis/
65+
# DD_APPSEC_SCA_ENABLED: false
66+
67+
# # @param DD_TRACE_DEBUG - boolean - optional - default: false
68+
# # Enable debug logging for the tracer.
69+
# # Docs: https://docs.datadoghq.com/tracing/troubleshooting/tracer_debug_logs
70+
# DD_TRACE_DEBUG: false

pkg/config/render_config.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,16 +162,6 @@ func mkContext(buildType string) context {
162162
OS: runtime.GOOS,
163163
SecurityAgent: true,
164164
}
165-
case "apm-injection":
166-
return context{
167-
OS: runtime.GOOS,
168-
APMInjection: true,
169-
}
170-
case "application-monitoring":
171-
return context{
172-
OS: runtime.GOOS,
173-
ApplicationMonitoring: true,
174-
}
175165
}
176166

177167
return context{}

0 commit comments

Comments
 (0)