Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
cd041082
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
cd041082
编写于
4月 25, 2017
作者:
A
Achilleas Pipinellis
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '30649-update-health-check-documentation' into 'master'
Add Health Check Documentation Closes #30649 See merge request !10565
上级
a9a1f7a6
d9718f72
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
59 addition
and
17 deletion
+59
-17
doc/user/admin_area/monitoring/health_check.md
doc/user/admin_area/monitoring/health_check.md
+59
-17
未找到文件。
doc/user/admin_area/monitoring/health_check.md
浏览文件 @
cd041082
# Health Check
> [Introduced][ce-3888] in GitLab 8.8.
GitLab provides a health check endpoint for uptime monitoring on the
`health_check`
web
endpoint. The health check reports on the overall system status based on the status of
the database connection, the state of the database migrations, and the ability to write
and access the cache. This endpoint can be provided to uptime monitoring services like
[
Pingdom
][
pingdom
]
,
[
Nagios
][
nagios-health
]
, and
[
NewRelic
][
newrelic-health
]
.
>**Notes:**
-
Liveness and readiness probes were
[
introduced
][
ce-10416
]
in GitLab 9.1.
-
The
`health_check`
endpoint was
[
introduced
][
ce-3888
]
in GitLab 8.8 and will
be deprecated in GitLab 9.1. Read more in the
[
old behavior
](
#old-behavior
)
section.
GitLab provides liveness and readiness probes to indicate service health and
reachability to required services. These probes report on the status of the
database connection, Redis connection, and access to the filesystem. These
endpoints
[
can be provided to schedulers like Kubernetes
][
kubernetes
]
to hold
traffic until the system is ready or restart the container as needed.
## Access Token
An access token needs to be provided while accessing the health check endpoint. The current
accepted token can be found on the
`admin/health_check`
page of your GitLab instance.
An access token needs to be provided while accessing the probe endpoints. The current
accepted token can be found under the
**Admin area ➔ Monitoring ➔ Health check**
(
`admin/health_check`
) page of your GitLab instance.
![
access token
](
img/health_check_token.png
)
The access token can be passed as a URL parameter:
```
https://gitlab.example.com/
health_check.json
?token=ACCESS_TOKEN
https://gitlab.example.com/
-/readiness
?token=ACCESS_TOKEN
```
or as an HTTP header
:
which will then provide a report of system health in JSON format
:
```
bash
curl
--header
"TOKEN: ACCESS_TOKEN"
https://gitlab.example.com/health_check.json
```
{
"db_check": {
"status": "ok"
},
"redis_check": {
"status": "ok"
},
"fs_shards_check": {
"status": "ok",
"labels": {
"shard": "default"
}
}
}
```
## Using the Endpoint
Once you have the access token, health information can be retrieved as plain text, JSON,
or XML using the
`health_check`
endpoint:
Once you have the access token, the probes can be accessed:
-
`https://gitlab.example.com/-/readiness?token=ACCESS_TOKEN`
-
`https://gitlab.example.com/-/liveness?token=ACCESS_TOKEN`
## Status
On failure, the endpoint will return a
`500`
HTTP status code. On success, the endpoint
will return a valid successful HTTP status code, and a
`success`
message.
## Old behavior
>**Notes:**
-
Liveness and readiness probes were
[
introduced
][
ce-10416
]
in GitLab 9.1.
-
The
`health_check`
endpoint was
[
introduced
][
ce-3888
]
in GitLab 8.8 and will
be deprecated in GitLab 9.1. Read more in the
[
old behavior
](
#old-behavior
)
section.
GitLab provides a health check endpoint for uptime monitoring on the
`health_check`
web
endpoint. The health check reports on the overall system status based on the status of
the database connection, the state of the database migrations, and the ability to write
and access the cache. This endpoint can be provided to uptime monitoring services like
[
Pingdom
][
pingdom
]
,
[
Nagios
][
nagios-health
]
, and
[
NewRelic
][
newrelic-health
]
.
Once you have the
[
access token
](
#access-token
)
, health information can be
retrieved as plain text, JSON, or XML using the
`health_check`
endpoint:
-
`https://gitlab.example.com/health_check?token=ACCESS_TOKEN`
-
`https://gitlab.example.com/health_check.json?token=ACCESS_TOKEN`
...
...
@@ -54,13 +96,13 @@ would be like:
{"healthy":true,"message":"success"}
```
## Status
On failure, the endpoint will return a
`500`
HTTP status code. On success, the endpoint
will return a valid successful HTTP status code, and a
`success`
message. Ideally your
uptime monitoring should look for the success message.
[
ce-10416
]:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3888
[
ce-3888
]:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3888
[
pingdom
]:
https://www.pingdom.com
[
nagios-health
]:
https://nagios-plugins.org/doc/man/check_http.html
[
newrelic-health
]:
https://docs.newrelic.com/docs/alerts/alert-policies/downtime-alerts/availability-monitoring
[
kubernetes
]:
https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录