-
Notifications
You must be signed in to change notification settings - Fork 134
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
Add service_health
view function
#2097
Conversation
ab72642
to
8d4fa9e
Compare
service_health
view functionservice_health
view function
- Add `notification` service - Update docker settings to include `NOTIFICATION_BACKENDS` - Switch `queue` service to redis
8d4fa9e
to
b92b165
Compare
513c929
to
1a9a3d3
Compare
onadata/apps/main/views.py
Outdated
# Check if cache is accessible | ||
try: | ||
cache.set('ping', 'pong') | ||
service_degraded = not (cache.get('ping') == 'pong') |
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.
Do we really want to restart a pod or create a new pod when we don't have access to the cache?
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.
I believe so; most of the processing intensive functionalities like user permission generation & other project calculations are stored and tracked using the cache. I think if their down we'd experience some impact on the service... though this is just an assumption
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.
It is better to have a degraded service than not to have one all. Because if we lose the cache we will lose the whole application, kubernetes will mark all the pod unhealthy
onadata/apps/main/urls.py
Outdated
re_path(r'^static/(?P<path>.*)$', staticfiles_views.serve), | ||
|
||
# Health check | ||
re_path(r'^service_health$', main_views.service_health) |
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.
Can we just use /health
endpoint
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.
Renamed in the latest commit
d255118
to
16a76f1
Compare
Do not return 500 response codes if the cache service is degraded
16a76f1
to
0bfc86a
Compare
Changes / Features implemented
service_health
view function/health
endpointdjango-redis
as a requirementSteps taken to verify this change does what is intended
Side effects of implementing this change
N/A
Before submitting this PR for review, please make sure you have:
Updated documentationCloses #2053