{
  "repo": "tidbcloud/topsql-agent",
  "binary": "topsql-agent",
  "binary_path": "main.go",
  "dependencies": {
    "TopSQLAgentCLI.agent": {
      "infrastructure": {
        "grpc_runtime": {
          "operations": [
            {
              "operation": "Listen on the configured agent address and serve TopSQLAgent and ResourceUsageAgent gRPC services",
              "implementation": "cmd/agent.go and internal/app/server.go"
            }
          ]
        }
      },
      "services": [
        {
          "name": "tidb",
          "protocol": "sql",
          "interface": "app.NewTiDBStore",
          "purpose": "Persist reported Top SQL metadata and usage records into the remote TiDB-backed store"
        }
      ]
    },
    "TopSQLAgentCLI.supervisor": {
      "infrastructure": {
        "process_supervision": {
          "operations": [
            {
              "operation": "Restart the child agent process and watch its health state",
              "implementation": "cmd/supervisor.go and internal/supervisor/main.go"
            }
          ]
        },
        "http_status_server": {
          "operations": [
            {
              "operation": "Expose /metrics for the agent-process health gauge",
              "implementation": "internal/supervisor/main.go"
            }
          ]
        }
      },
      "services": []
    }
  }
}
