Skip to content

Commit 949178e

Browse files
committed
refactor: migrate host agent types to filesystem
1 parent ee5263a commit 949178e

File tree

3 files changed

+40
-35
lines changed

3 files changed

+40
-35
lines changed

agent-control/agent-type-registry/newrelic/com.newrelic.infrastructure-0.1.0.yaml

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,19 @@ variables:
55
on_host:
66
config_agent:
77
description: "Newrelic infra configuration"
8-
type: file
8+
type: yaml
99
required: false
10-
default: ""
11-
file_path: "newrelic-infra.yml"
10+
default: {}
1211
config_integrations:
13-
description: "map of YAML configs for the OHIs"
14-
type: map[string]file
12+
description: "YAML configs for the OHIs"
13+
type: yaml
1514
required: false
16-
default: { }
17-
file_path: "integrations.d"
15+
default: {}
1816
config_logging:
19-
description: "map of YAML config for logging"
20-
type: map[string]file
17+
description: "YAML config for logging"
18+
type: yaml
2119
required: false
22-
default: { }
23-
file_path: "logging.d"
20+
default: {}
2421
backoff_delay:
2522
description: "seconds until next retry if agent fails to start"
2623
type: string
@@ -48,28 +45,28 @@ variables:
4845
description: "newrelic-infrastructure chart values"
4946
type: yaml
5047
required: false
51-
default: { }
48+
default: {}
5249
nri-metadata-injection:
5350
description: "nri-metadata-injection chart values"
5451
type: yaml
5552
required: false
56-
default: { }
53+
default: {}
5754
kube-state-metrics:
5855
description: "kube-state-metrics chart values"
5956
type: yaml
6057
required: false
61-
default: { }
58+
default: {}
6259
nri-kube-events:
6360
description: "nri-kube-events chart values"
6461
type: yaml
6562
required: false
66-
default: { }
63+
default: {}
6764
# Global values must have their own key, even if there is only one sub-chart.
6865
global:
6966
description: "Global chart values"
7067
type: yaml
7168
required: false
72-
default: { }
69+
default: {}
7370
# HelmChart based sub agents should always have `chart_version`.
7471
chart_version:
7572
description: "nri-bundle chart version"
@@ -101,7 +98,6 @@ variables:
10198
type: yaml
10299
required: false
103100
default: null
104-
105101
deployment:
106102
on_host:
107103
enable_file_logging: ${nr-var:enable_file_logging}
@@ -112,18 +108,27 @@ deployment:
112108
http:
113109
path: "/v1/status/health"
114110
port: ${nr-var:health_port}
115-
version:
116-
path: /usr/bin/newrelic-infra
117-
args: --version
118-
regex: \d+\.\d+\.\d+
111+
filesystem:
112+
config:
113+
path: newrelic-infra.yaml
114+
content: |
115+
${nr-var:config_agent}
116+
integrations:
117+
path: integrations.d/integrations.yaml
118+
content: |
119+
${nr-var:config_integrations}
120+
logging:
121+
path: logging/logging.yaml
122+
content: |
123+
${nr-var:config_logging}
119124
executables:
120125
- id: newrelic-infra
121126
path: /usr/bin/newrelic-infra
122127
args: >-
123-
--config=${nr-var:config_agent}
128+
--config=${nr-sub:agent_dir}/newrelic-infra.yaml
124129
env:
125-
NRIA_PLUGIN_DIR: "${nr-var:config_integrations}"
126-
NRIA_LOGGING_CONFIGS_DIR: "${nr-var:config_logging}"
130+
NRIA_PLUGIN_DIR: "${nr-sub:agent_dir}/integrations.d"
131+
NRIA_LOGGING_CONFIGS_DIR: "${nr-sub:agent_dir}/logging"
127132
NRIA_STATUS_SERVER_ENABLED: true
128133
NRIA_STATUS_SERVER_PORT: "${nr-var:health_port}"
129134
NR_HOST_ID: "${nr-ac:host_id}"
@@ -216,7 +221,7 @@ deployment:
216221
newrelic-prometheus-agent:
217222
enabled: false
218223
newrelic-k8s-metrics-adapter:
219-
enabled: false
224+
enabled: false
220225
# Flux [HelmRelease](https://fluxcd.io/flux/components/helmreleases/) that installs the nri-bundle chart.
221226
release:
222227
apiVersion: helm.toolkit.fluxcd.io/v2
@@ -240,7 +245,7 @@ deployment:
240245
chart: ${nr-var:chart_name}
241246
# This is where the chart version to be installed is defined. Whenever AC updates this Flux triggers a reconciliation.
242247
version: ${nr-var:chart_version}
243-
# This value gets rendered even if not specified so, even 'ChartVersion' is the default, it is required to specify
248+
# This value gets rendered even if not specified so, even 'ChartVersion' is the default, it is required to specify
244249
# it to avoid the drift detection on AC supervisor, and trigger re-apply on each interval.
245250
reconcileStrategy: ChartVersion
246251
sourceRef:

agent-control/agent-type-registry/newrelic/io.opentelemetry.collector-0.1.0.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ variables:
55
on_host:
66
config:
77
description: "Newrelic otel collector configuration"
8-
type: file
8+
type: yaml
99
required: false
10-
default: ""
11-
file_path: "config.yaml"
10+
default: {}
1211
backoff_delay:
1312
description: "seconds until next retry if agent fails to start"
1413
type: string
@@ -77,16 +76,17 @@ deployment:
7776
http:
7877
path: "${nr-var:health_check.path}"
7978
port: ${nr-var:health_check.port}
80-
version:
81-
path: /usr/bin/nrdot-collector-host
82-
args: -v
83-
regex: \d+\.\d+\.\d+
79+
filesystem:
80+
otel-config:
81+
path: config.yaml
82+
content: |
83+
${nr-var:config}
8484
executables:
8585
- # Important to note the binary name is nrdot-collector-host matching the new nrdot binary
8686
id: nrdot-collector-host
8787
path: /usr/bin/nrdot-collector-host
8888
args: >-
89-
--config=${nr-var:config}
89+
--config=${nr-sub:agent_dir}/config.yaml
9090
--feature-gates=-pkg.translator.prometheus.NormalizeName
9191
env:
9292
# sets the otel-collector "env" source resource detector

test/onhost-e2e/ansible/remote_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
copy:
9595
dest: /etc/newrelic-agent-control/fleet/agents.d/nr-infra/values/values.yaml
9696
content: |
97-
config_agent: |+
97+
config_agent:
9898
status_server_enabled: true
9999
status_server_port: 18003
100100
license_key: {{'{{'}}NEW_RELIC_LICENSE_KEY{{'}}'}}

0 commit comments

Comments
 (0)