Skip to content

监控#

¥Monitoring

你可以调用三个 API 端点来检查实例状态:/healthzhealthz/readiness/metrics

¥There are three API endpoints you can call to check the status of your instance: /healthz, healthz/readiness, and /metrics.

healthz 和 healthz/readiness#

¥healthz and healthz/readiness

/healthz 端点返回一个标准的 HTTP 状态码。200 表示实例可访问。它不指示数据库状态。它适用于自托管用户和云用户。

¥The /healthz endpoint returns a standard HTTP status code. 200 indicates the instance is reachable. It doesn't indicate DB status. It's available for both self-hosted and Cloud users.

访问端点:

¥Access the endpoint:

1
<your-instance-url>/healthz

/healthz/readiness 端点与 /healthz 端点类似,但如果数据库已连接并迁移,实例已准备好接受流量,则 /healthz/readiness 端点会返回 HTTP 状态码 200。

¥The /healthz/readiness endpoint is similar to the /healthz endpoint, but it returns a HTTP status code of 200 if the DB is connected and migrated and therefore the instance is ready to accept traffic.

访问端点:

¥Access the endpoint:

1
<your-instance-url>/healthz/readiness

metrics#

/metrics 端点提供有关实例当前状态的更详细信息。

¥The /metrics endpoint provides more detailed information about the current status of the instance.

访问端点:

¥Access the endpoint:

1
<your-instance-url>/metrics

Feature availability

n8n Cloud 上不支持 /metrics 端点。

¥The /metrics endpoint isn't available on n8n Cloud.

为自托管的 n8n 启用指标和健康信息#

¥Enable metrics and healthz for self-hosted n8n

默认情况下,/metrics/healthz 端点处于禁用状态。要启用它们,请配置你的 n8n 实例:

¥The /metrics and /healthz endpoints are disabled by default. To enable them, configure your n8n instance:

1
2
3
4
# metrics
N8N_METRICS=true
# healthz
QUEUE_HEALTH_CHECK_ACTIVE=true

有关如何使用环境变量配置实例的更多信息,请参阅 配置方法

¥Refer to Configuration methods for more information on how to configure your instance using environment variables.