From a0f054e8ee58f314c3b442037ddcb277fcfa8d25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20S=C3=A1nchez?= Date: Wed, 25 Oct 2023 20:05:56 +0100 Subject: [PATCH] feat: provide values file to nrdot agent type (#990) --- recipes/newrelic/infrastructure/super-agent/debian.yml | 7 +++++-- recipes/newrelic/infrastructure/super-agent/rhel.yml | 5 ++++- recipes/newrelic/infrastructure/super-agent/suse.yml | 5 ++++- ...ian10-super-agent.json => debian10-super-agent-eu.json} | 0 ...-super-agent.json => debian10arm64-super-agent-eu.json} | 0 ...ian11-super-agent.json => debian11-super-agent-eu.json} | 0 ...ntu16-super-agent.json => ubuntu16-super-agent-eu.json} | 0 ...ntu18-super-agent.json => ubuntu18-super-agent-eu.json} | 0 ...ntu20-super-agent.json => ubuntu20-super-agent-eu.json} | 0 ...-super-agent.json => ubuntu20arm64-super-agent-eu.json} | 0 ...ntu22-super-agent.json => ubuntu22-super-agent-eu.json} | 0 ...ent-logs.json => amazonlinux2-super-agent-logs-eu.json} | 0 ...-logs.json => amazonlinux2023-super-agent-logs-eu.json} | 0 ...r-agent-logs.json => debian11-super-agent-logs-eu.json} | 0 ...er-agent-logs.json => redhat8-super-agent-logs-eu.json} | 0 ...er-agent-logs.json => redhat9-super-agent-logs-eu.json} | 0 ...er-agent-logs.json => suse154-super-agent-logs-eu.json} | 0 ...r-agent-logs.json => ubuntu20-super-agent-logs-eu.json} | 0 ...r-agent-logs.json => ubuntu22-super-agent-logs-eu.json} | 0 ...x23-super-agent.json => awslinux23-super-agent-eu.json} | 0 ...-super-agent.json => awslinuxarm64-super-agent-eu.json} | 0 ...entos7-super-agent.json => centos7-super-agent-eu.json} | 0 ...entos8-super-agent.json => centos8-super-agent-eu.json} | 0 ...4-super-agent.json => centos8arm64-super-agent-eu.json} | 0 ...edhat7-super-agent.json => redhat7-super-agent-eu.json} | 0 ...4-super-agent.json => redhat8arm64-super-agent-eu.json} | 0 ...use125-super-agent.json => suse125-super-agent-eu.json} | 0 ...use154-super-agent.json => suse154-super-agent-eu.json} | 0 28 files changed, 13 insertions(+), 4 deletions(-) rename test/definitions-eu/super-agent/debians/{debian10-super-agent.json => debian10-super-agent-eu.json} (100%) rename test/definitions-eu/super-agent/debians/{debian10arm64-super-agent.json => debian10arm64-super-agent-eu.json} (100%) rename test/definitions-eu/super-agent/debians/{debian11-super-agent.json => debian11-super-agent-eu.json} (100%) rename test/definitions-eu/super-agent/debians/{ubuntu16-super-agent.json => ubuntu16-super-agent-eu.json} (100%) rename test/definitions-eu/super-agent/debians/{ubuntu18-super-agent.json => ubuntu18-super-agent-eu.json} (100%) rename test/definitions-eu/super-agent/debians/{ubuntu20-super-agent.json => ubuntu20-super-agent-eu.json} (100%) rename test/definitions-eu/super-agent/debians/{ubuntu20arm64-super-agent.json => ubuntu20arm64-super-agent-eu.json} (100%) rename test/definitions-eu/super-agent/debians/{ubuntu22-super-agent.json => ubuntu22-super-agent-eu.json} (100%) rename test/definitions-eu/super-agent/logs/{amazonlinux2-super-agent-logs.json => amazonlinux2-super-agent-logs-eu.json} (100%) rename test/definitions-eu/super-agent/logs/{amazonlinux2023-super-agent-logs.json => amazonlinux2023-super-agent-logs-eu.json} (100%) rename test/definitions-eu/super-agent/logs/{debian11-super-agent-logs.json => debian11-super-agent-logs-eu.json} (100%) rename test/definitions-eu/super-agent/logs/{redhat8-super-agent-logs.json => redhat8-super-agent-logs-eu.json} (100%) rename test/definitions-eu/super-agent/logs/{redhat9-super-agent-logs.json => redhat9-super-agent-logs-eu.json} (100%) rename test/definitions-eu/super-agent/logs/{suse154-super-agent-logs.json => suse154-super-agent-logs-eu.json} (100%) rename test/definitions-eu/super-agent/logs/{ubuntu20-super-agent-logs.json => ubuntu20-super-agent-logs-eu.json} (100%) rename test/definitions-eu/super-agent/logs/{ubuntu22-super-agent-logs.json => ubuntu22-super-agent-logs-eu.json} (100%) rename test/definitions-eu/super-agent/rhel/{awslinux23-super-agent.json => awslinux23-super-agent-eu.json} (100%) rename test/definitions-eu/super-agent/rhel/{awslinuxarm64-super-agent.json => awslinuxarm64-super-agent-eu.json} (100%) rename test/definitions-eu/super-agent/rhel/{centos7-super-agent.json => centos7-super-agent-eu.json} (100%) rename test/definitions-eu/super-agent/rhel/{centos8-super-agent.json => centos8-super-agent-eu.json} (100%) rename test/definitions-eu/super-agent/rhel/{centos8arm64-super-agent.json => centos8arm64-super-agent-eu.json} (100%) rename test/definitions-eu/super-agent/rhel/{redhat7-super-agent.json => redhat7-super-agent-eu.json} (100%) rename test/definitions-eu/super-agent/rhel/{redhat8arm64-super-agent.json => redhat8arm64-super-agent-eu.json} (100%) rename test/definitions-eu/super-agent/suse/{suse125-super-agent.json => suse125-super-agent-eu.json} (100%) rename test/definitions-eu/super-agent/suse/{suse154-super-agent.json => suse154-super-agent-eu.json} (100%) diff --git a/recipes/newrelic/infrastructure/super-agent/debian.yml b/recipes/newrelic/infrastructure/super-agent/debian.yml index bd31d9a9f..a6b13c439 100644 --- a/recipes/newrelic/infrastructure/super-agent/debian.yml +++ b/recipes/newrelic/infrastructure/super-agent/debian.yml @@ -326,7 +326,7 @@ install: fi - | if [ "{{.NEW_RELIC_REGION}}" = "STAGING" ]; then - echo 'OTEL_EXPORTER_OTLP_ENDPOINT=staging-otlp.nr-data.net:4317' >> /etc/newrelic-super-agent/newrelic-super-agent.conf + echo 'otel_exporter_otlp_endpoint: "staging-otlp.nr-data.net:4317"' >> /etc/newrelic-super-agent/nrdot-values.yaml elif [ "{{.NEW_RELIC_REGION}}" = "EU" ]; then echo 'OTEL_EXPORTER_OTLP_ENDPOINT=otlp.eu01.nr-data.net:4317' >> /etc/newrelic-super-agent/newrelic-super-agent.conf else @@ -356,6 +356,9 @@ install: else sed -i '/^\s*#\s*nr_otel_collector:/s/#//' /etc/newrelic-super-agent/config.yaml sed -i '/^\s*#\s*agent_type: "newrelic\/io\.opentelemetry\.collector/s/#//' /etc/newrelic-super-agent/config.yaml + if [ "{{.NEW_RELIC_REGION}}" = "STAGING" ]; then + sed -i 's/nr_otel_collector:/nr_otel_collector:\n values_file: "\/etc\/newrelic-super-agent\/nrdot-values\.yaml"/' /etc/newrelic-super-agent/config.yaml + fi fi config_opamp: @@ -427,4 +430,4 @@ install: post_install: info: |2 - ⚙️ The New Relic Super Agent configuration file can be found in /etc/newrelic-super-agent/config.yaml \ No newline at end of file + ⚙️ The New Relic Super Agent configuration file can be found in /etc/newrelic-super-agent/config.yaml diff --git a/recipes/newrelic/infrastructure/super-agent/rhel.yml b/recipes/newrelic/infrastructure/super-agent/rhel.yml index 7622aac11..402031c12 100644 --- a/recipes/newrelic/infrastructure/super-agent/rhel.yml +++ b/recipes/newrelic/infrastructure/super-agent/rhel.yml @@ -262,7 +262,7 @@ install: fi - | if [ "{{.NEW_RELIC_REGION}}" = "STAGING" ]; then - echo 'OTEL_EXPORTER_OTLP_ENDPOINT=staging-otlp.nr-data.net:4317' >> /etc/newrelic-super-agent/newrelic-super-agent.conf + echo 'otel_exporter_otlp_endpoint: "staging-otlp.nr-data.net:4317"' >> /etc/newrelic-super-agent/nrdot-values.yaml elif [ "{{.NEW_RELIC_REGION}}" = "EU" ]; then echo 'OTEL_EXPORTER_OTLP_ENDPOINT=otlp.eu01.nr-data.net:4317' >> /etc/newrelic-super-agent/newrelic-super-agent.conf else @@ -292,6 +292,9 @@ install: else sed -i '/^\s*#\s*nr_otel_collector:/s/#//' /etc/newrelic-super-agent/config.yaml sed -i '/^\s*#\s*agent_type: "newrelic\/io\.opentelemetry\.collector/s/#//' /etc/newrelic-super-agent/config.yaml + if [ "{{.NEW_RELIC_REGION}}" = "STAGING" ]; then + sed -i 's/nr_otel_collector:/nr_otel_collector:\n values_file: "\/etc\/newrelic-super-agent\/nrdot-values\.yaml"/' /etc/newrelic-super-agent/config.yaml + fi fi config_opamp: diff --git a/recipes/newrelic/infrastructure/super-agent/suse.yml b/recipes/newrelic/infrastructure/super-agent/suse.yml index fb67f42a7..5a1922391 100644 --- a/recipes/newrelic/infrastructure/super-agent/suse.yml +++ b/recipes/newrelic/infrastructure/super-agent/suse.yml @@ -216,7 +216,7 @@ install: fi - | if [ "{{.NEW_RELIC_REGION}}" = "STAGING" ]; then - echo 'OTEL_EXPORTER_OTLP_ENDPOINT=staging-otlp.nr-data.net:4317' >> /etc/newrelic-super-agent/newrelic-super-agent.conf + echo 'otel_exporter_otlp_endpoint: "staging-otlp.nr-data.net:4317"' >> /etc/newrelic-super-agent/nrdot-values.yaml elif [ "{{.NEW_RELIC_REGION}}" = "EU" ]; then echo 'OTEL_EXPORTER_OTLP_ENDPOINT=otlp.eu01.nr-data.net:4317' >> /etc/newrelic-super-agent/newrelic-super-agent.conf else @@ -246,6 +246,9 @@ install: else sed -i '/^\s*#\s*nr_otel_collector:/s/#//' /etc/newrelic-super-agent/config.yaml sed -i '/^\s*#\s*agent_type: "newrelic\/io\.opentelemetry\.collector/s/#//' /etc/newrelic-super-agent/config.yaml + if [ "{{.NEW_RELIC_REGION}}" = "STAGING" ]; then + sed -i 's/nr_otel_collector:/nr_otel_collector:\n values_file: "\/etc\/newrelic-super-agent\/nrdot-values\.yaml"/' /etc/newrelic-super-agent/config.yaml + fi fi config_opamp: diff --git a/test/definitions-eu/super-agent/debians/debian10-super-agent.json b/test/definitions-eu/super-agent/debians/debian10-super-agent-eu.json similarity index 100% rename from test/definitions-eu/super-agent/debians/debian10-super-agent.json rename to test/definitions-eu/super-agent/debians/debian10-super-agent-eu.json diff --git a/test/definitions-eu/super-agent/debians/debian10arm64-super-agent.json b/test/definitions-eu/super-agent/debians/debian10arm64-super-agent-eu.json similarity index 100% rename from test/definitions-eu/super-agent/debians/debian10arm64-super-agent.json rename to test/definitions-eu/super-agent/debians/debian10arm64-super-agent-eu.json diff --git a/test/definitions-eu/super-agent/debians/debian11-super-agent.json b/test/definitions-eu/super-agent/debians/debian11-super-agent-eu.json similarity index 100% rename from test/definitions-eu/super-agent/debians/debian11-super-agent.json rename to test/definitions-eu/super-agent/debians/debian11-super-agent-eu.json diff --git a/test/definitions-eu/super-agent/debians/ubuntu16-super-agent.json b/test/definitions-eu/super-agent/debians/ubuntu16-super-agent-eu.json similarity index 100% rename from test/definitions-eu/super-agent/debians/ubuntu16-super-agent.json rename to test/definitions-eu/super-agent/debians/ubuntu16-super-agent-eu.json diff --git a/test/definitions-eu/super-agent/debians/ubuntu18-super-agent.json b/test/definitions-eu/super-agent/debians/ubuntu18-super-agent-eu.json similarity index 100% rename from test/definitions-eu/super-agent/debians/ubuntu18-super-agent.json rename to test/definitions-eu/super-agent/debians/ubuntu18-super-agent-eu.json diff --git a/test/definitions-eu/super-agent/debians/ubuntu20-super-agent.json b/test/definitions-eu/super-agent/debians/ubuntu20-super-agent-eu.json similarity index 100% rename from test/definitions-eu/super-agent/debians/ubuntu20-super-agent.json rename to test/definitions-eu/super-agent/debians/ubuntu20-super-agent-eu.json diff --git a/test/definitions-eu/super-agent/debians/ubuntu20arm64-super-agent.json b/test/definitions-eu/super-agent/debians/ubuntu20arm64-super-agent-eu.json similarity index 100% rename from test/definitions-eu/super-agent/debians/ubuntu20arm64-super-agent.json rename to test/definitions-eu/super-agent/debians/ubuntu20arm64-super-agent-eu.json diff --git a/test/definitions-eu/super-agent/debians/ubuntu22-super-agent.json b/test/definitions-eu/super-agent/debians/ubuntu22-super-agent-eu.json similarity index 100% rename from test/definitions-eu/super-agent/debians/ubuntu22-super-agent.json rename to test/definitions-eu/super-agent/debians/ubuntu22-super-agent-eu.json diff --git a/test/definitions-eu/super-agent/logs/amazonlinux2-super-agent-logs.json b/test/definitions-eu/super-agent/logs/amazonlinux2-super-agent-logs-eu.json similarity index 100% rename from test/definitions-eu/super-agent/logs/amazonlinux2-super-agent-logs.json rename to test/definitions-eu/super-agent/logs/amazonlinux2-super-agent-logs-eu.json diff --git a/test/definitions-eu/super-agent/logs/amazonlinux2023-super-agent-logs.json b/test/definitions-eu/super-agent/logs/amazonlinux2023-super-agent-logs-eu.json similarity index 100% rename from test/definitions-eu/super-agent/logs/amazonlinux2023-super-agent-logs.json rename to test/definitions-eu/super-agent/logs/amazonlinux2023-super-agent-logs-eu.json diff --git a/test/definitions-eu/super-agent/logs/debian11-super-agent-logs.json b/test/definitions-eu/super-agent/logs/debian11-super-agent-logs-eu.json similarity index 100% rename from test/definitions-eu/super-agent/logs/debian11-super-agent-logs.json rename to test/definitions-eu/super-agent/logs/debian11-super-agent-logs-eu.json diff --git a/test/definitions-eu/super-agent/logs/redhat8-super-agent-logs.json b/test/definitions-eu/super-agent/logs/redhat8-super-agent-logs-eu.json similarity index 100% rename from test/definitions-eu/super-agent/logs/redhat8-super-agent-logs.json rename to test/definitions-eu/super-agent/logs/redhat8-super-agent-logs-eu.json diff --git a/test/definitions-eu/super-agent/logs/redhat9-super-agent-logs.json b/test/definitions-eu/super-agent/logs/redhat9-super-agent-logs-eu.json similarity index 100% rename from test/definitions-eu/super-agent/logs/redhat9-super-agent-logs.json rename to test/definitions-eu/super-agent/logs/redhat9-super-agent-logs-eu.json diff --git a/test/definitions-eu/super-agent/logs/suse154-super-agent-logs.json b/test/definitions-eu/super-agent/logs/suse154-super-agent-logs-eu.json similarity index 100% rename from test/definitions-eu/super-agent/logs/suse154-super-agent-logs.json rename to test/definitions-eu/super-agent/logs/suse154-super-agent-logs-eu.json diff --git a/test/definitions-eu/super-agent/logs/ubuntu20-super-agent-logs.json b/test/definitions-eu/super-agent/logs/ubuntu20-super-agent-logs-eu.json similarity index 100% rename from test/definitions-eu/super-agent/logs/ubuntu20-super-agent-logs.json rename to test/definitions-eu/super-agent/logs/ubuntu20-super-agent-logs-eu.json diff --git a/test/definitions-eu/super-agent/logs/ubuntu22-super-agent-logs.json b/test/definitions-eu/super-agent/logs/ubuntu22-super-agent-logs-eu.json similarity index 100% rename from test/definitions-eu/super-agent/logs/ubuntu22-super-agent-logs.json rename to test/definitions-eu/super-agent/logs/ubuntu22-super-agent-logs-eu.json diff --git a/test/definitions-eu/super-agent/rhel/awslinux23-super-agent.json b/test/definitions-eu/super-agent/rhel/awslinux23-super-agent-eu.json similarity index 100% rename from test/definitions-eu/super-agent/rhel/awslinux23-super-agent.json rename to test/definitions-eu/super-agent/rhel/awslinux23-super-agent-eu.json diff --git a/test/definitions-eu/super-agent/rhel/awslinuxarm64-super-agent.json b/test/definitions-eu/super-agent/rhel/awslinuxarm64-super-agent-eu.json similarity index 100% rename from test/definitions-eu/super-agent/rhel/awslinuxarm64-super-agent.json rename to test/definitions-eu/super-agent/rhel/awslinuxarm64-super-agent-eu.json diff --git a/test/definitions-eu/super-agent/rhel/centos7-super-agent.json b/test/definitions-eu/super-agent/rhel/centos7-super-agent-eu.json similarity index 100% rename from test/definitions-eu/super-agent/rhel/centos7-super-agent.json rename to test/definitions-eu/super-agent/rhel/centos7-super-agent-eu.json diff --git a/test/definitions-eu/super-agent/rhel/centos8-super-agent.json b/test/definitions-eu/super-agent/rhel/centos8-super-agent-eu.json similarity index 100% rename from test/definitions-eu/super-agent/rhel/centos8-super-agent.json rename to test/definitions-eu/super-agent/rhel/centos8-super-agent-eu.json diff --git a/test/definitions-eu/super-agent/rhel/centos8arm64-super-agent.json b/test/definitions-eu/super-agent/rhel/centos8arm64-super-agent-eu.json similarity index 100% rename from test/definitions-eu/super-agent/rhel/centos8arm64-super-agent.json rename to test/definitions-eu/super-agent/rhel/centos8arm64-super-agent-eu.json diff --git a/test/definitions-eu/super-agent/rhel/redhat7-super-agent.json b/test/definitions-eu/super-agent/rhel/redhat7-super-agent-eu.json similarity index 100% rename from test/definitions-eu/super-agent/rhel/redhat7-super-agent.json rename to test/definitions-eu/super-agent/rhel/redhat7-super-agent-eu.json diff --git a/test/definitions-eu/super-agent/rhel/redhat8arm64-super-agent.json b/test/definitions-eu/super-agent/rhel/redhat8arm64-super-agent-eu.json similarity index 100% rename from test/definitions-eu/super-agent/rhel/redhat8arm64-super-agent.json rename to test/definitions-eu/super-agent/rhel/redhat8arm64-super-agent-eu.json diff --git a/test/definitions-eu/super-agent/suse/suse125-super-agent.json b/test/definitions-eu/super-agent/suse/suse125-super-agent-eu.json similarity index 100% rename from test/definitions-eu/super-agent/suse/suse125-super-agent.json rename to test/definitions-eu/super-agent/suse/suse125-super-agent-eu.json diff --git a/test/definitions-eu/super-agent/suse/suse154-super-agent.json b/test/definitions-eu/super-agent/suse/suse154-super-agent-eu.json similarity index 100% rename from test/definitions-eu/super-agent/suse/suse154-super-agent.json rename to test/definitions-eu/super-agent/suse/suse154-super-agent-eu.json