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

Remove deprecated values-file modification for super-agent recipe in staging #998

Merged
merged 4 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
20 changes: 13 additions & 7 deletions recipes/newrelic/infrastructure/super-agent/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: super-agent
displayName: New Relic Super Agent
description: New Relic install recipe for the Super Agent
repository: https://github.com/newrelic/newrelic-supervisor
repository: https://github.com/newrelic/newrelic-super-agent

installTargets:
- type: host
Expand Down Expand Up @@ -328,16 +328,25 @@ install:
sed -i "/^OTEL_EXPORTER_OTLP_ENDPOINT/d" /etc/newrelic-super-agent/newrelic-super-agent.conf
fi
- |
# Remove old config location (to deprecate)
rm -f /etc/newrelic-super-agent/nrdot-values.yaml
sed -i "/^OTEL_EXPORTER_OTLP_ENDPOINT/d" /etc/newrelic-super-agent/newrelic-super-agent.conf
# Create nr_otel_collector sub-agent dir
mkdir -p /etc/newrelic-super-agent/fleet/agents.d/nr_otel_collector
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/fleet/agents.d/nr_otel_collector/values.yml
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
echo 'otel_exporter_otlp_endpoint: "otlp.eu01.nr-data.net:4317"' >> /etc/newrelic-super-agent/fleet/agents.d/nr_otel_collector/values.yml
else
echo 'OTEL_EXPORTER_OTLP_ENDPOINT=otlp.nr-data.net:4317' >> /etc/newrelic-super-agent/newrelic-super-agent.conf
echo 'otel_exporter_otlp_endpoint: "otlp.nr-data.net:4317"' >> /etc/newrelic-super-agent/fleet/agents.d/nr_otel_collector/values.yml
fi

config_supervisors:
cmds:
- |
# Remove values_file keys from config.yaml
sed -i '/^\s*values_file:/d' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*#\s*values_file:/d' /etc/newrelic-super-agent/config.yaml
- |
if [ "{{.NR_CLI_INFRA_AGENT}}" = "false" ] && [ "{{.NR_CLI_NRDOT}}" = "false" ]; then
sed -i '/^\s*agents:/s/^/#/' /etc/newrelic-super-agent/config.yaml
Expand All @@ -359,9 +368,6 @@ 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:
Expand Down
21 changes: 13 additions & 8 deletions recipes/newrelic/infrastructure/super-agent/rhel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: super-agent
displayName: New Relic Super Agent
description: New Relic install recipe for the Super Agent
repository: https://github.com/newrelic/newrelic-supervisor
repository: https://github.com/newrelic/newrelic-super-agent

installTargets:
- type: host
Expand Down Expand Up @@ -265,16 +265,24 @@ install:
sed -i "/^OTEL_EXPORTER_OTLP_ENDPOINT/d" /etc/newrelic-super-agent/newrelic-super-agent.conf
fi
- |
# Remove old config location (to deprecate)
rm -f /etc/newrelic-super-agent/nrdot-values.yaml
# Create nr_otel_collector sub-agent dir
mkdir -p /etc/newrelic-super-agent/fleet/agents.d/nr_otel_collector
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/fleet/agents.d/nr_otel_collector/values.yml
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
echo 'OTEL_EXPORTER_OTLP_ENDPOINT=otlp.eu01.nr-data.net:4317' >> /etc/newrelic-super-agent/fleet/agents.d/nr_otel_collector/values.yml
else
echo 'OTEL_EXPORTER_OTLP_ENDPOINT=otlp.nr-data.net:4317' >> /etc/newrelic-super-agent/newrelic-super-agent.conf
echo 'OTEL_EXPORTER_OTLP_ENDPOINT=otlp.nr-data.net:4317' >> //etc/newrelic-super-agent/fleet/agents.d/nr_otel_collector/values.yml
fi

config_supervisors:
cmds:
- |
# Remove values_file keys from config.yaml
sed -i '/^\s*values_file:/d' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*#\s*values_file:/d' /etc/newrelic-super-agent/config.yaml
- |
if [ "{{.NR_CLI_INFRA_AGENT}}" = "false" ] && [ "{{.NR_CLI_NRDOT}}" = "false" ] ; then
sed -i '/^\s*agents:/s/^/#/' /etc/newrelic-super-agent/config.yaml
Expand All @@ -295,10 +303,7 @@ install:
sed -i '/^\s*agent_type: "newrelic\/io\.opentelemetry\.collector/s/^/#/' /etc/newrelic-super-agent/config.yaml
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
sed -i '/^\s*#\s*agent_type: "newrelic\/io\.opentelemetry\.collector/s/#//' /etc/newrelic-super-agent/config.yaml
fi

config_opamp:
Expand Down
21 changes: 14 additions & 7 deletions recipes/newrelic/infrastructure/super-agent/suse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: super-agent
displayName: New Relic Super Agent
description: New Relic install recipe for the Super Agent
repository: https://github.com/newrelic/newrelic-supervisor
repository: https://github.com/newrelic/newrelic-super-agent

installTargets:
- type: host
Expand Down Expand Up @@ -220,16 +220,24 @@ install:
sed -i "/^OTEL_EXPORTER_OTLP_ENDPOINT/d" /etc/newrelic-super-agent/newrelic-super-agent.conf
fi
- |
# Remove old config location (to deprecate)
rm -f /etc/newrelic-super-agent/nrdot-values.yaml
# Create nr_otel_collector sub-agent dir
mkdir -p /etc/newrelic-super-agent/fleet/agents.d/nr_otel_collector
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/fleet/agents.d/nr_otel_collector/values.yml
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
echo 'OTEL_EXPORTER_OTLP_ENDPOINT=otlp.eu01.nr-data.net:4317' >> /etc/newrelic-super-agent/fleet/agents.d/nr_otel_collector/values.yml
else
echo 'OTEL_EXPORTER_OTLP_ENDPOINT=otlp.nr-data.net:4317' >> /etc/newrelic-super-agent/newrelic-super-agent.conf
echo 'OTEL_EXPORTER_OTLP_ENDPOINT=otlp.nr-data.net:4317' >> /etc/newrelic-super-agent/fleet/agents.d/nr_otel_collector/values.yml
fi

config_supervisors:
cmds:
- |
# Remove values_file keys from config.yaml
sed -i '/^\s*values_file:/d' /etc/newrelic-super-agent/config.yaml
sed -i '/^\s*#\s*values_file:/d' /etc/newrelic-super-agent/config.yaml
- |
if [ "{{.NR_CLI_INFRA_AGENT}}" = "false" ] && [ "{{.NR_CLI_NRDOT}}" = "false" ] ; then
sed -i '/^\s*agents:/s/^/#/' /etc/newrelic-super-agent/config.yaml
Expand All @@ -251,9 +259,6 @@ 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:
Expand All @@ -271,6 +276,8 @@ install:
sed -i '/^\s*#\s*headers:/s/#//' /etc/newrelic-super-agent/config.yaml
fi
- |
# Remove old config location (to deprecate)
rm -f /etc/newrelic-super-agent/nrdot-values.yaml
if [ "{{.NEW_RELIC_REGION}}" = "STAGING" ]; then
sed -i 's/\(endpoint: https:\/\/opamp.\).*/\1'"staging-service.newrelic.com\/v1\/opamp"'/' /etc/newrelic-super-agent/config.yaml
elif [ "{{.NEW_RELIC_REGION}}" = "EU" ]; then
Expand Down
Loading