Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2c5ee325
Commit
2c5ee325
authored
Sep 26, 2019
by
Sean Arnold
Committed by
Dmitriy Zaporozhets
Sep 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop liveness check returning incorrect data
parent
c4b5c533
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
35 deletions
+9
-35
app/controllers/health_controller.rb
app/controllers/health_controller.rb
+1
-3
changelogs/unreleased/stop-liveness-check-returning-incorrect-data.yml
...released/stop-liveness-check-returning-incorrect-data.yml
+5
-0
doc/user/admin_area/monitoring/health_check.md
doc/user/admin_area/monitoring/health_check.md
+2
-19
lib/gitlab/health_checks/base_abstract_check.rb
lib/gitlab/health_checks/base_abstract_check.rb
+0
-4
spec/controllers/health_controller_spec.rb
spec/controllers/health_controller_spec.rb
+1
-4
spec/lib/gitlab/health_checks/simple_check_shared.rb
spec/lib/gitlab/health_checks/simple_check_shared.rb
+0
-5
No files found.
app/controllers/health_controller.rb
View file @
2c5ee325
...
...
@@ -20,9 +20,7 @@ class HealthController < ActionController::Base
end
def
liveness
results
=
CHECKS
.
map
{
|
check
|
[
check
.
name
,
check
.
liveness
]
}
render_check_results
(
results
)
render
json:
{
status:
'ok'
},
status: :ok
end
private
...
...
changelogs/unreleased/stop-liveness-check-returning-incorrect-data.yml
0 → 100644
View file @
2c5ee325
---
title
:
Changes response body of liveness check to be more accurate
merge_request
:
17655
author
:
type
:
changed
doc/user/admin_area/monitoring/health_check.md
View file @
2c5ee325
...
...
@@ -116,28 +116,11 @@ curl 'https://gitlab.example.com/-/liveness'
Example response:
On success, the endpoint will return a
valid successful
HTTP status code, and a response like below.
On success, the endpoint will return a
`200`
HTTP status code, and a response like below.
```
json
{
"db_check"
:{
"status"
:
"ok"
},
"redis_check"
:{
"status"
:
"ok"
},
"cache_check"
:{
"status"
:
"ok"
},
"queues_check"
:{
"status"
:
"ok"
},
"shared_state_check"
:{
"status"
:
"ok"
},
"gitaly_check"
:{
"status"
:
"ok"
}
"status"
:
"ok"
}
```
...
...
lib/gitlab/health_checks/base_abstract_check.rb
View file @
2c5ee325
...
...
@@ -15,10 +15,6 @@ module Gitlab
raise
NotImplementedError
end
def
liveness
HealthChecks
::
Result
.
new
(
true
)
end
def
metrics
[]
end
...
...
spec/controllers/health_controller_spec.rb
View file @
2c5ee325
...
...
@@ -76,10 +76,7 @@ describe HealthController do
it
'responds with liveness checks data'
do
subject
expect
(
json_response
[
'db_check'
][
'status'
]).
to
eq
(
'ok'
)
expect
(
json_response
[
'cache_check'
][
'status'
]).
to
eq
(
'ok'
)
expect
(
json_response
[
'queues_check'
][
'status'
]).
to
eq
(
'ok'
)
expect
(
json_response
[
'shared_state_check'
][
'status'
]).
to
eq
(
'ok'
)
expect
(
json_response
[
'status'
]).
to
eq
(
'ok'
)
end
end
...
...
spec/lib/gitlab/health_checks/simple_check_shared.rb
View file @
2c5ee325
...
...
@@ -58,9 +58,4 @@ shared_context 'simple_check' do |metrics_prefix, check_name, success_result|
it
{
is_expected
.
to
have_attributes
(
success:
false
,
message:
"
#{
described_class
.
human_name
}
check timed out"
)
}
end
end
describe
'#liveness'
do
subject
{
described_class
.
readiness
}
it
{
is_expected
.
to
eq
(
Gitlab
::
HealthChecks
::
Result
.
new
(
true
))
}
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment