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

Collect backendTLSPolicy and GRPCRoute Count #1954

Merged
merged 8 commits into from
May 17, 2024

Conversation

salonichf5
Copy link
Contributor

@salonichf5 salonichf5 commented May 10, 2024

Proposed changes

Problem: As a maintainer of NGF
I want to collect the GRPCRoute and BackendTLSPolicy count from all NGF/NIC installations
So that I can understand many GRPCRoute and BackendTLSPolicy are being configured using NGF.

Solution: Adding two new fields GRPCRouteCount, BackendTLSPolicyCount to telemetry data collector.

Testing: Manual Testing

No GRPCRoute and BackendPolicy is configured

{"level":"debug","ts":"2024-05-09T23:46:14Z","logger":"telemetryExporter","msg":"Exporting telemetry","data":{"ImageSource":"local","ProjectName":"NGF","ProjectVersion":"edge","ProjectArchitecture":"arm64","ClusterID":"a7992d83-18d6-4e71-a9b7-bc5327f18ba2","ClusterVersion":"1.29.2","ClusterPlatform":"kind","InstallationID":"c19e4ddd-d5dc-4a56-bb4a-68b32a8ae4c4","ClusterNodeCount":1,"FlagNames":["config","gateway","gateway-api-experimental-features","gateway-ctlr-name","gatewayclass","health-disable","health-port","help","leader-election-disable","leader-election-lock-name","metrics-disable","metrics-port","metrics-secure-serving","nginx-plus","product-telemetry-disable","service","update-gatewayclass-status","usage-report-cluster-name","usage-report-secret","usage-report-server-url","usage-report-skip-verify"],"FlagValues":["user-defined","default","true","user-defined","user-defined","false","default","false","false","user-defined","false","default","false","false","false","user-defined","true","default","default","default","false"],"GatewayCount":1,"GatewayClassCount":1,"HTTPRouteCount":1,"SecretCount":0,"ServiceCount":1,"EndpointCount":1,"GRPCRouteCount":0,"BackendTLSPolicyCount":1,"NGFReplicaCount":1}}

With 4 GRPCRoute configured following example

{"level":"debug","ts":"2024-05-09T23:57:38Z","logger":"telemetryExporter","msg":"Exporting telemetry","data":{"ImageSource":"local","ProjectName":"NGF","ProjectVersion":"edge","ProjectArchitecture":"arm64","ClusterID":"a7992d83-18d6-4e71-a9b7-bc5327f18ba2","ClusterVersion":"1.29.2","ClusterPlatform":"kind","InstallationID":"c19e4ddd-d5dc-4a56-bb4a-68b32a8ae4c4","ClusterNodeCount":1,"FlagNames":["config","gateway","gateway-api-experimental-features","gateway-ctlr-name","gatewayclass","health-disable","health-port","help","leader-election-disable","leader-election-lock-name","metrics-disable","metrics-port","metrics-secure-serving","nginx-plus","product-telemetry-disable","service","update-gatewayclass-status","usage-report-cluster-name","usage-report-secret","usage-report-server-url","usage-report-skip-verify"],"FlagValues":["user-defined","default","true","user-defined","user-defined","false","default","false","false","user-defined","false","default","false","false","false","user-defined","true","default","default","default","false"],"GatewayCount":3,"GatewayClassCount":1,"HTTPRouteCount":1,"SecretCount":0,"ServiceCount":1,"EndpointCount":1,"GRPCRouteCount":4,"BackendTLSPolicyCount":1,"NGFReplicaCount":1}}

With GRPCRoute and BackendTLSPolicy configured

{"level":"debug","ts":"2024-05-10T00:01:19Z","logger":"telemetryExporter","msg":"Exporting telemetry","data":{"ImageSource":"local","ProjectName":"NGF","ProjectVersion":"edge","ProjectArchitecture":"arm64","ClusterID":"a7992d83-18d6-4e71-a9b7-bc5327f18ba2","ClusterVersion":"1.29.2","ClusterPlatform":"kind","InstallationID":"c19e4ddd-d5dc-4a56-bb4a-68b32a8ae4c4","ClusterNodeCount":1,"FlagNames":["config","gateway","gateway-api-experimental-features","gateway-ctlr-name","gatewayclass","health-disable","health-port","help","leader-election-disable","leader-election-lock-name","metrics-disable","metrics-port","metrics-secure-serving","nginx-plus","product-telemetry-disable","service","update-gatewayclass-status","usage-report-cluster-name","usage-report-secret","usage-report-server-url","usage-report-skip-verify"],"FlagValues":["user-defined","default","true","user-defined","user-defined","false","default","false","false","user-defined","false","default","false","false","false","user-defined","true","default","default","default","false"],"GatewayCount":3,"GatewayClassCount":1,"HTTPRouteCount":1,"SecretCount":0,"ServiceCount":1,"EndpointCount":1,"GRPCRouteCount":4,"BackendTLSPolicyCount":1,"NGFReplicaCount":1}}

Closes #1615
Closes #1839

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

Release notes

If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.

Collects BackendTLSPolicy and GRPCRoute counts configured with NGINX Gateway Fabric

@salonichf5 salonichf5 requested review from a team as code owners May 10, 2024 00:03
@github-actions github-actions bot added documentation Improvements or additions to documentation enhancement New feature or request labels May 10, 2024
Copy link

codecov bot commented May 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.04%. Comparing base (59c8f50) to head (940b00a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1954      +/-   ##
==========================================
+ Coverage   87.03%   87.04%   +0.01%     
==========================================
  Files          89       89              
  Lines        6091     6096       +5     
  Branches       50       50              
==========================================
+ Hits         5301     5306       +5     
  Misses        737      737              
  Partials       53       53              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@salonichf5 salonichf5 requested a review from kate-osborn May 15, 2024 21:35
Copy link
Contributor

@kate-osborn kate-osborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@salonichf5 salonichf5 requested a review from sjberman May 15, 2024 22:53
@salonichf5 salonichf5 force-pushed the feat/enhance-telemetry branch from bd18a6e to 836a5c8 Compare May 16, 2024 22:17
@salonichf5 salonichf5 enabled auto-merge (squash) May 17, 2024 17:25
@salonichf5 salonichf5 merged commit 18c4f4c into nginxinc:main May 17, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request release-notes
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Report the Number of GRPCRoutes in Product Telemetry Collect BackendTLS Policies
6 participants