-
Notifications
You must be signed in to change notification settings - Fork 6
CognitePusher metrics upload fix #495
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
Conversation
Summary of ChangesHello @devendra-lohar, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the robustness of the CognitePusher by addressing a critical issue where it failed to handle Prometheus metrics registered after its initial setup. By integrating the TimeSeriesUploadQueue and implementing a dynamic time series creation factory, the system can now seamlessly accommodate metrics that appear at any point during its lifecycle, preventing data loss and improving overall reliability. The changes are backed by new integration tests to ensure correct functionality across various scenarios. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request correctly fixes a bug where metrics registered after CognitePusher initialization were not being handled, leading to errors on shutdown. The change to use TimeSeriesUploadQueue with a factory for creating missing timeseries is a robust solution. The new integration tests are comprehensive and cover various scenarios, including late registration and shutdown pushes. My review focuses on improving the robustness of the new integration tests to prevent potential flakiness.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #495 +/- ##
==========================================
+ Coverage 80.89% 80.98% +0.09%
==========================================
Files 43 43
Lines 4197 4203 +6
==========================================
+ Hits 3395 3404 +9
+ Misses 802 799 -3
🚀 New features to boost your workflow:
|
nithinb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes LGTM
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request effectively addresses a bug where metrics registered after CognitePusher initialization were not being handled, by refactoring the push logic to use TimeSeriesUploadQueue with a factory for on-demand timeseries creation. The changes are well-supported by new integration tests. My review focuses on improving the robustness of these new tests and strengthening the unit test coverage for the new error handling path.
|
I think this comment from gemini (about flaky tests) makes sense: #495 (comment) the other (about unit tests) is up to you |
|
🦄 |
This PR solves the bug where CognitePusher fails to create timeseries for Prometheus default GC/python_info metrics registered after startup, causing “Time series not found” during shutdown push.
The changes now uses TimeSeriesUploadQueue to register metrics timeseries to upload queue with custom missing factory which creates the timeseries when needed i.e on shutdown or when push is called explicitly. This ensures any metrics registered after CognitePusher initialization are also tracked and missing timeseries are created for them too.
The PR also adds relevant integration tests to support multiple scenarios.
https://cognitedata.atlassian.net/jira/software/c/projects/DOG/boards/686?selectedIssue=DOG-6528