{
  "repo": "tidbcloud/dbaas",
  "binary": "scrape_gateway",
  "binary_path": "metrics/cmd/scrape_gateway/main.go",
  "surface_kind": "http_service",
  "type": "http_service",
  "services": [
    {
      "name": "HTTPService",
      "port": "configurable (default :8080)",
      "methods": [
        {"name": "GET /ping", "name_key": "HTTP GET /ping", "input": "-", "output": "string: pong", "description": "Health check endpoint for Kubernetes"},
        {"name": "GET /healthz", "name_key": "HTTP GET /healthz", "input": "-", "output": "string: pong", "description": "Health check endpoint for Kubernetes"},
        {"name": "GET /metrics", "name_key": "HTTP GET /metrics", "input": "-", "output": "prometheus metrics", "description": "Built-in Prometheus metrics for the service itself"},
        {"name": "GET /public_api/v1/clusters/:cluster_id/monitoring/measurements", "name_key": "HTTP GET /public_api/v1/clusters/:cluster_id/monitoring/measurements", "input": "cluster_id (URI param), Authorization header (Bearer token)", "output": "text/plain; prometheus exposition format", "description": "Query metrics for a specific cluster (legacy cluster-level endpoint)"},
        {"name": "GET /public_api/v1/projects/:project_id/metrics", "name_key": "HTTP GET /public_api/v1/projects/:project_id/metrics", "input": "project_id (URI param), Authorization header (Bearer token)", "output": "text/plain; prometheus exposition format", "description": "Query metrics for all clusters in a project"}
      ]
    }
  ],
  "extensions": {
    "notes": [
      "Metrics gateway service that aggregates cluster metrics from Thanos, Shoot Prometheus, and MetaDB."
    ]
  }
}
