Repository: nginx/kubernetes-ingress

Issue:
[Bug]: Generated nginx-agent config is incorrect for Security Monitoring environments
### Version

edge

### What Kubernetes platforms are you running on?

Kind

### Steps to reproduce

In the NIC + NAP + NIM Security Monitoring use case (https://docs.nginx.com/nginx-instance-manager/monitoring/security-monitoring/configure/set-up-app-protect-instances/), the agent config that is generated in the Helm chart is wrong. With that config, events are not properly collected and sent because of the family of metrics features we enable:

https://github.com/nginx/kubernetes-ingress/blob/eb6244cc31333646b35607d48ff699a99caa24da/charts/nginx-ingress/templates/_helpers.tpl#L588

Right now, the config file that is generated for the use case above only enables the feature `metrics-sender`, which results in the agent being ready to send events, but not collecting them. To actually collect the events we need to include the `metrics-collection` feature as well.

Alternatively, enabling `metrics` would cover both sending and receiving behaviors.

Repro:
- Deploy the Security Monitoring use case with the latest Helm chart (enable Agent, enable NAPv5).
- Integrate it with NIM.
- Generate security events. 
- Those event won't be seen in NIM.

Fix:
- Replace `metrics-sender` with `metrics` in the agent config.
- Restart the agent.
- Now, security events can be seen in NIM.

Discussion:
@github-actions: Hi @dareste thanks for reporting! 

 Be sure to check out the [docs](https://docs.nginx.com/nginx-ingress-controller) and the [Contributing Guidelines](https://github.com/nginx/kubernetes-ingress/blob/main/CONTRIBUTING.md) while you wait for a human to take a look at this :slightly_smiling_face:

 Cheers!@pdabelf5: Ran into [this](https://github.com/nginx/agent/issues/1343) while trying to replicate this bug 

Solution patch:
diff --git a/charts/nginx-ingress/templates/_helpers.tpl b/charts/nginx-ingress/templates/_helpers.tpl
index 4897fa14d..3f51e2b6a 100644
--- a/charts/nginx-ingress/templates/_helpers.tpl
+++ b/charts/nginx-ingress/templates/_helpers.tpl
@@ -585,7 +585,7 @@ tls:
 features:
   - registration
   - nginx-counting
-  - metrics-sender
+  - metrics
   - dataplane-status
 extensions:
   - nginx-app-protect



Test patch:
diff --git a/charts/tests/__snapshots__/helmunit_test.snap b/charts/tests/__snapshots__/helmunit_test.snap
index 3a12a7696..f774f48eb 100755
--- a/charts/tests/__snapshots__/helmunit_test.snap
+++ b/charts/tests/__snapshots__/helmunit_test.snap
@@ -1002,7 +1002,7 @@ data:
     features:
       - registration
       - nginx-counting
-      - metrics-sender
+      - metrics
       - dataplane-status
     extensions:
       - nginx-app-protect
@@ -1323,7 +1323,7 @@ spec:
       labels:
         app.kubernetes.io/name: nginx-ingress
         app.kubernetes.io/instance: app-protect-waf-agentv2
-        agent-configuration-revision-hash: "58428611"
+        agent-configuration-revision-hash: "df256a4f"
       annotations:
         prometheus.io/scrape: "true"
         prometheus.io/port: "9113"
@@ -2055,7 +2055,7 @@ data:
     features:
       - registration
       - nginx-counting
-      - metrics-sender
+      - metrics
       - dataplane-status
     extensions:
       - nginx-app-protect
@@ -2376,7 +2376,7 @@ spec:
       labels:
         app.kubernetes.io/name: nginx-ingress
         app.kubernetes.io/instance: app-protect-wafv5-agentv2
-        agent-configuration-revision-hash: "a8989f3a"
+        agent-configuration-revision-hash: "7f0862bf"
       annotations:
         prometheus.io/scrape: "true"
         prometheus.io/port: "9113"