@@ -76,11 +76,11 @@ install:
76
76
- task : update_apt_nr_source
77
77
- task : install_super_agent
78
78
- task : update_otel_license_key
79
- - task : update_otel_mem_limit
80
- - task : update_otel_end_point
81
79
- task : config_supervisors
82
80
- task : config_opamp
83
81
- task : config_host_monitoring
82
+ - task : update_otel_mem_limit
83
+ - task : update_otel_end_point
84
84
- task : restart_super_agent
85
85
- task : assert_super_agent_started
86
86
- task : post_install
@@ -192,7 +192,7 @@ install:
192
192
echo 'enable_process_metrics: true' >> /etc/newrelic-infra.yml
193
193
echo 'status_server_enabled: true' >> /etc/newrelic-infra.yml
194
194
echo 'status_server_port: 18003' >> /etc/newrelic-infra.yml
195
- echo 'license_key: {{. NEW_RELIC_LICENSE_KEY}}' >> /etc/newrelic-infra.yml
195
+ echo 'license_key: {{`{{ NEW_RELIC_LICENSE_KEY}}` }}' >> /etc/newrelic-infra.yml
196
196
echo '{{.NRIA_CUSTOM_ATTRIBUTES}}' >> /etc/newrelic-infra.yml
197
197
fi
198
198
@@ -303,42 +303,40 @@ install:
303
303
# Force-Install the Software
304
304
echo "Attempting to install any missing dependencies or fixes broken packages."
305
305
apt-get $OPTIONS install -f
306
- if [ $? -ne 0 ]; then
306
+ if [ $? -ne 0 ]; then
307
307
exit 1
308
308
fi
309
309
echo "Installation is successful"
310
310
fi
311
311
fi
312
312
silent : true
313
313
314
+ # Add NR Ingest Key as ENV Var for the Super Agent Systemd service (used by Infra Agent and Otel)
314
315
update_otel_license_key :
315
316
cmds :
316
317
- |
317
- sed -i 's/\(api-key: \).*/\1'"{{.NEW_RELIC_LICENSE_KEY}}"'/' /etc/nr-otel-collector/config.yaml
318
+ sed -i "/^NEW_RELIC_LICENSE_KEY/d" /etc/newrelic-super-agent/newrelic-super-agent.conf
319
+ echo 'NEW_RELIC_LICENSE_KEY="{{.NEW_RELIC_LICENSE_KEY}}"' >> /etc/newrelic-super-agent/newrelic-super-agent.conf
318
320
319
321
update_otel_mem_limit :
320
322
cmds :
321
323
- |
322
- sed -i 's/\(limit_mib: \).*/\1'"100"'/' /etc/nr-otel-collector/config.yaml
324
+ if [ "{{.NR_CLI_NRDOT}}" != "false" ]; then
325
+ sed -i "s/limit_mib: .*$/limit_mib: 100/g" /etc/newrelic-super-agent/fleet/agents.d/nr-otel-collector/values/values.yaml
326
+ fi
323
327
328
+ # Add OTLP Endpoint as ENV Var for the Super Agent Systemd service
324
329
update_otel_end_point :
325
330
cmds :
326
331
- |
327
- if [ -f /etc/newrelic-super-agent/newrelic-super-agent.conf ]; then
328
- sed -i "/^OTEL_EXPORTER_OTLP_ENDPOINT/d" /etc/newrelic-super-agent/newrelic-super-agent.conf
329
- fi
330
- - |
331
- # Remove old config location (to deprecate)
332
- rm -f /etc/newrelic-super-agent/nrdot-values.yaml
333
- sed -i "/^OTEL_EXPORTER_OTLP_ENDPOINT/d" /etc/newrelic-super-agent/newrelic-super-agent.conf
334
- # Create nr-otel-collector sub-agent dir
335
- mkdir -p /etc/newrelic-super-agent/fleet/agents.d/nr-otel-collector/values
336
- if [ "{{.NEW_RELIC_REGION}}" = "STAGING" ]; then
337
- echo 'otel_exporter_otlp_endpoint: "staging-otlp.nr-data.net:4317"' >> /etc/newrelic-super-agent/fleet/agents.d/nr-otel-collector/values/values.yml
338
- elif [ "{{.NEW_RELIC_REGION}}" = "EU" ]; then
339
- echo 'otel_exporter_otlp_endpoint: "otlp.eu01.nr-data.net:4317"' >> /etc/newrelic-super-agent/fleet/agents.d/nr-otel-collector/values/values.yml
340
- else
341
- echo 'otel_exporter_otlp_endpoint: "otlp.nr-data.net:4317"' >> /etc/newrelic-super-agent/fleet/agents.d/nr-otel-collector/values/values.yml
332
+ if [ "{{.NR_CLI_NRDOT}}" != "false" ]; then
333
+ if [ "{{.NEW_RELIC_REGION}}" = "STAGING" ]; then
334
+ sed -i "s/endpoint: .*$/endpoint: staging-otlp.nr-data.net:4317/g" /etc/newrelic-super-agent/fleet/agents.d/nr-otel-collector/values/values.yaml
335
+ elif [ "{{.NEW_RELIC_REGION}}" = "EU" ]; then
336
+ sed -i "s/endpoint: .*$/endpoint: otlp.eu01.nr-data.net:4317/g" /etc/newrelic-super-agent/fleet/agents.d/nr-otel-collector/values/values.yaml
337
+ else
338
+ sed -i "s/endpoint: .*$/endpoint: otlp.nr-data.net:4317/g" /etc/newrelic-super-agent/fleet/agents.d/nr-otel-collector/values/values.yaml
339
+ fi
342
340
fi
343
341
344
342
config_supervisors :
@@ -402,10 +400,12 @@ install:
402
400
- |
403
401
if [ "{{.NR_CLI_HOST_MONITORING_SOURCE}}" = "otel" ]; then
404
402
echo 'is_secure_forward_only: true' >> /etc/newrelic-infra.yml
403
+ mkdir -p /etc/newrelic-super-agent/fleet/agents.d/nr-otel-collector/values
404
+ cp /etc/newrelic-super-agent/examples/values-nr-otel-collector-agent-linux-0.1.0.yaml /etc/newrelic-super-agent/fleet/agents.d/nr-otel-collector/values/values.yaml
405
405
else
406
- if [ -f /etc/nr-otel-collector/config.yaml ]; then
407
- sed -i 's/\<otlp, hostmetrics\>/otlp/g' /etc /nr-otel-collector/config.yaml
408
- sed -i 's/\<otlp, filelog\>/otlp/g' /etc/nr-otel-collector/config .yaml
406
+ if [ "{{.NR_CLI_NRDOT}}" != "false" ]; then
407
+ mkdir -p /etc/newrelic-super-agent/fleet/agents.d /nr-otel-collector/values
408
+ cp /etc/newrelic-super-agent/examples/values-nr-otel-collector-gateway-0.1.0.yaml /etc/newrelic-super-agent/fleet/agents.d/ nr-otel-collector/values/values .yaml
409
409
fi
410
410
fi
411
411
0 commit comments