nightingale README

项目的 README,来自 github.com/ccfos/nightingale。合并为一个 markdown 文件:README.md。

Nightingale

Open-source alerting for your existing stack

Latest release Go Reference Coverage status Apache-2.0 license GitHub stars Docker pulls Join the Nightingale Slack community ccfos/nightingale MCP server

Quick start · Documentation · Download · Releases · Community

English | 中文 | 日本語

Nightingale brings alert rules, event processing, and notification routing into one place. Connect Prometheus, VictoriaMetrics, Elasticsearch, Loki, ClickHouse, and other data sources you already run, then deliver alerts to Slack, PagerDuty, and your team's existing tools.

Self-hosted · Apache-2.0 · Built-in AI agent · MCP server

Nightingale queries Prometheus, VictoriaMetrics, Elasticsearch, Loki, ClickHouse, and PostgreSQL, evaluates alert rules, processes events, and routes notifications to Slack, PagerDuty, Discord, Email, Telegram, and Jira. The engine includes an AI agent and MCP server.

Why Nightingale?

Quick start

With Git and Docker Compose installed, start the included evaluation stack:

git clone https://github.com/ccfos/nightingale.git
cd nightingale/docker/compose-bridge
docker compose up -d

This starts Nightingale, MySQL, Redis, VictoriaMetrics, and Categraf. Open http://localhost:17000 and sign in with root / root.2020.

To get your first alert:

  1. Connect a data source. Add your existing Prometheus-compatible endpoint, or use http://victoriametrics:8428 for the VictoriaMetrics instance in this Compose stack.
  2. Create an alert rule. Choose a business group and data source, then enter a PromQL expression. For an always-firing test, use vector(1) > 0 and set the duration to 0.
  3. Configure delivery. Set up a notification channel, create a notification rule, and attach it to the alert rule. Check that the test notification arrives, then disable the test alert.

The Compose stack uses example credentials and exposes service ports for local evaluation. Change credentials and review network access before deploying on a shared or public host. See deployment options for other ways to run Nightingale.

How it fits into your stack

Nightingale queries your data sources, evaluates alert conditions, processes events, and routes notifications. Your existing data stays in its current stores.

Keep Grafana for visualization and your on-call platform for scheduling, escalation, and incident response. Nightingale also includes dashboards for teams that want to explore data alongside their alerts.

Starting without a monitoring stack? The standalone configuration includes an optional embedded TSDB for small, single-instance deployments. Categraf is an optional collector for hosts, middleware, databases, and network devices.

Key capabilities

Capability What you can do
Alerting across data sources Use PromQL, log queries, or SQL to define conditions. Apply a rule to multiple instances of the same data source type.
Team ownership Group rules and dashboards by business group, assign team permissions, and connect OIDC, OAuth2, LDAP, or CAS for sign-in.
Event processing and routing Mute notifications, subscribe to alerts, enrich or rewrite labels, and route events through conditional pipelines.
Alert execution records Review evaluation queries and results, active and historical events, and notification delivery records.
Reusable integrations Start with bundled collector configurations, alert rules, and dashboards. Review queries and thresholds for your environment before enabling them.
Distributed evaluation Distribute rules across alerting engines and use n9e-edge to evaluate alerts close to remote data sources.

Notification integrations include Slack, PagerDuty, Discord, Email, Telegram, Mattermost, Jira, and Jira Service Management, with HTTP webhooks and scripts for custom destinations. See the native notification channel reference for configuration details.

For automated responses, connect ibex to run predefined remediation scripts when an alert fires.

Built-in AI agent

Nightingale includes an AI agent you can use directly in the web UI. The agent runs inside Nightingale, calls tools to inspect your monitoring data and configuration, and works through tasks over multiple steps.

For example:

Why did this alert fire? Check the affected host's metrics and logs around the trigger time.

Create a memory-usage alert for the production hosts and notify our team in Slack.

Configure a model endpoint to get started. The agent supports OpenAI-compatible APIs, Claude, Gemini, and compatible self-hosted models. You choose the model service and credentials; core alerting works independently of the agent.

Model provider configuration · Skill management · Bundled Skills

Connect external agents

Cursor plugin

This repository also contains a Cursor plugin that connects to the built-in MCP server of your own Nightingale deployment. The plugin uses Streamable HTTP and the same permissions as your Nightingale account.

Prepare Nightingale. Enable [HTTP.TokenAuth].Enable, leave [HTTP.A2A].Disable and DisableMCP unset or false, and create a personal token under Profile → Token management. Some Docker Compose examples disable token authentication; check the configuration you actually deploy. See MCP setup for the server configuration.

Install from a repository. In Cursor, open Customize → Plugins → Add → From Local Repository and select a checkout containing these plugin files. The n9e marketplace exposes one plugin, nightingale; choose Add to install it. .cursor-plugin/marketplace.json provides the repository installation entry. Repository imports use a Git revision, so commit the plugin files in the checkout before importing it. This also works before a public Marketplace listing exists.

To test uncommitted changes, copy the plugin configuration under Cursor's local plugin directory instead. On macOS or Linux, run these commands from the repository root:

mkdir -p ~/.cursor/plugins/local/nightingale/.cursor-plugin
cp .cursor-plugin/plugin.json ~/.cursor/plugins/local/nightingale/.cursor-plugin/
cp mcp.json ~/.cursor/plugins/local/nightingale/

Use a different folder name if another local plugin already uses that path. Cursor skips local-plugin symlinks pointing outside ~/.cursor/plugins/local. Restart Cursor or run Developer: Reload Window, then open Customize and check that the Nightingale plugin and its MCP server appear. This local installation does not depend on a Marketplace listing.

Configure your instance. Open Customize → Plugins → nightingale → Configure and set the variables below. For a team-distributed plugin, an administrator sets them under Dashboard → Plugins → Configure:

Variable Value
N9E_MCP_URL The full endpoint, such as https://n9e.example.com/mcp. Include /mcp; use the instance address reachable from the client.
N9E_TOKEN Your Nightingale personal token, sent as X-User-Token.

For a local Nightingale process, the endpoint is normally http://127.0.0.1:17000/mcp. Use HTTPS for remote connections. The manifest declares only the configuration fields; mcp.json contains placeholders. Keep the actual token in your own Cursor configuration, not in this repository. Team-distributed plugin variables are shared by the team; choose the Nightingale account and permissions for that shared connection accordingly.

Verify the connection. In Customize, enable the plugin's MCP server and check that it connects. Cursor prefixes plugin MCP names, so it may appear as plugin-nightingale-nightingale. If it stays at Connecting after you save the variables, open the MCP entry and choose Reload. List its tools, then ask:

List the business groups I can access in Nightingale.

Which alerts are firing right now? Group them by severity.

The results should match what the same user can see in Nightingale. Read tools are enabled by default; server-side write-tool configuration is described in MCP setup. A 401 response means the token is missing, invalid, or token authentication is disabled. A 404 usually means the endpoint or reverse-proxy route is wrong; it must be /mcp, not /api/n9e/mcp.

For direct client configuration or OAuth, see MCP setup. Plugin structure, configuration variables and local installation follow the Cursor plugin reference and local development guide.

Product screenshots

Manage alert rules by data source and business group:

Manage alert rules by data source and business group in Nightingale

Deployment

Option Start here
Local evaluation with Docker Compose Included Compose stack
Linux binaries for amd64 and arm64 Release downloads and configuration reference
Kubernetes Helm chart and installation instructions

For production, pin a release, configure credentials and TLS, back up the metadata database, and monitor rule evaluation and notification failures. Multiple Nightingale instances share a metadata database and Redis; use external time-series storage for a multi-instance deployment. The embedded TSDB stores data on one instance's local disk.

See the documentation, the installation guide, release notes, and security policy for further guidance and supported versions.

FAQ

Do I need to replace my collectors or move my monitoring data?

No. Nightingale can query your existing data sources directly. Keep your exporters and collectors. Categraf and the embedded TSDB are available when you need collection or local storage.

Can I import existing Prometheus alert rules?

Yes. The rule import supports Prometheus YAML, including expressions, durations, labels, and annotations. Review the converted rules and rebuild notification routing in Nightingale. Import is not a complete conversion of alertmanager.yml; run both systems during evaluation before switching notifications over.

Can I manage rules through Git and CI?

Rules can be exported as JSON and created or updated through the HTTP API, so you can build a workflow around version-controlled configuration. Nightingale does not currently provide built-in rule revision history or rollback to earlier revisions.

Is AI required, and where do model requests go?

Alerting works without AI. The built-in assistant sends prompts and the data it uses to your configured model endpoint; you can use a model hosted in your own network. External MCP clients use their own model settings. Model service credentials and usage costs are managed by you.

Does Nightingale provide on-call scheduling and escalation?

Connect an on-call platform such as PagerDuty for schedules, escalation policies, and incident response. Nightingale handles rule evaluation, event processing, and notification routing.

Community

Questions, bug reports, documentation improvements, and contributions are welcome in English.

Before submitting a pull request, read the contributing guide: code changes are discussed in an issue first and must be verified on a running instance. Please follow the Code of Conduct.

Nightingale was originally developed at DiDi and donated to CCF ODC in 2022. Learn about project governance, committers, and contributors.

Nightingale contributors

Stargazers over time

Stargazers over time

License

Nightingale is available under the Apache License 2.0.

nightingale (ccfos/nightingale)

正在搜索数据库…

这是什么?Nightingale 是一个开源的监控与告警平台,专注于生成、处理和分发告警,并对接已有的指标/日志数据源,本身不负责采集数据。
这是像 Grafana 那样的可视化工具,还是别的东西?与 Grafana 不同,Nightingale 的重点是告警引擎以及告警的处理与分发,而非可视化,不过它也包含一些仪表盘功能。
怎样才能让它跑起来并接入数据?部署 n9e 服务端,并将已有的存储后端(VictoriaMetrics、Elasticsearch、Prometheus 等)接入为数据源;推荐使用 Categraf 作为采集器,它通过 Prometheus Remote Write 协议将数据推送给 Nightingale。
我还需要单独的时序数据库和采集器吗?需要。Nightingale 本身不采集数据,因此你需要 Prometheus 或 VictoriaMetrics 这类时序数据库用于存储,并需要 Categraf 之类的采集器(或通过 Remote Write、OpenTSDB、Datadog、Falcon 协议接入其他代理)把指标送入其中。
如果我需要值班排班和告警升级,Nightingale 合适吗?不合适。README 明确建议使用 PagerDuty 或 FlashDuty 这类专门的值班产品来处理人员排班和告警升级,Nightingale 并不适合承担这些功能。
谁在生产环境中使用 Nightingale?它最初由滴滴开发并开源,2022 年捐赠给了中国计算机学会(CCF)开源发展技术委员会,这表明它已有企业级规模的应用。
它是否支持边缘或断网的数据中心?支持。它提供分布式部署模式(n9e-edge),即使边缘站点与中心服务端之间的网络中断,告警在边缘也能继续工作。
内置的 MCP 服务器有什么用?Nightingale 在 /mcp 路径下提供内置的 MCP 端点,使 Claude Code、Claude Desktop、Cursor 或 ChatGPT 连接器等 AI 助手能够用自然语言查询和管理告警与可观测性数据,无需额外部署进程。它提供 13 个工具集共 74 个细粒度工具(42 个读取、32 个写入),默认只读,除非明确开启写入权限。
MCP 端点如何进行身份验证?你可以使用在网页界面(个人资料 → 令牌管理)中创建的个人访问令牌,通过 X-User-Token 请求头发送;也可以使用 OAuth 2.1,让 Nightingale 自己作为授权服务器,或作为已有企业身份提供方(如 Keycloak、Entra ID、Okta、Auth0)的资源服务器。
它支持哪些通知渠道?Nightingale 原生支持 20 种通知媒介,包括电话、短信、邮件、钉钉和 Slack 等,并支持自定义消息模板。
它可以从哪些数据源拉取告警数据?它支持 Prometheus、Elasticsearch、Loki、ClickHouse、MySQL 和 Postgres 等数据源,同时也能通过 Remote Write、OpenTSDB、Datadog、Falcon 等协议直接接收数据。
作者
ccfos
大小
120.6 MB
星标
13.5K
时长
6年
提交 · 90 天