Skip to content

Commit 96a4424

Browse files
authored
Disable sending telemetry in tests (#1714)
Problem: b6cb677 enabled product telemetry reporting. However, the telemetry is also reported when running tests, which we want to avoid, so that the gathered telemetry doesn't include data from our test runs. Solution: Disable telemetry for: - Conformance tests - Helm chart - NFR and functional tests CLOSES - #1705 Testing: - To be confirmed by the pipeline - Ran telemetry functional test manually successfully. - Ran NGR test successfully on GCP. No telemetry were reported, confirmed on the telemetry receiver side. (Note. Upgrade test failed with "Error: INSTALLATION FAILED: release name "": no name provided" error. However, this was not caused by this commit and out of scope of this commit)
1 parent 3296354 commit 96a4424

File tree

5 files changed

+20
-4
lines changed

5 files changed

+20
-4
lines changed

.github/workflows/ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ jobs:
301301
--set nginxGateway.image.repository=ghcr.io/nginxinc/nginx-gateway-fabric
302302
--set nginxGateway.image.tag=${{ steps.ngf-meta.outputs.version }}
303303
--set nginxGateway.image.pullPolicy=Never
304+
--set nginxGateway.productTelemetry.enable=false
304305
--set nginx.image.repository=ghcr.io/nginxinc/nginx-gateway-fabric/nginx
305306
--set nginx.image.tag=${{ steps.nginx-meta.outputs.version }}
306307
--set nginx.image.pullPolicy=Never

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ generate-manifests: ## Generate manifests using Helm.
110110
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) $(HELM_TEMPLATE_EXTRA_ARGS_FOR_ALL_MANIFESTS_FILE) --set nginx.plus=true --set nginx.image.repository=$(NGINX_PLUS_PREFIX) -n nginx-gateway | cat $(strip $(MANIFEST_DIR))/namespace.yaml - > $(strip $(MANIFEST_DIR))/nginx-plus-gateway.yaml
111111
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) $(HELM_TEMPLATE_EXTRA_ARGS_FOR_ALL_MANIFESTS_FILE) --set nginxGateway.gwAPIExperimentalFeatures.enable=true -n nginx-gateway | cat $(strip $(MANIFEST_DIR))/namespace.yaml - > $(strip $(MANIFEST_DIR))/nginx-gateway-experimental.yaml
112112
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) $(HELM_TEMPLATE_EXTRA_ARGS_FOR_ALL_MANIFESTS_FILE) --set nginxGateway.gwAPIExperimentalFeatures.enable=true --set nginx.plus=true --set nginx.image.repository=$(NGINX_PLUS_PREFIX) -n nginx-gateway | cat $(strip $(MANIFEST_DIR))/namespace.yaml - > $(strip $(MANIFEST_DIR))/nginx-plus-gateway-experimental.yaml
113-
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) --set metrics.enable=false -n nginx-gateway -s templates/deployment.yaml > conformance/provisioner/static-deployment.yaml
113+
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) --set metrics.enable=false --set nginxGateway.productTelemetry.enable=false -n nginx-gateway -s templates/deployment.yaml > conformance/provisioner/static-deployment.yaml
114114
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) -n nginx-gateway -s templates/service.yaml > $(strip $(MANIFEST_DIR))/service/loadbalancer.yaml
115115
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) --set service.annotations.'service\.beta\.kubernetes\.io\/aws-load-balancer-type'="nlb" -n nginx-gateway -s templates/service.yaml > $(strip $(MANIFEST_DIR))/service/loadbalancer-aws-nlb.yaml
116116
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) --set service.type=NodePort --set service.externalTrafficPolicy="" -n nginx-gateway -s templates/service.yaml > $(strip $(MANIFEST_DIR))/service/nodeport.yaml

conformance/provisioner/static-deployment.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ spec:
3131
- --metrics-disable
3232
- --health-port=8081
3333
- --leader-election-lock-name=nginx-gateway-leader-election
34+
- --product-telemetry-disable
3435
env:
3536
- name: POD_IP
3637
valueFrom:

tests/framework/ngf.go

+13-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,13 @@ func UninstallGatewayAPI(apiVersion, k8sVersion string) ([]byte, error) {
108108
// InstallNGF installs NGF.
109109
func InstallNGF(cfg InstallationConfig, extraArgs ...string) ([]byte, error) {
110110
args := []string{
111-
"install", cfg.ReleaseName, cfg.ChartPath, "--create-namespace", "--namespace", cfg.Namespace, "--wait",
111+
"install",
112+
cfg.ReleaseName,
113+
cfg.ChartPath,
114+
"--create-namespace",
115+
"--namespace", cfg.Namespace,
116+
"--wait",
117+
"--set", "nginxGateway.productTelemetry.enable=false",
112118
}
113119

114120
args = append(args, setImageArgs(cfg)...)
@@ -125,7 +131,12 @@ func UpgradeNGF(cfg InstallationConfig, extraArgs ...string) ([]byte, error) {
125131
}
126132

127133
args := []string{
128-
"upgrade", cfg.ReleaseName, cfg.ChartPath, "--namespace", cfg.Namespace, "--wait",
134+
"upgrade",
135+
cfg.ReleaseName,
136+
cfg.ChartPath,
137+
"--namespace", cfg.Namespace,
138+
"--wait",
139+
"--set", "nginxGateway.productTelemetry.enable=false",
129140
}
130141

131142
args = append(args, setImageArgs(cfg)...)

tests/suite/telemetry_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ var _ = Describe("Telemetry test with OTel collector", Label("telemetry"), func(
3030
// Install NGF
3131
// Note: the BeforeSuite call doesn't install NGF for 'telemetry' label
3232

33-
setup(getDefaultSetupCfg())
33+
setup(
34+
getDefaultSetupCfg(),
35+
"--set", "nginxGateway.productTelemetry.enable=true",
36+
)
3437
})
3538

3639
AfterEach(func() {

0 commit comments

Comments
 (0)