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表示实例可访问,但不表示数据库状态。该端点对自托管和云用户都可用。

访问端点:

🌐 Access the endpoint:

1
<your-instance-url>/healthz

/healthz/readiness端点类似于/healthz端点,但如果数据库已连接并迁移,它将返回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

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

为自托管的 n8n 启用指标和健康信息(Enable metrics and healthz for self-hosted n8n)#

/metrics/healthz 端点默认是禁用的。要启用它们,请配置你的 n8n 实例:

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.