{
  "name": "Google Cloud Monitoring",
  "type": "datasource",
  "id": "stackdriver",
  "category": "cloud",

  "metrics": true,
  "alerting": true,
  "annotations": true,
  "includes": [
    {
      "type": "dashboard",
      "name": "Data Processing Monitoring",
      "path": "dashboards/dataprocessing-monitoring.json"
    },
    {
      "type": "dashboard",
      "name": "Cloud Functions Monitoring",
      "path": "dashboards/cloudfunctions-monitoring.json"
    },
    {
      "type": "dashboard",
      "name": "GCE VM Instance Monitoring",
      "path": "dashboards/gce-vm-instance-monitoring.json"
    },
    {
      "type": "dashboard",
      "name": "GKE Prometheus Pod/Node Monitoring",
      "path": "dashboards/gke-prometheus-pod-node-monitoring.json"
    },
    {
      "type": "dashboard",
      "name": "Firewall Insights Monitoring",
      "path": "dashboards/firewall-insight-monitoring.json"
    },
    {
      "type": "dashboard",
      "name": "GCE Network Monitoring",
      "path": "dashboards/gce-network-monitoring.json"
    },
    {
      "type": "dashboard",
      "name": "HTTP/S LB Backend Services",
      "path": "dashboards/https-lb-backend-services-monitoring.json"
    },
    {
      "type": "dashboard",
      "name": "HTTP/S Load Balancer Monitoring",
      "path": "dashboards/https-loadbalancer-monitoring.json"
    },
    {
      "type": "dashboard",
      "name": "Network TCP Load Balancer Monitoring",
      "path": "dashboards/network-tcp-loadbalancer-monitoring.json"
    },
    {
      "type": "dashboard",
      "name": "MicroService Monitoring",
      "path": "dashboards/micro-service-monitoring.json"
    },
    {
      "type": "dashboard",
      "name": "Cloud Storage Monitoring",
      "path": "dashboards/cloud-storage-monitoring.json"
    },
    {
      "type": "dashboard",
      "name": "Cloud SQL Monitoring",
      "path": "dashboards/cloudsql-monitoring.json"
    },
    {
      "type": "dashboard",
      "name": "Cloud SQL(MySQL) Monitoring",
      "path": "dashboards/cloudsql-mysql-monitoring.json"
    }
  ],
  "queryOptions": {
    "maxDataPoints": true,
    "cacheTimeout": true
  },

  "info": {
    "description": "Data source for Google's monitoring service (formerly named Stackdriver)",
    "version": "1.0.0",
    "logos": {
      "small": "img/cloud_monitoring_logo.svg",
      "large": "img/cloud_monitoring_logo.svg"
    },
    "author": {
      "name": "Grafana Labs",
      "url": "https://grafana.com"
    }
  },
  "routes": [
    {
      "path": "cloudmonitoring",
      "method": "GET",
      "url": "https://monitoring.googleapis.com",
      "jwtTokenAuth": {
        "scopes": ["https://www.googleapis.com/auth/monitoring.read"],
        "params": {
          "token_uri": "{{.JsonData.tokenUri}}",
          "client_email": "{{.JsonData.clientEmail}}",
          "private_key": "{{.SecureJsonData.privateKey}}"
        }
      }
    },
    {
      "path": "cloudresourcemanager",
      "method": "GET",
      "url": "https://cloudresourcemanager.googleapis.com",
      "jwtTokenAuth": {
        "scopes": ["https://www.googleapis.com/auth/cloudplatformprojects.readonly"],
        "params": {
          "token_uri": "{{.JsonData.tokenUri}}",
          "client_email": "{{.JsonData.clientEmail}}",
          "private_key": "{{.SecureJsonData.privateKey}}"
        }
      }
    }
  ]
}
