{
  "repo": "tidbcloud/gcp-quota-exporter",
  "binary": "gcp-quota-exporter",
  "binary_path": "main.go",
  "dependencies": {
    "HTTP GET /": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /metrics": {
      "infrastructure": {
        "gcp_compute_api": {
          "conditions": [
            "Always during Prometheus scrapes"
          ],
          "operations": [
            {
              "operation": "Fetch project quota limits and usage",
              "trigger": "Prometheus scrapes the exporter metrics endpoint",
              "implementation": "Exporter.Collect calls service.Projects.Get(project).Do() and service.Regions.List(project).Do() through google.golang.org/api/compute/v1"
            }
          ]
        },
        "gcp_metadata": {
          "conditions": [
            "Only when GOOGLE_PROJECT_ID and credentials project_id are both absent"
          ],
          "operations": [
            {
              "operation": "Discover the current GCP project ID from the metadata service",
              "trigger": "Startup path when project ID is not provided explicitly",
              "implementation": "GetProjectIdFromMetadata uses metadata.NewClient(...).ProjectID()"
            }
          ]
        },
        "google_application_credentials": {
          "conditions": [
            "When GOOGLE_APPLICATION_CREDENTIALS is set"
          ],
          "operations": [
            {
              "operation": "Load project_id and ADC credentials from the JSON key file",
              "trigger": "Startup path before exporter initialization",
              "implementation": "main reads GOOGLE_APPLICATION_CREDENTIALS and NewExporter uses google.DefaultClient with compute.ComputeReadonlyScope"
            }
          ]
        }
      },
      "services": []
    }
  }
}
