{
  "repo": "tidbcloud/serverless-metering",
  "binary": "worker",
  "binary_path": "cmd/main.go",
  "dependencies": {
    "Runtime MeteringWorker.run": {
      "description": "Reads metering data from object storage and reports usage to billing through the metering manager.",
      "infrastructure": {
        "object_storage": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "Scan stored metrics and feed report calculation",
              "trigger": "report.NewMeteringManager / initStorage",
              "implementation": "cmd/app/cmd.go"
            }
          ]
        }
      },
      "services": [
        {
          "name": "billing-service",
          "target_repo": "tidbcloud/billing",
          "target_interface": "usage reporting",
          "protocol": "http",
          "description": "Reports aggregated usage to billing."
        },
        {
          "name": "meta-server",
          "target_repo": "tidbcloud/serverless-metering",
          "target_interface": "Runtime MetaServer.run",
          "protocol": "http",
          "description": "Reads cluster and branch metadata through the meta client repo."
        }
      ]
    }
  }
}
