Skip to content

Commit b6a5aa6

Browse files
feat(ac): change PCG agentType name (#2582)
1 parent ebefced commit b6a5aa6

7 files changed

Lines changed: 106 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Remember that the keywords that you can use are the following:
1414

1515
## Unreleased
1616

17+
### bugfix
18+
- the agentType for the PCG config should be called pipeline_control_gateway_config_mode
19+
1720
## v1.16.0 - 2026-06-02
1821

1922
### 🚀 Enhancements

agent-control/agent-type-registry/newrelic/pipeline-control-gateway-config-0.1.0.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This is the same agent type as `com.newrelic.pipeline_control_gateway_config_mode`, kept in the repository
2+
# for compatibility with existing deployments and Fleet Control support.
3+
# It should not drift from the `com.newrelic.pipeline_control_gateway_config_mode` definition!
14
namespace: newrelic
25
name: com.newrelic.pipeline_control_gateway_config
36
version: 0.1.0
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
namespace: newrelic
2+
name: com.newrelic.pipeline_control_gateway_config_mode
3+
version: 0.1.0
4+
variables:
5+
k8s:
6+
config:
7+
description: "OTel Collector configuration for the Pipeline Control Gateway"
8+
type: yaml
9+
required: true
10+
config_map_name:
11+
description: "Name of the ConfigMap that AC creates and PCG mounts as its configuration source"
12+
type: string
13+
required: false
14+
default: "pipeline-control-gateway-custom-config"
15+
deployment_name:
16+
description: "Name of the pipeline control deployment for health-checks"
17+
type: string
18+
required: false
19+
default: "pipeline-control-gateway"
20+
daemonset_name:
21+
description: "Name of the pipeline control daemonset for health-checks (used when PCG is deployed as a DaemonSet via daemonset.enabled=true)"
22+
type: string
23+
required: false
24+
default: "pipeline-control-gateway-daemonset"
25+
26+
deployment:
27+
k8s:
28+
health:
29+
interval: 30s
30+
initial_delay: 15s
31+
# Both checks coexist: PCG's chart renders either a Deployment or a DaemonSet (mutually
32+
# exclusive via daemonset.enabled). The unused workload simply isn't found by name and the
33+
# corresponding check is treated as healthy, so the agent reports healthy in both modes.
34+
checks:
35+
- namespace: ${nr-ac:namespace_agents}
36+
name: ${nr-var:deployment_name}
37+
kind: Deployment
38+
target_namespace: ${nr-ac:namespace_agents}
39+
- namespace: ${nr-ac:namespace_agents}
40+
name: ${nr-var:daemonset_name}
41+
kind: DaemonSet
42+
target_namespace: ${nr-ac:namespace_agents}
43+
objects:
44+
config:
45+
apiVersion: v1
46+
kind: ConfigMap
47+
metadata:
48+
name: ${nr-var:config_map_name}
49+
namespace: ${nr-ac:namespace_agents}
50+
data:
51+
deployment-config.yaml: |
52+
${nr-var:config}
53+
# This is required as it is also defined in:
54+
# https://github.com/newrelic/helm-charts/blob/8c3b88bdf03e600aec8a5d94bab80635b4eec671/charts/pipeline-control-gateway/templates/deployment-configmap.yaml#L7
55+
gateway-config.yaml: |
56+
reserved_melt_attributes:
57+
Metric:
58+
- interval.ms
59+
- metricName

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

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,43 @@ static AGENT_TYPE_PIPELINE_CONTROL_GATEWAY_CONFIG: LazyLock<AgentTypeValuesTestC
591591
..Default::default()
592592
});
593593

594+
static AGENT_TYPE_PIPELINE_CONTROL_GATEWAY_CONFIG_MODE: LazyLock<AgentTypeValuesTestCase> =
595+
LazyLock::new(|| AgentTypeValuesTestCase {
596+
agent_type: "newrelic/com.newrelic.pipeline_control_gateway_config_mode:0.1.0",
597+
values_k8s: AgentTypeValues {
598+
cases: HashMap::from([
599+
(
600+
"mandatory fields only",
601+
r#"
602+
config:
603+
receivers:
604+
otlp: {}
605+
"#,
606+
),
607+
(
608+
"check all value types are correct",
609+
r#"
610+
config:
611+
receivers:
612+
otlp: {}
613+
exporters:
614+
otlp:
615+
endpoint: "otlp.nr-data.net:4317"
616+
service:
617+
pipelines:
618+
traces:
619+
receivers: [otlp]
620+
exporters: [otlp]
621+
config_map_name: "my-otel-config"
622+
"#,
623+
),
624+
]),
625+
..Default::default()
626+
}
627+
.into(),
628+
..Default::default()
629+
});
630+
594631
static AGENT_TYPE_EBPF: LazyLock<AgentTypeValuesTestCase> =
595632
LazyLock::new(|| AgentTypeValuesTestCase {
596633
agent_type: "newrelic/com.newrelic.ebpf:0.1.0",
@@ -645,6 +682,7 @@ fn get_agent_type_test_cases() -> impl Iterator<Item = &'static AgentTypeValuesT
645682
&AGENT_TYPE_OTEL_COLLECTOR,
646683
&AGENT_TYPE_OTEL_COLLECTOR_OLD,
647684
&AGENT_TYPE_PIPELINE_CONTROL_GATEWAY,
685+
&AGENT_TYPE_PIPELINE_CONTROL_GATEWAY_CONFIG_MODE,
648686
&AGENT_TYPE_PIPELINE_CONTROL_GATEWAY_CONFIG,
649687
&AGENT_TYPE_EBPF,
650688
]

agent-control/src/agent_type/registry/embedded.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ pub mod tests {
137137
}
138138
}
139139

140-
const AGENT_TYPE_AMOUNT: usize = 14;
140+
const AGENT_TYPE_AMOUNT: usize = 15;
141141

142142
#[test]
143143
fn check_agent_type_amount_is_unchanged() {

test/k8s-e2e/configmap-agent/ac-values-configmap-agent.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ config:
1010
level: debug
1111
agents:
1212
gateway:
13-
agent_type: newrelic/com.newrelic.pipeline_control_gateway_config:0.1.0
13+
agent_type: newrelic/com.newrelic.pipeline_control_gateway_config_mode:0.1.0
1414
image:
1515
repository: agent-control-dev
1616
tag: e2e-test

test/k8s-e2e/configmap-agent/e2e-configmap-agent.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ scenarios:
1515
- git clone --depth=1 https://github.com/newrelic/helm-charts --branch "${FEATURE_BRANCH:-master}" /tmp/helm-charts-tmp
1616
# Install agent-control-deployment from the local clone
1717
- cd ../../../ && helm install agent-control /tmp/helm-charts-tmp/charts/agent-control-deployment --namespace newrelic --create-namespace --set global.licenseKey=${LICENSE_KEY} --set global.cluster=${SCENARIO_TAG} --values test/k8s-e2e/configmap-agent/ac-values-configmap-agent.yml --values test/k8s-e2e/configmap-agent/ac-values-configmap-agent-staging.yml --dependency-update --wait --timeout 5m
18-
# Wait for AC to create the ConfigMap via the pipeline_control_gateway_config agent type
18+
# Wait for AC to create the ConfigMap via the pipeline_control_gateway_config_mode agent type
1919
- timeout 120 bash -c 'until kubectl get configmap pcg-otel-config -n newrelic-agents 2>/dev/null; do sleep 5; done'
2020
# Install pipeline-control-gateway from the public chart, pointing it at the ConfigMap AC created
2121
- helm repo add newrelic https://helm-charts.newrelic.com && helm repo update

0 commit comments

Comments
 (0)