gatus

gatus

开源服务监控和告警平台

Gatus是一个开源的服务健康监控平台。它支持通过HTTP、ICMP、TCP和DNS等多种协议检查服务状态。Gatus可以灵活配置多种检查条件,如状态码、响应时间、证书有效期等。该工具集成了Slack、Teams、PagerDuty等多个告警渠道。Gatus配置简单,占用资源少,是一款功能全面的自动化服务监控工具。

Gatus健康监控状态检查警报系统DockerGithub开源项目

Gatus

test Go Report Card codecov Go version Docker pulls Follow TwiN

Gatus is a developer-oriented health dashboard that gives you the ability to monitor your services using HTTP, ICMP, TCP, and even DNS queries as well as evaluate the result of said queries by using a list of conditions on values like the status code, the response time, the certificate expiration, the body and many others. The icing on top is that each of these health checks can be paired with alerting via Slack, Teams, PagerDuty, Discord, Twilio and many more.

I personally deploy it in my Kubernetes cluster and let it monitor the status of my core applications: https://status.twin.sh/

Looking for a managed solution? Check out Gatus.io.

<details> <summary><b>Quick start</b></summary>
docker run -p 8080:8080 --name gatus twinproduction/gatus

You can also use GitHub Container Registry if you prefer:

docker run -p 8080:8080 --name gatus ghcr.io/twin/gatus

For more details, see Usage

</details>

❤ Like this project? Please consider sponsoring me.

Gatus dashboard

Have any feedback or questions? Create a discussion.

Table of Contents

Why Gatus?

Before getting into the specifics, I want to address the most common question:

Why would I use Gatus when I can just use Prometheus’ Alertmanager, Cloudwatch or even Splunk?

Neither of these can tell you that there’s a problem if there are no clients actively calling the endpoint. In other words, it's because monitoring metrics mostly rely on existing traffic, which effectively means that unless your clients are already experiencing a problem, you won't be notified.

Gatus, on the other hand, allows you to configure health checks for each of your features, which in turn allows it to monitor these features and potentially alert you before any clients are impacted.

A sign you may want to look into Gatus is by simply asking yourself whether you'd receive an alert if your load balancer was to go down right now. Will any of your existing alerts be triggered? Your metrics won’t report an increase in errors if no traffic makes it to your applications. This puts you in a situation where your clients are the ones that will notify you about the degradation of your services rather than you reassuring them that you're working on fixing the issue before they even know about it.

Features

The main features of Gatus are:

  • Highly flexible health check conditions: While checking the response status may be enough for some use cases, Gatus goes much further and allows you to add conditions on the response time, the response body and even the IP address.
  • Ability to use Gatus for user acceptance tests: Thanks to the point above, you can leverage this application to create automated user acceptance tests.
  • Very easy to configure: Not only is the configuration designed to be as readable as possible, it's also extremely easy to add a new service or a new endpoint to monitor.
  • Alerting: While having a pretty visual dashboard is useful to keep track of the state of your application(s), you probably don't want to stare at it all day. Thus, notifications via Slack, Mattermost, Messagebird, PagerDuty, Twilio, Google chat and Teams are supported out of the box with the ability to configure a custom alerting provider for any needs you might have, whether it be a different provider or a custom application that manages automated rollbacks.
  • Metrics
  • Low resource consumption: As with most Go applications, the resource footprint that this application requires is negligibly small.
  • Badges: Uptime 7d Response time 24h
  • Dark mode

Gatus dashboard conditions

Usage

<details> <summary><b>Quick start</b></summary>
docker run -p 8080:8080 --name gatus twinproduction/gatus

You can also use GitHub Container Registry if you prefer:

docker run -p 8080:8080 --name gatus ghcr.io/twin/gatus

If you want to create your own configuration, see Docker for information on how to mount a configuration file.

</details>

Here's a simple example:

endpoints: - name: website # Name of your endpoint, can be anything url: "https://twin.sh/health" interval: 5m # Duration to wait between every status check (default: 60s) conditions: - "[STATUS] == 200" # Status must be 200 - "[BODY].status == UP" # The json path "$.status" must be equal to UP - "[RESPONSE_TIME] < 300" # Response time must be under 300ms - name: make-sure-header-is-rendered url: "https://example.org/" interval: 60s conditions: - "[STATUS] == 200" # Status must be 200 - "[BODY] == pat(*<h1>Example Domain</h1>*)" # Body must contain the specified header

This example would look similar to this:

Simple example

By default, the configuration file is expected to be at config/config.yaml.

You can specify a custom path by setting the GATUS_CONFIG_PATH environment variable.

If GATUS_CONFIG_PATH points to a directory, all *.yaml and *.yml files inside said directory and its subdirectories are merged like so:

  • All maps/objects are deep merged (i.e. you could define alerting.slack in one file and alerting.pagerduty in another file)
  • All slices/arrays are appended (i.e. you can define endpoints in multiple files and each endpoint will be added to the final list of endpoints)
  • Parameters with a primitive value (e.g. debug, metrics, alerting.slack.webhook-url, etc.) may only be defined once to forcefully avoid any ambiguity
    • To clarify, this also means that you could not define alerting.slack.webhook-url in two files with different values. All files are merged into one before they are processed. This is by design.

💡 You can also use environment variables in the configuration file (e.g. $DOMAIN, ${DOMAIN})

See examples/docker-compose-postgres-storage/config/config.yaml for an example.

If you want to test it locally, see Docker.

Configuration

ParameterDescriptionDefault
debugWhether to enable debug logs.false
metricsWhether to expose metrics at /metrics.false
storageStorage configuration.{}
alertingAlerting configuration.{}
endpointsEndpoints configuration.Required []
external-endpointsExternal Endpoints configuration.[]
securitySecurity configuration.{}
disable-monitoring-lockWhether to disable the monitoring lock.false
skip-invalid-config-updateWhether to ignore invalid configuration update. <br />See Reloading configuration on the fly.false
webWeb configuration.{}
web.addressAddress to listen on.0.0.0.0
web.portPort to listen on.8080
web.read-buffer-sizeBuffer size for reading requests from a connection. Also limit for the maximum header size.8192
web.tls.certificate-fileOptional public certificate file for TLS in PEM format.``
web.tls.private-key-fileOptional private key file for TLS in PEM format.``
uiUI configuration.{}
ui.titleTitle of the document.Health Dashboard ǀ Gatus
ui.descriptionMeta description for the page.Gatus is an advanced....
ui.headerHeader at the top of the dashboard.Health Status
ui.logoURL to the logo to display.""
ui.linkLink to open when the logo is clicked.""
ui.buttonsList of buttons to display below the header.[]
ui.buttons[].nameText to display on the button.Required ""
ui.buttons[].linkLink to open when the button is clicked.Required ""
maintenanceMaintenance configuration.{}

Endpoints

Endpoints are URLs, applications, or services that you want to monitor. Each endpoint has a list of conditions that are evaluated on an interval that you define. If any condition fails, the endpoint is considered as unhealthy. You can then configure alerts to be triggered when an endpoint is unhealthy once a certain threshold is reached.

ParameterDescriptionDefault
endpointsList of endpoints to monitor.Required []
endpoints[].enabledWhether to monitor the endpoint.true
endpoints[].nameName of the endpoint. Can be anything.Required ""
endpoints[].groupGroup name. Used to group multiple endpoints together on the dashboard. <br />See Endpoint groups.""
endpoints[].urlURL to send the request to.Required ""
endpoints[].methodRequest method.GET
endpoints[].conditionsConditions used to determine the health of the endpoint. <br />See Conditions.[]
endpoints[].intervalDuration to wait between every status check.60s
endpoints[].graphqlWhether to wrap the body in a query param ({"query":"$body"}).false
endpoints[].bodyRequest body.""
endpoints[].headersRequest headers.{}
endpoints[].dnsConfiguration for an endpoint of type DNS. <br />See Monitoring an endpoint using DNS queries.""
endpoints[].dns.query-typeQuery type (e.g. MX).""
endpoints[].dns.query-nameQuery name (e.g. example.com).""
endpoints[].ssh

编辑推荐精选

蛙蛙写作

蛙蛙写作

AI小说写作助手,一站式润色、改写、扩写

蛙蛙写作—国内先进的AI写作平台,涵盖小说、学术、社交媒体等多场景。提供续写、改写、润色等功能,助力创作者高效优化写作流程。界面简洁,功能全面,适合各类写作者提升内容品质和工作效率。

AI辅助写作AI工具蛙蛙写作AI写作工具学术助手办公助手营销助手AI助手
Trae

Trae

字节跳动发布的AI编程神器IDE

Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。

AI工具TraeAI IDE协作生产力转型热门
问小白

问小白

全能AI智能助手,随时解答生活与工作的多样问题

问小白,由元石科技研发的AI智能助手,快速准确地解答各种生活和工作问题,包括但不限于搜索、规划和社交互动,帮助用户在日常生活中提高效率,轻松管理个人事务。

热门AI助手AI对话AI工具聊天机器人
Transly

Transly

实时语音翻译/同声传译工具

Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。

讯飞智文

讯飞智文

一键生成PPT和Word,让学习生活更轻松

讯飞智文是一个利用 AI 技术的项目,能够帮助用户生成 PPT 以及各类文档。无论是商业领域的市场分析报告、年度目标制定,还是学生群体的职业生涯规划、实习避坑指南,亦或是活动策划、旅游攻略等内容,它都能提供支持,帮助用户精准表达,轻松呈现各种信息。

AI办公办公工具AI工具讯飞智文AI在线生成PPTAI撰写助手多语种文档生成AI自动配图热门
讯飞星火

讯飞星火

深度推理能力全新升级,全面对标OpenAI o1

科大讯飞的星火大模型,支持语言理解、知识问答和文本创作等多功能,适用于多种文件和业务场景,提升办公和日常生活的效率。讯飞星火是一个提供丰富智能服务的平台,涵盖科技资讯、图像创作、写作辅助、编程解答、科研文献解读等功能,能为不同需求的用户提供便捷高效的帮助,助力用户轻松获取信息、解决问题,满足多样化使用场景。

热门AI开发模型训练AI工具讯飞星火大模型智能问答内容创作多语种支持智慧生活
Spark-TTS

Spark-TTS

一种基于大语言模型的高效单流解耦语音令牌文本到语音合成模型

Spark-TTS 是一个基于 PyTorch 的开源文本到语音合成项目,由多个知名机构联合参与。该项目提供了高效的 LLM(大语言模型)驱动的语音合成方案,支持语音克隆和语音创建功能,可通过命令行界面(CLI)和 Web UI 两种方式使用。用户可以根据需求调整语音的性别、音高、速度等参数,生成高质量的语音。该项目适用于多种场景,如有声读物制作、智能语音助手开发等。

咔片PPT

咔片PPT

AI助力,做PPT更简单!

咔片是一款轻量化在线演示设计工具,借助 AI 技术,实现从内容生成到智能设计的一站式 PPT 制作服务。支持多种文档格式导入生成 PPT,提供海量模板、智能美化、素材替换等功能,适用于销售、教师、学生等各类人群,能高效制作出高品质 PPT,满足不同场景演示需求。

讯飞绘文

讯飞绘文

选题、配图、成文,一站式创作,让内容运营更高效

讯飞绘文,一个AI集成平台,支持写作、选题、配图、排版和发布。高效生成适用于各类媒体的定制内容,加速品牌传播,提升内容营销效果。

热门AI辅助写作AI工具讯飞绘文内容运营AI创作个性化文章多平台分发AI助手
材料星

材料星

专业的AI公文写作平台,公文写作神器

AI 材料星,专业的 AI 公文写作辅助平台,为体制内工作人员提供高效的公文写作解决方案。拥有海量公文文库、9 大核心 AI 功能,支持 30 + 文稿类型生成,助力快速完成领导讲话、工作总结、述职报告等材料,提升办公效率,是体制打工人的得力写作神器。

下拉加载更多