<p>I'm trying to integrate Grafana with managed prometheus service provided by Kubernetes Engine in GCP.</p>
<p>I configured Managed Prometheus service and I'm able see the metrics well, but I'm not able to integrate the managed prometheus service with Grafana <strong>on the same kubernetes cluster</strong>.</p>
<p>Below one is the managed prometheus metrics that are available.</p>
<p><a href="https://i.stack.imgur.com/IM9lJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IM9lJ.png" alt="enter image description here" /></a></p>
<p>I believe without endpoint URL, we cannot create Grafana dashboard.
The issue is with creating the endpoint for managed prometheus on GKE.</p>
<p><a href="https://i.stack.imgur.com/AxKXH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AxKXH.png" alt="enter image description here" /></a></p>
<p>I crawled all the web but couldn't find a way to create endpoint for managed prometheus for GKE.
Can you please confirm me that is it actually possible to create an endpoint for Managed Prometheus for GKE cluster? if yes, can you please guide me how to grab that endpoint URL.</p>
<p>Thanks in advance.</p>

Sampath
<p>You need to deploy the <a href="https://cloud.google.com/stackdriver/docs/managed-prometheus/manifests#expandable-6" rel="nofollow noreferrer">frontend</a> service.  More details on using Grafana with Managed Prometheus can be found <a href="https://cloud.google.com/stackdriver/docs/managed-prometheus/query#ui-grafana" rel="nofollow noreferrer">here</a>, but here's the manifest:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: frontend
spec:
  replicas: 2
  selector:
    matchLabels:
      app: frontend
  template:
    metadata:
      labels:
        app: frontend
    spec:
      automountServiceAccountToken: true
      nodeSelector:
        kubernetes.io/os: linux
        kubernetes.io/arch: amd64
      containers:
      - name: frontend
        image: &quot;gke.gcr.io/prometheus-engine/frontend:v0.5.0-gke.0&quot;
        args:
        - &quot;--web.listen-address=:9090&quot;
        - &quot;--query.project-id=$PROJECT_ID&quot;
        ports:
        - name: web
          containerPort: 9090
        readinessProbe:
          httpGet:
            path: /-/ready
            port: web
        livenessProbe:
          httpGet:
            path: /-/healthy
            port: web
---
apiVersion: v1
kind: Service
metadata:
  name: frontend
spec:
  clusterIP: None
  selector:
    app: frontend
  ports:
  - name: web
    port: 9090
</code></pre>
