Skip to content

Commit f251eb1

Browse files
committed
refactor: migrate host agent types to filesystem
1 parent 99ff81f commit f251eb1

File tree

2 files changed

+40
-25
lines changed

2 files changed

+40
-25
lines changed

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

Lines changed: 29 additions & 19 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
1010
default: ""
11-
file_path: "newrelic-infra.yml"
1211
config_integrations:
1312
description: "map of YAML configs for the OHIs"
14-
type: map[string]file
13+
type: map[string]yaml
1514
required: false
16-
default: { }
17-
file_path: "integrations.d"
15+
default: {}
1816
config_logging:
1917
description: "map of YAML config for logging"
20-
type: map[string]file
18+
type: map[string]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,7 @@ variables:
10198
type: yaml
10299
required: false
103100
default: null
104-
101+
105102
deployment:
106103
on_host:
107104
enable_file_logging: ${nr-var:enable_file_logging}
@@ -116,14 +113,27 @@ deployment:
116113
path: /usr/bin/newrelic-infra
117114
args: --version
118115
regex: \d+\.\d+\.\d+
116+
filesystem:
117+
files:
118+
config:
119+
path: newrelic-infra.yaml
120+
content: |
121+
${nr-var:config_agent}
122+
directories:
123+
integrations:
124+
path: integrations.d
125+
items: ${nr-var:config_integrations}
126+
logging:
127+
path: logging.d
128+
items: ${nr-var:config_logging}
119129
executables:
120130
- id: newrelic-infra
121131
path: /usr/bin/newrelic-infra
122132
args: >-
123-
--config=${nr-var:config_agent}
133+
--config=${nr-sub:autogenerated_agent_dir}/files/newrelic-infra.yaml
124134
env:
125-
NRIA_PLUGIN_DIR: "${nr-var:config_integrations}"
126-
NRIA_LOGGING_CONFIGS_DIR: "${nr-var:config_logging}"
135+
NRIA_PLUGIN_DIR: "${nr-sub:autogenerated_agent_dir}/directories/integrations.d"
136+
NRIA_LOGGING_CONFIGS_DIR: "${nr-sub:autogenerated_agent_dir}/directories/logging.d"
127137
NRIA_STATUS_SERVER_ENABLED: true
128138
NRIA_STATUS_SERVER_PORT: "${nr-var:health_port}"
129139
NR_HOST_ID: "${nr-ac:host_id}"
@@ -216,7 +226,7 @@ deployment:
216226
newrelic-prometheus-agent:
217227
enabled: false
218228
newrelic-k8s-metrics-adapter:
219-
enabled: false
229+
enabled: false
220230
# Flux [HelmRelease](https://fluxcd.io/flux/components/helmreleases/) that installs the nri-bundle chart.
221231
release:
222232
apiVersion: helm.toolkit.fluxcd.io/v2
@@ -240,7 +250,7 @@ deployment:
240250
chart: ${nr-var:chart_name}
241251
# This is where the chart version to be installed is defined. Whenever AC updates this Flux triggers a reconciliation.
242252
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
253+
# This value gets rendered even if not specified so, even 'ChartVersion' is the default, it is required to specify
244254
# it to avoid the drift detection on AC supervisor, and trigger re-apply on each interval.
245255
reconcileStrategy: ChartVersion
246256
sourceRef:

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

Lines changed: 11 additions & 6 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
@@ -34,12 +33,12 @@ variables:
3433
description: "Newrelic otel collector chart values"
3534
type: yaml
3635
required: false
37-
default: { }
36+
default: {}
3837
global:
3938
description: "Global values for the chart"
4039
type: yaml
4140
required: false
42-
default: { }
41+
default: {}
4342
chart_version:
4443
description: "Newrelic otel collector chart version"
4544
type: string
@@ -81,12 +80,18 @@ deployment:
8180
path: /usr/bin/nrdot-collector-host
8281
args: -v
8382
regex: \d+\.\d+\.\d+
83+
filesystem:
84+
files:
85+
otel-config:
86+
path: config.yaml
87+
content: |
88+
${nr-var:config}
8489
executables:
8590
- # Important to note the binary name is nrdot-collector-host matching the new nrdot binary
8691
id: nrdot-collector-host
8792
path: /usr/bin/nrdot-collector-host
8893
args: >-
89-
--config=${nr-var:config}
94+
--config=${nr-sub:autogenerated_agent_dir}/files/config.yaml
9095
--feature-gates=-pkg.translator.prometheus.NormalizeName
9196
env:
9297
# sets the otel-collector "env" source resource detector

0 commit comments

Comments
 (0)