{
  "repo": "pingcap/tidb-binlog",
  "binary": "drainer",
  "binary_path": "cmd/drainer/main.go",
  "dependencies": {
    "Runtime Drainer.serve": {
      "infrastructure": {
        "prometheus": {
          "conditions": [
            "Always when metrics scraping is enabled"
          ],
          "operations": [
            {
              "operation": "EXPOSE METRICS",
              "trigger": "Serve Prometheus metrics on the drainer HTTP listener",
              "conditions": [
                "The drainer server is running"
              ],
              "implementation": "drainer/server.go registers promhttp.Handler at /metrics"
            }
          ]
        },
        "grpc": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "SERVE BINLOG RPC",
              "trigger": "Accept or coordinate drainer gRPC traffic",
              "conditions": [
                "The drainer server is running"
              ],
              "implementation": "drainer/server.go creates a grpc.Server and serves it through cmux"
            }
          ]
        }
      },
      "services": [
        {
          "name": "pump",
          "target_repo": "pingcap/tidb-binlog",
          "protocol": "grpc",
          "target_interface": "Pump",
          "purpose": "Consume binlog events from upstream pump nodes"
        }
      ]
    }
  }
}
