From f576ffc38cf3051b6310f702305be44012ea91bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20S=C3=A1nchez?= Date: Thu, 19 Oct 2023 15:54:41 +0100 Subject: [PATCH 1/4] feat: provide values file to nrdot agent type --- recipes/newrelic/infrastructure/super-agent/debian.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/recipes/newrelic/infrastructure/super-agent/debian.yml b/recipes/newrelic/infrastructure/super-agent/debian.yml index bd31d9a9f..e49a8bf51 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 From 31a21f4f2c444259acd7940229c6238e352cb3b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20S=C3=A1nchez?= Date: Tue, 24 Oct 2023 13:20:52 +0100 Subject: [PATCH 2/4] test: rename test files --- .../{debian10-super-agent.json => debian10-super-agent-eu.json} | 0 ...10arm64-super-agent.json => debian10arm64-super-agent-eu.json} | 0 .../{debian11-super-agent.json => debian11-super-agent-eu.json} | 0 .../{ubuntu16-super-agent.json => ubuntu16-super-agent-eu.json} | 0 .../{ubuntu18-super-agent.json => ubuntu18-super-agent-eu.json} | 0 .../{ubuntu20-super-agent.json => ubuntu20-super-agent-eu.json} | 0 ...20arm64-super-agent.json => ubuntu20arm64-super-agent-eu.json} | 0 .../{ubuntu22-super-agent.json => ubuntu22-super-agent-eu.json} | 0 ...uper-agent-logs.json => amazonlinux2-super-agent-logs-eu.json} | 0 ...r-agent-logs.json => amazonlinux2023-super-agent-logs-eu.json} | 0 ...11-super-agent-logs.json => debian11-super-agent-logs-eu.json} | 0 ...at8-super-agent-logs.json => redhat8-super-agent-logs-eu.json} | 0 ...at9-super-agent-logs.json => redhat9-super-agent-logs-eu.json} | 0 ...154-super-agent-logs.json => suse154-super-agent-logs-eu.json} | 0 ...20-super-agent-logs.json => ubuntu20-super-agent-logs-eu.json} | 0 ...22-super-agent-logs.json => ubuntu22-super-agent-logs-eu.json} | 0 ...awslinux23-super-agent.json => awslinux23-super-agent-eu.json} | 0 ...uxarm64-super-agent.json => awslinuxarm64-super-agent-eu.json} | 0 .../{centos7-super-agent.json => centos7-super-agent-eu.json} | 0 .../{centos8-super-agent.json => centos8-super-agent-eu.json} | 0 ...os8arm64-super-agent.json => centos8arm64-super-agent-eu.json} | 0 .../{redhat7-super-agent.json => redhat7-super-agent-eu.json} | 0 ...at8arm64-super-agent.json => redhat8arm64-super-agent-eu.json} | 0 .../{suse125-super-agent.json => suse125-super-agent-eu.json} | 0 .../{suse154-super-agent.json => suse154-super-agent-eu.json} | 0 25 files changed, 0 insertions(+), 0 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/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 From f0cc37b5b824cf77bb92a4bce3f86975cd466a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20S=C3=A1nchez?= Date: Tue, 24 Oct 2023 16:31:15 +0100 Subject: [PATCH 3/4] fix: quote input to values file --- recipes/newrelic/infrastructure/super-agent/debian.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/newrelic/infrastructure/super-agent/debian.yml b/recipes/newrelic/infrastructure/super-agent/debian.yml index e49a8bf51..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/nrdot-values.yaml + 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 From 58c0de6b728d3eb85365724636983e83881fae4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20S=C3=A1nchez?= Date: Tue, 24 Oct 2023 16:59:41 +0100 Subject: [PATCH 4/4] feat: update recipes for RHEL/SLES --- recipes/newrelic/infrastructure/super-agent/rhel.yml | 5 ++++- recipes/newrelic/infrastructure/super-agent/suse.yml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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: