Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(basic-metrics): Remove label from basic dns and filter out IPs from linux util plugins #877

Merged
merged 9 commits into from
Oct 26, 2024

Conversation

jimassa
Copy link
Contributor

@jimassa jimassa commented Oct 19, 2024

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

  • I have read the contributing documentation.
  • I signed and signed-off the commits (git commit -S -s ...). See this documentation on signing commits.
  • I have correctly attributed the author(s) of the code.
  • I have tested the changes locally.
  • I have followed the project's style guidelines.
  • 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 file for more information on how to contribute to this project.

@jimassa jimassa changed the title fix:update dns and linux metrics fix(basic-metrics): Remove label from basic dns and filter out IPs from linux util plugins Oct 19, 2024
@jimassa jimassa marked this pull request as ready for review October 19, 2024 19:02
@jimassa jimassa requested a review from a team as a code owner October 19, 2024 19:02
pkg/plugin/dns/dns_linux.go Outdated Show resolved Hide resolved
pkg/plugin/linuxutil/netstat_stats_linux.go Outdated Show resolved Hide resolved
pkg/plugin/linuxutil/netstat_stats_linux.go Outdated Show resolved Hide resolved
@jimassa jimassa added this pull request to the merge queue Oct 25, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 25, 2024
@jimassa jimassa added this pull request to the merge queue Oct 26, 2024
Merged via the queue into microsoft:main with commit a981f53 Oct 26, 2024
23 checks passed
@jimassa jimassa deleted the jmassa/metrics_cardinality_fix branch October 26, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants