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

Telemetry Job #4896

Merged
merged 29 commits into from
Feb 7, 2024
Merged

Telemetry Job #4896

merged 29 commits into from
Feb 7, 2024

Conversation

shaun-nx
Copy link
Contributor

@shaun-nx shaun-nx commented Jan 10, 2024

Proposed changes

This PR adds the base telemetry job that will be responsible for collecting telemetry data for each deployment of the Ingress Controller.

The current implementation of the Job writes collected, fake data to a dummy exporter.

Tasks to gather and report specific telemetry data points are outlined here: #4877

Tests

  • Ensure only the leader pod reports data:
I0124 15:43:17.788228       1 leaderelection.go:260] successfully acquired lease nginx-ingress/nginx-ingress-leader-election
I0124 15:43:17.789698       1 leader.go:60] started leading
I0124 15:43:17.789842       1 leader.go:77] updating VirtualServer and VirtualServerRoutes status
I0124 15:43:17.791000       1 telemetry.go:104] Collecting telemetry data
I0124 15:43:17.791729       1 telemetry.go:113] Exported telemetry data

  • Ensure new leader pod start reporting if leader is lost
  • Ensure telemetry data is not reported when enable-telemetry-reporting flag is set to false
  • Ensure telemetry is reported at the period that it is configured at
  • Update Helm values to add new CLI arguments
  • Confirm telemetry is not reported when enable-telemetry-reporting it set to false in Helm values
  • Update Helm install documentation

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

@shaun-nx shaun-nx requested a review from a team as a code owner January 10, 2024 12:34
@github-actions github-actions bot added the enhancement Pull requests for new features/feature enhancements label Jan 10, 2024
@shaun-nx shaun-nx linked an issue Jan 10, 2024 that may be closed by this pull request
@shaun-nx shaun-nx added this to the v3.5.0 milestone Jan 10, 2024
Copy link

codecov bot commented Jan 10, 2024

Codecov Report

Attention: 47 lines in your changes are missing coverage. Please review.

Comparison is base (8a2c9a9) 52.32% compared to head (22ca1e8) 52.29%.
Report is 8 commits behind head on main.

❗ Current head 22ca1e8 differs from pull request most recent head cebd70c. Consider uploading reports for the commit cebd70c to get more accurate results

Files Patch % Lines
internal/telemetry/telemetry.go 61.53% 16 Missing and 4 partials ⚠️
internal/k8s/controller.go 0.00% 16 Missing ⚠️
cmd/nginx-ingress/flags.go 69.23% 4 Missing ⚠️
internal/k8s/leader.go 0.00% 4 Missing ⚠️
cmd/nginx-ingress/main.go 0.00% 2 Missing ⚠️
internal/nginx/fake_manager.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4896      +/-   ##
==========================================
- Coverage   52.32%   52.29%   -0.03%     
==========================================
  Files          61       62       +1     
  Lines       17502    17589      +87     
==========================================
+ Hits         9158     9199      +41     
- Misses       8015     8057      +42     
- Partials      329      333       +4     

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

@shaun-nx shaun-nx changed the title Feat/telemetry Telemetry Job Jan 10, 2024
cmd/nginx-ingress/main.go Outdated Show resolved Hide resolved
@ADubhlaoich
Copy link
Contributor

Should this be mentioned somewhere in user-facing documentation?

@shaun-nx
Copy link
Contributor Author

Should this be mentioned somewhere in user-facing documentation?

There will be documentation added as part of the overall implementation.
This specific piece of work is just to create the base "dummy" job. It currently doesn't actually export any data.
It still needs to be fleshed out, but the issue is tracked here: #4898

@vepatel
Copy link
Contributor

vepatel commented Jan 18, 2024

@jjngx maybe we can implement a something like https://github.com/nginxinc/nginx-gateway-fabric/blob/9f4248e0d629f7953fde17f4f03bd95034306f7f/internal/mode/static/telemetry/telemetryfakes/fake_exporter.go for completeness in unit testing

cmd/nginx-ingress/main.go Outdated Show resolved Hide resolved
jjngx and others added 3 commits February 6, 2024 11:20
Reportign param value 1 minute is set now for testing and demo purpose. It will be removed in v3.5
@github-actions github-actions bot added documentation Pull requests/issues for documentation helm_chart Pull requests that update the Helm Chart labels Feb 6, 2024
@shaun-nx shaun-nx requested review from jjngx and oseoin February 6, 2024 14:51
Copy link
Contributor

@jjngx jjngx left a comment

Choose a reason for hiding this comment

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

We need consensus on how the telemetry job time period is handled - as string (that comes at the moment from flags) or as time.Duration. If the latter, then unit tests would need to be updated.

Copy link
Contributor

@jjngx jjngx left a comment

Choose a reason for hiding this comment

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

👍🏻

@jjngx jjngx requested review from haywoodsh and removed request for vepatel February 6, 2024 19:00
@jjngx jjngx merged commit fe6759b into main Feb 7, 2024
79 checks passed
@jjngx jjngx deleted the feat/telemetry branch February 7, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Pull requests/issues for documentation enhancement Pull requests for new features/feature enhancements helm_chart Pull requests that update the Helm Chart
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Telemetry Job
7 participants