omni-gateway-dump
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAnalyze Gateway Dump
分析 Gateway Dump
Dump Format Reference
转储格式参考
The dump is a ZIP archive containing a directory with flat JSON files.
Each JSON file holds an array of Kubernetes-style resources with , , , , and fields.
dump/apiVersionkindmetadataspecstatusdump-<timestamp>.zip
└── dump/
├── api-instances.json # Live ApiInstance resources
├── policy-bindings.json # Live PolicyBinding resources
├── services.json # Live Service resources
├── configurations.json # Gateway Configuration (includes registration)
├── extensions.json # Policy extension definitions (may be large — skip unless needed)
└── control-node-storage.json # Gateway agent ID: {"store": "<agentId>"}Note: dumps from newer gateway versions may include additional files. Index all files found.
该转储是一个 ZIP 压缩包,内含一个 目录,其中存放扁平结构的 JSON 文件。每个 JSON 文件都包含一个 Kubernetes 风格资源数组,资源带有 、、、 和 字段。
dump/apiVersionkindmetadataspecstatusdump-<timestamp>.zip
└── dump/
├── api-instances.json # Live ApiInstance resources
├── policy-bindings.json # Live PolicyBinding resources
├── services.json # Live Service resources
├── configurations.json # Gateway Configuration (includes registration)
├── extensions.json # Policy extension definitions (may be large — skip unless needed)
└── control-node-storage.json # Gateway agent ID: {"store": "<agentId>"}注意:较新 Gateway 版本的转储可能包含额外文件。请为找到的所有文件建立索引。
Key Fields to Read Per Resource
每个资源需要读取的关键字段
- — resource identity
metadata.name - — resource scope (
metadata.namespace,default, or environment UUID)gateway - — on ApiInstances:
metadata.labels["flex.mulesoft.com/deployment-desired-status"]orSTARTEDSTOPPED - — the live deployed configuration
spec - —
status.conditionsindicates operational state[{type: "Ready", status: "True|False"}]
- — 资源标识
metadata.name - — 资源作用域(
metadata.namespace、default或环境 UUID)gateway - — 对于 ApiInstances:
metadata.labels["flex.mulesoft.com/deployment-desired-status"]或STARTEDSTOPPED - — 实时部署的配置
spec - —
status.conditions表示运行状态[{type: "Ready", status: "True|False"}]
Sample Resource Structure
资源结构示例
An ApiInstance has:
json
{
"apiVersion": "gateway.mulesoft.com/v1beta1",
"kind": "ApiInstance",
"metadata": {
"name": "apii-4808971-flex-test-api",
"namespace": "676c8822-4ae3-44c2-afd8-df46ae69f202",
"labels": {
"flex.mulesoft.com/apiinstance-id": "4808971",
"flex.mulesoft.com/apiinstance-name": "flex-test-api",
"flex.mulesoft.com/deployment-desired-status": "STARTED"
}
},
"spec": {
"address": "http://0.0.0.0:8081/",
"policies": [...]
},
"status": {
"conditions": [{"type": "Ready", "status": "True"}]
}
}A PolicyBinding has:
json
{
"apiVersion": "gateway.mulesoft.com/v1alpha1",
"kind": "PolicyBinding",
"metadata": {"name": "internal-pe-env-api-context", "namespace": "default"},
"spec": {
"targetRef": {"kind": "Selector", "selector": {"kind": "ApiInstance"}},
"policyRef": {"name": "api-context"}
},
"status": {"conditions": [{"type": "Ready", "status": "True"}]}
}A Configuration entry (for registration):
json
{
"apiVersion": "gateway.mulesoft.com/v1alpha1",
"kind": "Configuration",
"metadata": {"name": "registration"},
"spec": {
"platformConnection": {
"agentId": "3710bdd7-...",
"anypoint": "https://anypoint.mulesoft.com",
"assetName": "flex1"
}
}
}一个 ApiInstance 包含:
json
{
"apiVersion": "gateway.mulesoft.com/v1beta1",
"kind": "ApiInstance",
"metadata": {
"name": "apii-4808971-flex-test-api",
"namespace": "676c8822-4ae3-44c2-afd8-df46ae69f202",
"labels": {
"flex.mulesoft.com/apiinstance-id": "4808971",
"flex.mulesoft.com/apiinstance-name": "flex-test-api",
"flex.mulesoft.com/deployment-desired-status": "STARTED"
}
},
"spec": {
"address": "http://0.0.0.0:8081/",
"policies": [...]
},
"status": {
"conditions": [{"type": "Ready", "status": "True"}]
}
}一个 PolicyBinding 包含:
json
{
"apiVersion": "gateway.mulesoft.com/v1alpha1",
"kind": "PolicyBinding",
"metadata": {"name": "internal-pe-env-api-context", "namespace": "default"},
"spec": {
"targetRef": {"kind": "Selector", "selector": {"kind": "ApiInstance"}},
"policyRef": {"name": "api-context"}
},
"status": {"conditions": [{"type": "Ready", "status": "True"}]}
}一个 Configuration 条目(用于注册):
json
{
"apiVersion": "gateway.mulesoft.com/v1alpha1",
"kind": "Configuration",
"metadata": {"name": "registration"},
"spec": {
"platformConnection": {
"agentId": "3710bdd7-...",
"anypoint": "https://anypoint.mulesoft.com",
"assetName": "flex1"
}
}
}Analysis Checklist
分析检查清单
Step 1 — Unzip and index
第 1 步 — 解压并建立索引
Extract the dump and list all files:
bash
unzip dump.zip -d dump-analysis/
ls -la dump-analysis/dump/For each JSON file, count the resources and record in a table:
| File | Resource Count | Notes |
|---|---|---|
| api-instances.json | ||
| policy-bindings.json | ||
| services.json | ||
| configurations.json | ||
| extensions.json | Skip unless investigating a specific policy | |
| control-node-storage.json | — | Agent ID only |
If additional files are present, note them in a "Other files" section.
Also record gateway metadata from:
- Agent ID: →
control-node-storage.jsonvaluestore - Platform connection: → resource with
configurations.json→metadata.name: registration,spec.platformConnection.anypointspec.platformConnection.assetName - Dump timestamp: ZIP filename (format: )
dump-<timestamp>.zip
解压转储并列出所有文件:
bash
unzip dump.zip -d dump-analysis/
ls -la dump-analysis/dump/对于每个 JSON 文件,统计资源数量并记录在表中:
| 文件 | 资源数量 | 备注 |
|---|---|---|
| api-instances.json | ||
| policy-bindings.json | ||
| services.json | ||
| configurations.json | ||
| extensions.json | 除非正在调查特定策略,否则跳过 | |
| control-node-storage.json | — | 仅包含 Agent ID |
如果存在其他文件,请在“其他文件”部分中注明。
还要从以下位置记录 Gateway 元数据:
- Agent ID: →
control-node-storage.json值store - 平台连接: →
configurations.json的资源 →metadata.name: registration、spec.platformConnection.anypointspec.platformConnection.assetName - 转储时间戳: ZIP 文件名(格式:)
dump-<timestamp>.zip
Step 2 — Build resource inventory
第 2 步 — 构建资源清单
Read all resources from , , , and . For each, produce a comprehensive table:
api-instances.jsonpolicy-bindings.jsonservices.jsonconfigurations.json| Kind | Name | Namespace | Ready Status | Desired Status | Notes |
|---|
Populate columns:
- Ready Status: Extract from . If absent, mark as
status.conditions[type="Ready"].status.Unknown - Desired Status: For ApiInstances, extract from . For other resources, leave blank.
metadata.labels["flex.mulesoft.com/deployment-desired-status"] - Notes: Any critical field values, label context, or anomalies observed.
Sort by resource kind, then by namespace, then by name for readability.
读取 、、 和 中的所有资源。为每个资源生成一张综合表:
api-instances.jsonpolicy-bindings.jsonservices.jsonconfigurations.json| 类型 | 名称 | 命名空间 | 就绪状态 | 期望状态 | 备注 |
|---|
填充以下列:
- 就绪状态: 从 中提取。如果不存在,则标记为
status.conditions[type="Ready"].status。Unknown - 期望状态: 对于 ApiInstances,从 中提取。对于其他资源,留空。
metadata.labels["flex.mulesoft.com/deployment-desired-status"] - 备注: 记录任何关键字段值、标签上下文或观察到的异常。
为了便于阅读,按资源类型、命名空间、名称依次排序。
Step 3 — Cross-reference PolicyBindings → ApiInstances
第 3 步 — 交叉核对 PolicyBindings → ApiInstances
For each PolicyBinding in the inventory:
-
Check thefield:
spec.targetRef- If with
kind: ApiInstance: Verify thatnameexactly matches an ApiInstance inname. If no match, flag as orphaned (the policy references a non-existent API instance and will silently not apply).api-instances.json - If with
kind: Selector: The policy is global and applies to all ApiInstances. This is valid; note it in the table but do not flag as an error.selector.kind: ApiInstance - If is something else or
kindis malformed: Flag as malformed.targetRef
- If
-
For each orphaned or malformed PolicyBinding, record:
- PolicyBinding name
- Reason (e.g., "targetRef.name 'xyz' does not match any ApiInstance")
对于清单中的每个 PolicyBinding:
-
检查字段:
spec.targetRef- 如果 且包含
kind: ApiInstance: 验证name是否与name中的 ApiInstance 完全匹配。如果不匹配,则标记为孤立(该策略引用了不存在的 API 实例,并且会静默失效)。api-instances.json - 如果 且
kind: Selector: 该策略是全局策略,适用于所有 ApiInstances。这是有效情况;请在表中注明,但不要将其标记为错误。selector.kind: ApiInstance - 如果 为其他值或
kind格式错误: 标记为格式错误。targetRef
- 如果
-
对于每个孤立或格式错误的 PolicyBinding,记录:
- PolicyBinding 名称
- 原因(例如,与任何 ApiInstance 均不匹配)
targetRef.name 'xyz'
Step 4 — Cross-reference Services → ApiInstances
第 4 步 — 交叉核对 Services → ApiInstances
For each Service in :
services.json-
System services (namespaceor label
x-flex-internal) are internal gateway resources. Do not flag as potentially unused.managed-by: flex-static -
User-defined services (namespace,
gateway, or an environment UUID):default- Check if the Service name is referenced in any ApiInstance under or in any PolicyBinding.
spec.services - If not referenced by any ApiInstance or PolicyBinding, mark as potentially unused (may be a leftover from a previous deployment).
- Check if the Service name is referenced in any ApiInstance under
-
Record any potentially unused Services:
- Service name
- Namespace
- Last reference check result
对于 中的每个 Service:
services.json-
系统服务(命名空间为,或标签为
x-flex-internal)是 Gateway 内部资源。不要将其标记为可能未使用。managed-by: flex-static -
用户定义服务(命名空间为、
gateway或环境 UUID):default- 检查 Service 名称是否被任何 ApiInstance 的 或任何 PolicyBinding 引用。
spec.services - 如果没有任何 ApiInstance 或 PolicyBinding 引用,则将其标记为可能未使用(可能是上一次部署遗留的资源)。
- 检查 Service 名称是否被任何 ApiInstance 的
-
记录任何可能未使用的 Service:
- Service 名称
- 命名空间
- 最近一次引用检查结果
Step 5 — Identify anomalies
第 5 步 — 识别异常
Scan all resources for health and consistency issues:
Critical issues (block API execution):
- Resources with — extract the condition message if present.
status.conditions[type="Ready"].status: False - ApiInstances missing or with an invalid address format.
spec.address - PolicyBindings missing or
spec.targetRef.spec.policyRef - PolicyBindings with a non-existent (the referenced policy definition does not exist in
policyRef.nameor is not available).extensions.json
Warning issues (may indicate configuration drift):
- ApiInstances with but
metadata.labels["flex.mulesoft.com/deployment-desired-status"]: STOPPED(desired != actual).status.conditions[type="Ready"].status: True - Resources with missing or
metadata.namespace.metadata.labels - JSON parse errors during extraction (indicates a corrupt or incomplete dump).
扫描所有资源中的健康状态和一致性问题:
严重问题(会阻止 API 执行):
- 资源的 为
status.conditions[type="Ready"].status——如果存在 condition message,请一并提取。False - ApiInstances 缺少 ,或地址格式无效。
spec.address - PolicyBindings 缺少 或
spec.targetRef。spec.policyRef - PolicyBindings 引用了不存在的 (被引用的策略定义不存在于
policyRef.name中,或当前不可用)。extensions.json
警告问题(可能表明配置漂移):
- ApiInstances 的 为
metadata.labels["flex.mulesoft.com/deployment-desired-status"],但STOPPED为status.conditions[type="Ready"].status(期望状态与实际状态不一致)。True - 资源缺少 或
metadata.namespace。metadata.labels - 解压过程中出现 JSON 解析错误(表明转储已损坏或不完整)。
Step 6 — Compare against conf.d (if provided)
第 6 步 — 与 conf.d 进行比较(如果已提供)
If the user also provides their directory or local configuration files:
conf.d/-
Index local files: Parse all YAML or JSON files inand extract resource names, kinds, and namespaces.
conf.d/ -
In dump but not in conf.d: Resource exists in the live gateway dump but not in the user's local configuration. Possible causes:
- Resource is managed by the control plane (connected mode deployment).
- Resource is a stale deployment that was not removed from the gateway.
- User's local conf.d is out of sync with the deployed version.
-
In conf.d but not in dump: Resource is configured locally but not present in the live dump. Possible causes:
- File has a syntax error and was rejected at deploy time.
- Gateway crashed or was restarted before persisting the resource.
- Resource was manually deleted from the gateway after initial deployment.
-
Record mismatches:
- Filename/resource name
- Kind
- Status (in dump only / in conf.d only)
如果用户还提供了 目录或本地配置文件:
conf.d/-
为本地文件建立索引: 解析中的所有 YAML 或 JSON 文件,并提取资源名称、类型和命名空间。
conf.d/ -
转储中存在但 conf.d 中不存在: 资源存在于实时 Gateway 转储中,但不在用户的本地配置中。可能原因包括:
- 资源由 control plane 管理(connected mode 部署)。
- 资源是未从 Gateway 清理的陈旧部署。
- 用户的本地 conf.d 与已部署版本不同步。
-
conf.d 中存在但转储中不存在: 资源已在本地配置,但未出现在实时转储中。可能原因包括:
- 文件存在语法错误,部署时被拒绝。
- Gateway 在持久化资源之前崩溃或重启。
- 资源在首次部署后被手动删除。
-
记录不匹配项:
- 文件名或资源名称
- 类型
- 状态(仅存在于转储中/仅存在于 conf.d 中)
Step 7 — Produce dump analysis report
第 7 步 — 生成转储分析报告
Structure your findings as follows:
undefined按以下结构整理分析结果:
undefinedGateway Dump Analysis Report
Gateway Dump Analysis Report
Dump file: [filename]
Captured: [timestamp or datetime]
Gateway agent ID: [agentId from control-node-storage.json]
Dump file: [filename]
Captured: [timestamp or datetime]
Gateway agent ID: [agentId from control-node-storage.json]
Gateway Registration
Gateway Registration
- Platform URL: [from configurations.json spec.platformConnection.anypoint]
- Asset name: [from configurations.json spec.platformConnection.assetName]
- Platform URL: [from configurations.json spec.platformConnection.anypoint]
- Asset name: [from configurations.json spec.platformConnection.assetName]
Resource Inventory
Resource Inventory
[Table from Step 2]
[Table from Step 2]
Anomalies
Anomalies
Critical Issues (Ready: False or Malformed)
Critical Issues (Ready: False or Malformed)
[List each resource with its Ready status and condition message, or "None found"]
Example:
- ApiInstance (namespace
apii-123-api): Ready=False, condition: "Pod failed to start: OOMKilled"env-456 - PolicyBinding : malformed targetRef, references non-existent ApiInstance
rate-limit-bindingapii-999-api
[List each resource with its Ready status and condition message, or "None found"]
Example:
- ApiInstance (namespace
apii-123-api): Ready=False, condition: "Pod failed to start: OOMKilled"env-456 - PolicyBinding : malformed targetRef, references non-existent ApiInstance
rate-limit-bindingapii-999-api
Orphaned PolicyBindings
Orphaned PolicyBindings
[List each PolicyBinding that references a non-existent ApiInstance, or "None found"]
Example:
- PolicyBinding targets ApiInstance
deprecated-policywhich does not exist in the dumpapii-old-deployment
[List each PolicyBinding that references a non-existent ApiInstance, or "None found"]
Example:
- PolicyBinding targets ApiInstance
deprecated-policywhich does not exist in the dumpapii-old-deployment
Potentially Unused Services
Potentially Unused Services
[List each Service not referenced by any ApiInstance or PolicyBinding, or "None found"]
Example:
- Service (namespace
backend-cache): not referenced by any ApiInstancegateway
[List each Service not referenced by any ApiInstance or PolicyBinding, or "None found"]
Example:
- Service (namespace
backend-cache): not referenced by any ApiInstancegateway
Configuration Drift (conf.d vs. dump)
Configuration Drift (conf.d vs. dump)
[If conf.d was provided, show mismatches. Otherwise, note "No local configuration provided for comparison."]
Example:
- In dump only: entries not in local conf.d (possible control-plane managed resources)
configurations.json - In conf.d only: entries not in dump (possible file not deployed)
api-instances.yaml
[If conf.d was provided, show mismatches. Otherwise, note "No local configuration provided for comparison."]
Example:
- In dump only: entries not in local conf.d (possible control-plane managed resources)
configurations.json - In conf.d only: entries not in dump (possible file not deployed)
api-instances.yaml
Escalation Recommendation
Escalation Recommendation
- No anomalies: Gateway state appears healthy at the time of dump capture. No immediate action required.
- Warnings present: Configuration drift or unused resources detected. Recommend reviewing the "Potentially Unused Services" and "Configuration Drift" sections. Reconcile local conf.d with dump state.
- Critical issues present: Ready=False resources or orphaned bindings indicate active problems. Immediate escalation recommended. Provide this dump and the gateway logs (see skill) to support.
omni-gateway-logs
undefined- No anomalies: Gateway state appears healthy at the time of dump capture. No immediate action required.
- Warnings present: Configuration drift or unused resources detected. Recommend reviewing the "Potentially Unused Services" and "Configuration Drift" sections. Reconcile local conf.d with dump state.
- Critical issues present: Ready=False resources or orphaned bindings indicate active problems. Immediate escalation recommended. Provide this dump and the gateway logs (see skill) to support.
omni-gateway-logs
undefinedRelated Skills
相关 Skills
- omni-gateway-diagnose — Start here if you have an error symptom and need to decide what to investigate.
- omni-gateway-logs — Pair with the dump to correlate live state against log errors and trace request flows.
- omni-gateway-config — Compare the local configuration against this dump to identify drift or missing deployments.
conf.d/
- omni-gateway-diagnose — 如果你有错误症状且需要决定调查方向,请从这里开始。
- omni-gateway-logs — 与转储配合使用,将实时状态与日志错误关联起来,并跟踪请求流。
- omni-gateway-config — 将本地 配置与此转储进行比较,以识别配置漂移或缺失的部署。
conf.d/
Tips for Effective Dump Analysis
高效分析转储的提示
- Start with anomalies: If the report shows no critical issues, the gateway state was likely stable at capture time. Focus on warnings and drift.
- Use timestamps: Compare dump timestamp with error logs. Errors after the dump timestamp are new; errors before indicate pre-existing issues.
- Check namespaces: Resources in different namespaces may be intentional (environment isolation). Do not assume all namespaces are equivalent.
- PolicyBinding selectors: Global policies (Selector + ApiInstance) apply to all APIs. Verify that the intended policy is actually configured correctly.
- Extensions file: Only inspect if investigating a specific policy definition or if policy bindings reference undefined policies. The file is often large and can be skipped for routine analysis.
extensions.json - Agent ID: If the agent ID in the dump does not match the expected gateway agent in your Anypoint environment, the dump may be from a different gateway or a stale backup.
- 从异常开始: 如果报告未显示严重问题,则 Gateway 状态在捕获时可能稳定。关注警告和配置漂移。
- 使用时间戳: 将转储时间戳与错误日志进行比较。转储时间戳之后的错误是新出现的;之前的错误表示预先存在的问题。
- 检查命名空间: 不同命名空间中的资源可能是有意设置的(环境隔离)。不要假设所有命名空间都等价。
- PolicyBinding 选择器: 全局策略(Selector + ApiInstance)适用于所有 API。验证预期策略是否确实已正确配置。
- Extensions 文件: 仅在调查特定策略定义或 PolicyBinding 引用了未定义策略时,才检查 。该文件通常很大,例行分析时可以跳过。
extensions.json - Agent ID: 如果转储中的 Agent ID 与预期 Anypoint 环境中的 Gateway Agent 不匹配,则该转储可能来自不同的 Gateway 或陈旧备份。