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

Do not send telemetry data if failure in collection #1731

Merged
merged 6 commits into from
Mar 20, 2024

Conversation

bjee19
Copy link
Contributor

@bjee19 bjee19 commented Mar 19, 2024

Fix error handling in telemetry and usage reporting

Problem: We send empty telemetry data if there is any failure in collection of data. We also do the same for NIM usage reporting.

Solution: Don't send telemetry data in case of failure of collection. Also does not send data for NIM usage reporting if there was any failure. Refactored some tests to comply with code coverage.

Testing: Manually verified bug described in #1729 no longer occurs.

Closes #1729

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.

NONE

@bjee19 bjee19 requested a review from a team as a code owner March 19, 2024 22:49
@github-actions github-actions bot added the bug Something isn't working label Mar 19, 2024
Copy link

codecov bot commented Mar 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.16%. Comparing base (16bdfa8) to head (2cc1f28).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1731      +/-   ##
==========================================
+ Coverage   85.93%   86.16%   +0.22%     
==========================================
  Files          87       87              
  Lines        5511     5515       +4     
  Branches       52       52              
==========================================
+ Hits         4736     4752      +16     
+ Misses        723      717       -6     
+ Partials       52       46       -6     

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

Copy link
Contributor

@pleshakov pleshakov left a comment

Choose a reason for hiding this comment

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

Let's make sure the commit message and PR message adequately represent its content.

Since we're fixing two problems, we can say:

"Fix error handling in telemetry and usage reporting"

and describe both problems in the problem section.

Also, I'd recommend creating a separate issue for the problem with usage reporting. So that this commit/PR closes 2 issues.

For unexpected linting fixing, for future, better to have a separate PR -- it can be approved and merged much quicker and thus unblock other PRs and merging to main.

internal/mode/static/usage/job_worker_test.go Outdated Show resolved Hide resolved
@bjee19
Copy link
Contributor Author

bjee19 commented Mar 20, 2024

Also, I'd recommend creating a separate issue for the problem with usage reporting. So that this commit/PR closes 2 issues.

I think it'd be fine just fixing the other issue without creating an issue as its so small and related.

For unexpected linting fixing, for future, better to have a separate PR -- it can be approved and merged much quicker and thus unblock other PRs and merging to main.

Yea this sounds better I'll make sure to do this in the future!

@bjee19 bjee19 requested a review from pleshakov March 20, 2024 16:33
@pleshakov
Copy link
Contributor

@bjee19 PR message is still not updated

@bjee19 bjee19 merged commit 5b13734 into nginxinc:main Mar 20, 2024
40 checks passed
amimimor pushed a commit to amimimor/nginx-gateway-fabric that referenced this pull request Apr 3, 2024
Fix error handling in telemetry and usage reporting

Problem: We send empty telemetry data if there is any failure in collection of data. We also do the same for NIM usage reporting.

Solution: Don't send telemetry data in case of failure of collection. Also does not send data for NIM usage reporting if there was any failure. Refactored some tests to comply with code coverage.
@bjee19 bjee19 deleted the fix/dont-send-tele-data branch May 7, 2024 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Don't not send any telemetry data if telemetry collection fails
3 participants