Skip to content

Commit ad30887

Browse files
feat(otel): move otel to oci
1 parent 287675a commit ad30887

File tree

5 files changed

+69
-31
lines changed

5 files changed

+69
-31
lines changed

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

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ variables:
4040
default: docker.io
4141
variants:
4242
ac_config_field: "oci_nrdot_registry_urls"
43-
values: [ "docker.io" ]
43+
values: [ "docker.io" ]
4444
repository:
4545
description: "Package repository name"
4646
type: string
4747
required: false
4848
default: newrelic/nrdot-agent-artifacts
4949
variants:
5050
ac_config_field: "oci_nrdot_registry_repositories"
51-
values: [ "newrelic/nrdot-agent-artifacts" ]
51+
values: [ "newrelic/nrdot-agent-artifacts" ]
5252
version:
5353
description: "Agent version"
5454
type: string
@@ -78,6 +78,27 @@ variables:
7878
type: number
7979
required: false
8080
default: 13133
81+
oci:
82+
registry:
83+
description: "Package registry url"
84+
type: string
85+
required: false
86+
default: docker.io
87+
variants:
88+
ac_config_field: "oci_nrdot_registry_repositories"
89+
values: [ "docker.io" ]
90+
repository:
91+
description: "Package repository name"
92+
type: string
93+
required: false
94+
default: pgallina/poc
95+
variants:
96+
ac_config_field: "oci_nrdot_registry_repositories"
97+
values: [ "pgallina/poc" ]
98+
version:
99+
description: "Agent version"
100+
type: string
101+
required: true
81102
k8s:
82103
chart_values:
83104
nr-k8s-otel-collector:
@@ -161,6 +182,14 @@ deployment:
161182
backoff_delay: ${nr-var:backoff_delay}
162183

163184
linux:
185+
packages:
186+
nrdot:
187+
type: tar
188+
download:
189+
oci:
190+
registry: ${nr-var:oci.registry}
191+
repository: ${nr-var:oci.repository}
192+
version: ${nr-var:version}
164193
health:
165194
interval: 5s
166195
initial_delay: 5s
@@ -169,7 +198,7 @@ deployment:
169198
path: "${nr-var:health_check.path}"
170199
port: ${nr-var:health_check.port}
171200
version:
172-
path: /usr/bin/nrdot-collector
201+
path: ${nr-sub:packages.nrdot.dir}/nrdot-collector
173202
args:
174203
- -v
175204
regex: \d+\.\d+\.\d+
@@ -180,7 +209,7 @@ deployment:
180209
executables:
181210
- # Important to note the binary name is nrdot-collector matching the new nrdot binary
182211
id: nrdot-collector
183-
path: /usr/bin/nrdot-collector
212+
path: ${nr-sub:packages.nrdot.dir}/nrdot-collector
184213
args:
185214
- --config
186215
- ${nr-sub:filesystem_agent_dir}/otel-config/config.yaml

agent-control/src/agent_type/definition/agent_type_validation_tests.rs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,10 +414,28 @@ static AGENT_TYPE_OTEL_COLLECTOR: LazyLock<AgentTypeValuesTestCase> =
414414
.into(),
415415
values_linux: AgentTypeValues {
416416
cases: HashMap::from([
417-
("mandatory fields only", ""),
417+
("mandatory fields only", r#"version: "some-version""#),
418418
(
419419
"check all value types are correct",
420420
r#"
421+
version: "some-version"
422+
config: "some file contents"
423+
backoff_delay: "10s"
424+
health_check.path: "/health"
425+
health_check.port: 12345
426+
"#,
427+
),
428+
]),
429+
..Default::default()
430+
}
431+
.into(),
432+
values_windows: AgentTypeValues {
433+
cases: HashMap::from([
434+
("mandatory fields only", r#"version: "some-version""#),
435+
(
436+
"check all value types are correct",
437+
r#"
438+
version: "some-version"
421439
config: "some file contents"
422440
backoff_delay: "10s"
423441
health_check.path: "/health"
@@ -428,7 +446,6 @@ static AGENT_TYPE_OTEL_COLLECTOR: LazyLock<AgentTypeValuesTestCase> =
428446
..Default::default()
429447
}
430448
.into(),
431-
..Default::default()
432449
});
433450

434451
static AGENT_TYPE_OTEL_COLLECTOR_OLD: LazyLock<AgentTypeValuesTestCase> =

test/e2e-runner/src/common/config.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use tracing::info;
55

66
// TODO we should get the version dynamically from the recipe itself
77
pub const INFRA_AGENT_VERSION: &str = "1.72.1";
8-
pub const NRDOT_VERSION: &str = "1.8.0";
8+
const NRDOT_VERSION: &str = "1.8.0";
99

1010
/// Updates the agent control config in `config_path` to include the content specified in `new_content`
1111
pub fn update_config(config_path: impl AsRef<str>, new_content: impl AsRef<str>) {
@@ -111,7 +111,16 @@ pub fn append_to_config_file(config_path: &str, content: &str) {
111111
});
112112
}
113113

114-
pub const NRDOT_CONFIG: &str = r#"
114+
pub fn nrdot_config() -> String {
115+
format!(
116+
r#"
117+
version: {NRDOT_VERSION}
118+
{NRDOT_CONFIG}
119+
"#
120+
)
121+
}
122+
123+
const NRDOT_CONFIG: &str = r#"
115124
config:
116125
extensions:
117126
health_check:

test/e2e-runner/src/linux/scenarios/nrdot_agent.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use crate::common::config::NRDOT_CONFIG;
2-
use crate::common::config::NRDOT_VERSION;
3-
use crate::common::config::{ac_debug_logging_config, update_config, write_agent_local_config};
1+
use crate::common::config::{
2+
ac_debug_logging_config, nrdot_config, update_config, write_agent_local_config,
3+
};
44
use crate::common::on_drop::CleanUp;
55
use crate::common::test::retry_panic;
66
use crate::common::{Args, RecipeData};
@@ -56,11 +56,3 @@ agents:
5656
nrql::check_query_results_are_not_empty(&recipe_data.args, &nrql_query)
5757
});
5858
}
59-
60-
pub fn nrdot_config() -> String {
61-
format!(
62-
r#"
63-
{NRDOT_CONFIG}
64-
"#
65-
)
66-
}

test/e2e-runner/src/windows/scenarios/installation_nrdot.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use crate::common::config::NRDOT_CONFIG;
2-
use crate::common::config::NRDOT_VERSION;
3-
use crate::common::config::{ac_debug_logging_config, update_config, write_agent_local_config};
1+
use crate::common::config::{
2+
ac_debug_logging_config, nrdot_config, update_config, write_agent_local_config,
3+
};
44
use crate::common::on_drop::CleanUp;
55
use crate::common::test::{retry, retry_panic};
66
use crate::common::{Args, RecipeData, nrql};
@@ -75,12 +75,3 @@ agents:
7575

7676
info!("Test completed successfully");
7777
}
78-
79-
pub fn nrdot_config() -> String {
80-
format!(
81-
r#"
82-
version: {NRDOT_VERSION}
83-
{NRDOT_CONFIG}
84-
"#
85-
)
86-
}

0 commit comments

Comments
 (0)