GET /diagnostics

获取运行时诊断信息。请注意,只有在 settings.js 文件中将 diagnostics 值设置为 enabled: true 时,运行时诊断信息才可用。

需要权限:settings.read

头部

头部
Authorization Bearer [token] - 如果启用了身份验证

响应

状态码 原因 响应
200 成功 参见示例响应体
401 未授权
{
  "report": "diagnostics",
  "scope": "basic",
  "time": {
    "utc": "Mon, 23 Jan 2023 20:15:08 GMT",
    "local": "1/23/2023, 8:15:08 PM"
  },
  "intl": {
    "locale": "en-US",
    "timeZone": "UTC"
  },
  "nodejs": {
    "version": "v16.16.0",
    "arch": "x64",
    "platform": "linux",
    "memoryUsage": {
      "rss": 106336256,
      "heapTotal": 36225024,
      "heapUsed": 33527912,
      "external": 1905248,
      "arrayBuffers": 145556
    }
  },
  "os": {
    "containerised": true,
    "wsl": false,
    "totalmem": 32841064448,
    "freemem": 28394344448,
    "arch": "x64",
    "loadavg": [
      1,
      1.01,
      0.89
    ],
    "platform": "linux",
    "release": "5.15.85-1-MANJARO",
    "type": "Linux",
    "uptime": 5554.97,
    "version": "#1 SMP PREEMPT Wed Dec 21 21:15:06 UTC 2022"
  },
  "runtime": {
    "version": "3.0.2",
    "isStarted": true,
    "flows": {
      "state": "start",
      "started": true
    },
    "modules": {
      "node-red": "3.0.2"
    },
    "settings": {
      "available": true,
      "apiMaxLength": "UNSET",
      "disableEditor": false,
      "contextStorage": {},
      "debugMaxLength": 1000,
      "editorTheme": {
        "palette": {},
        "projects": {
          "enabled": false,
          "workflow": {
            "mode": "manual"
          }
        },
        "codeEditor": {
          "lib": "ace",
          "options": {
            "theme": "vs"
          }
        }
      },
      "flowFile": "flows.json",
      "mqttReconnectTime": 15000,
      "serialReconnectTime": 15000,
      "socketReconnectTime": "UNSET",
      "socketTimeout": "UNSET",
      "tcpMsgQueueSize": "UNSET",
      "inboundWebSocketTimeout": "UNSET",
      "runtimeState": {
        "enabled": false,
        "ui": false
      },
      "adminAuth": "SET",
      "httpAdminRoot": "/",
      "httpAdminCors": "UNSET",
      "httpNodeAuth": "UNSET",
      "httpNodeRoot": "/",
      "httpNodeCors": "UNSET",
      "httpStatic": "UNSET",
      "httpStaticRoot": "UNSET",
      "httpStaticCors": "UNSET",
      "uiHost": "SET",
      "uiPort": "SET",
      "userDir": "SET",
      "nodesDir": "UNSET"
    }
  }
}

响应对象包含以下字段:

字段 描述
intl Node-RED 实例的国际化 (i8n) 语言
nodejs 基础架构 / 平台的 NodeJS 版本
os 当前内存使用的信息和操作系统统计
runtime 当前 Node-RED 运行时信息
modules Node-RED 模块及其各自版本
settings 当前 Node-RED 实例设置的详细描述