Commit a981f53
authored
fix(basic-metrics): Remove label from basic dns and filter out IPs from linux util plugins (#877)
# Description
This PR addresses the cardinality issue in two basic plugins. By
removing the label from basic dns and excluding localhost and node ip
from linux util plugin tcp_connection_remote.
It also adds a check in the e2e to validate metrics without checking
specific labels.
## Related Issue
https://github.com/azure-networking/retina-enterprise/issues/263
https://github.com/azure-networking/retina-enterprise/issues/272
## Checklist
- [x] I have read the [contributing
documentation](https://retina.sh/docs/contributing).
- [x] I signed and signed-off the commits (`git commit -S -s ...`). See
[this
documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification)
on signing commits.
- [x] I have correctly attributed the author(s) of the code.
- [x] I have tested the changes locally.
- [x] I have followed the project's style guidelines.
- [x] I have updated the documentation, if necessary.
- [ ] I have added tests, if applicable.
## Screenshots (if applicable) or Testing Completed
Please add any relevant screenshots or GIFs to showcase the changes
made.
```
# TYPE networkobservability_dns_request_count counter
networkobservability_dns_request_count 80
# HELP networkobservability_dns_response_count DNS responses by statistics
# TYPE networkobservability_dns_response_count counter
networkobservability_dns_response_count 50
# TYPE networkobservability_adv_dns_request_count counter
networkobservability_adv_dns_request_count{ip="10.224.3.111",namespace="kube-system-test",podname="agnhost-adv-dns-port-forward-7215873926146132341-0",query="some.non.existent.domain.",query_type="A",workload_kind="StatefulSet",workload_name="agnhost-adv-dns-port-forward-7215873926146132341"} 30
# TYPE networkobservability_adv_dns_response_count counter
networkobservability_adv_dns_response_count{ip="10.224.3.111",namespace="kube-system-test",num_response="0",podname="agnhost-adv-dns-port-forward-7215873926146132341-0",query="some.non.existent.domain.",query_type="A",response="",return_code="NXDOMAIN",workload_kind="StatefulSet",workload_name="agnhost-adv-dns-port-forward-7215873926146132341"} 19
```
Before, nodeIP is 10.224.2.241
```
# TYPE networkobservability_tcp_connection_remote gauge
# TYPE networkobservability_tcp_connection_remote gauge
networkobservability_tcp_connection_remote{address="0.0.0.0",port="0"} 11
**networkobservability_tcp_connection_remote{address="10.224.2.241",port="29613"} 0**
networkobservability_tcp_connection_remote{address="10.224.2.255",port="9090"} 5
networkobservability_tcp_connection_remote{address="10.224.3.2",port="9090"} 1
networkobservability_tcp_connection_remote{address="10.224.3.206",port="8082"} 1
networkobservability_tcp_connection_remote{address="10.224.3.62",port="9090"} 4
networkobservability_tcp_connection_remote{address="104.208.181.172",port="443"} 4
**networkobservability_tcp_connection_remote{address="127.0.0.1",port="50678"} 0
networkobservability_tcp_connection_remote{address="127.0.0.1",port="50684"} 0
networkobservability_tcp_connection_remote{address="127.0.0.1",port="50694"} 0
networkobservability_tcp_connection_remote{address="127.0.0.1",port="55960"} 0**
networkobservability_tcp_connection_remote{address="13.107.246.41",port="443"} 0
networkobservability_tcp_connection_remote{address="150.171.69.10",port="443"} 0
networkobservability_tcp_connection_remote{address="168.63.129.16",port="80"} 0
networkobservability_tcp_connection_remote{address="169.254.169.254",port="80"} 68
networkobservability_tcp_connection_remote{address="20.190.151.68",port="443"} 0
networkobservability_tcp_connection_remote{address="20.209.154.1",port="443"} 0
networkobservability_tcp_connection_remote{address="20.209.155.1",port="443"} 0
networkobservability_tcp_connection_remote{address="20.209.179.65",port="443"} 5
networkobservability_tcp_connection_remote{address="20.36.150.0",port="443"} 0
networkobservability_tcp_connection_remote{address="4.150.240.10",port="443"} 0
networkobservability_tcp_connection_remote{address="40.64.135.140",port="443"} 0
networkobservability_tcp_connection_remote{address="52.179.73.37",port="443"} 0
networkobservability_tcp_connection_remote{address="52.179.73.39",port="443"} 0
networkobservability_tcp_connection_remote{address="52.188.247.147",port="443"} 0
networkobservability_tcp_connection_remote{address="52.253.71.198",port="443"} 4
# HELP networkobservability_tcp_connection_stats TCP connections statistics
```
after. No nodeIP or localhost
```
# TYPE networkobservability_tcp_connection_remote gauge
networkobservability_tcp_connection_remote{address="0.0.0.0",port="0"} 11
networkobservability_tcp_connection_remote{address="10.224.2.255",port="9090"} 5
networkobservability_tcp_connection_remote{address="10.224.3.2",port="9090"} 2
networkobservability_tcp_connection_remote{address="10.224.3.206",port="8082"} 2
networkobservability_tcp_connection_remote{address="10.224.3.62",port="9090"} 2
networkobservability_tcp_connection_remote{address="104.208.181.172",port="443"} 1
networkobservability_tcp_connection_remote{address="168.63.129.16",port="80"} 1
networkobservability_tcp_connection_remote{address="169.254.169.254",port="80"} 68
networkobservability_tcp_connection_remote{address="20.209.179.65",port="443"} 2
networkobservability_tcp_connection_remote{address="40.64.135.140",port="443"} 0
networkobservability_tcp_connection_remote{address="52.179.73.38",port="443"} 0
networkobservability_tcp_connection_remote{address="52.188.247.151",port="443"} 1
networkobservability_tcp_connection_remote{address="52.253.71.198",port="443"} 5
# HELP networkobservability_tcp_connection_stats TCP connections statistics
```
## Additional Notes
Add any additional notes or context about the pull request here.
---
Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more
information on how to contribute to this project.1 parent 59acc85 commit a981f53
File tree
8 files changed
+47
-31
lines changed- pkg
- metrics
- plugin
- dns
- linuxutil
- test/e2e
- framework/prometheus
- scenarios
- dns
- tcp
8 files changed
+47
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
138 | 137 | | |
139 | 138 | | |
140 | 139 | | |
141 | 140 | | |
142 | 141 | | |
143 | | - | |
144 | 142 | | |
145 | 143 | | |
146 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
| |||
96 | 94 | | |
97 | 95 | | |
98 | 96 | | |
99 | | - | |
100 | | - | |
101 | | - | |
| 97 | + | |
102 | 98 | | |
103 | 99 | | |
104 | | - | |
105 | 100 | | |
106 | 101 | | |
107 | | - | |
108 | 102 | | |
109 | 103 | | |
110 | 104 | | |
| 105 | + | |
111 | 106 | | |
112 | 107 | | |
113 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
25 | 40 | | |
26 | 41 | | |
27 | 42 | | |
| |||
196 | 211 | | |
197 | 212 | | |
198 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
199 | 217 | | |
200 | 218 | | |
201 | 219 | | |
| |||
275 | 293 | | |
276 | 294 | | |
277 | 295 | | |
278 | | - | |
279 | | - | |
280 | | - | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
281 | 301 | | |
282 | 302 | | |
283 | 303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
339 | 340 | | |
340 | 341 | | |
341 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
342 | 346 | | |
343 | 347 | | |
344 | 348 | | |
| |||
363 | 367 | | |
364 | 368 | | |
365 | 369 | | |
366 | | - | |
| 370 | + | |
367 | 371 | | |
368 | 372 | | |
369 | 373 | | |
| |||
372 | 376 | | |
373 | 377 | | |
374 | 378 | | |
375 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
376 | 384 | | |
377 | 385 | | |
378 | 386 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
86 | 92 | | |
87 | 93 | | |
88 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 27 | + | |
31 | 28 | | |
32 | 29 | | |
33 | 30 | | |
| |||
61 | 58 | | |
62 | 59 | | |
63 | 60 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 61 | + | |
71 | 62 | | |
72 | 63 | | |
73 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
| 24 | + | |
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
| |||
32 | 30 | | |
33 | 31 | | |
34 | 32 | | |
35 | | - | |
| 33 | + | |
36 | 34 | | |
37 | 35 | | |
38 | 36 | | |
| |||
0 commit comments