DEVOPS-1973 improve stack health reporting#39
Merged
kkellerlbl merged 36 commits intomasterfrom Jul 23, 2024
Merged
Conversation
Create sqlite3 file for storing list of bad services
fix tabs
Fix path to sqlite file
use .db extension
Assume that if Rancher reports the stack is healthy, all services are currently healthy, and delete the table rows.
Add a timestamp to bad service table.
Also add serviceId to sqlite3
If all services in stack are healthy, assume stack is now healthy
scan services if stack health bad
Contributor
Pull Request ReviewGeneral FeedbackThis script checks the status of Rancher 1.x agents, stacks, and services in specified environments and creates a dummy service in a given stack if required. The code is generally well-structured but can benefit from improvements in error handling, modularity, and readability. Specific Suggestions1. Imports and Dependencies
2. Argument Parsing
3. Error Handling
4. Code Modularity
5. Logging
6. Configuration Management
7. Code Style
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Rancher 1 API doesn't report stack health very granularly. There are many legitimate reasons the stack could be degraded but still fine. (For example, a new service is being spun up right when the health check is done.)
These changes try to track specifically which services (if any) are not healthy when the stack reports unhealthy. If all services are now healthy when checked, assume the stack is too and don't throw an alarm. And if a service is unhealthy, track it in a sqlite database, and only report the stack unhealthy if there are services that have been unhealthy for longer than the
stack_health_ageparameter. This avoids the issue of two otherwise healthy services causing the entire stack to seem unhealthy for longer than that parameter.This PR also removes some old code.