Project Icon

gatus

开源服务监控和告警平台

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

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.

Quick start
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

❤ 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

Quick start
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.

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.
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.
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.
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.
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
项目侧边栏1项目侧边栏2
推荐项目
Project Cover

豆包MarsCode

豆包 MarsCode 是一款革命性的编程助手,通过AI技术提供代码补全、单测生成、代码解释和智能问答等功能,支持100+编程语言,与主流编辑器无缝集成,显著提升开发效率和代码质量。

Project Cover

AI写歌

Suno AI是一个革命性的AI音乐创作平台,能在短短30秒内帮助用户创作出一首完整的歌曲。无论是寻找创作灵感还是需要快速制作音乐,Suno AI都是音乐爱好者和专业人士的理想选择。

Project Cover

白日梦AI

白日梦AI提供专注于AI视频生成的多样化功能,包括文生视频、动态画面和形象生成等,帮助用户快速上手,创造专业级内容。

Project Cover

有言AI

有言平台提供一站式AIGC视频创作解决方案,通过智能技术简化视频制作流程。无论是企业宣传还是个人分享,有言都能帮助用户快速、轻松地制作出专业级别的视频内容。

Project Cover

Kimi

Kimi AI助手提供多语言对话支持,能够阅读和理解用户上传的文件内容,解析网页信息,并结合搜索结果为用户提供详尽的答案。无论是日常咨询还是专业问题,Kimi都能以友好、专业的方式提供帮助。

Project Cover

讯飞绘镜

讯飞绘镜是一个支持从创意到完整视频创作的智能平台,用户可以快速生成视频素材并创作独特的音乐视频和故事。平台提供多样化的主题和精选作品,帮助用户探索创意灵感。

Project Cover

讯飞文书

讯飞文书依托讯飞星火大模型,为文书写作者提供从素材筹备到稿件撰写及审稿的全程支持。通过录音智记和以稿写稿等功能,满足事务性工作的高频需求,帮助撰稿人节省精力,提高效率,优化工作与生活。

Project Cover

阿里绘蛙

绘蛙是阿里巴巴集团推出的革命性AI电商营销平台。利用尖端人工智能技术,为商家提供一键生成商品图和营销文案的服务,显著提升内容创作效率和营销效果。适用于淘宝、天猫等电商平台,让商品第一时间被种草。

Project Cover

AIWritePaper论文写作

AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。

投诉举报邮箱: service@vectorlightyear.com
@2024 懂AI·鲁ICP备2024100362号-6·鲁公网安备37021002001498号