[英]Access GCP Managed Prometheus metrics from Grafana on Windows
I have installed Grafana (running at localhost:3000) and Prometheus (running at localhost:9090) on Windows 10, and am able to add the latter as a valid data source to the former.我在 Windows 10 上安装了 Grafana(在 localhost:3000 运行)和 Prometheus(在 localhost:9090 运行),并且能够将后者作为有效数据源添加到前者。 However, I want to create Grafana dashboards for data from Google's Managed Prometheus service.
但是,我想为来自 Google 的托管 Prometheus 服务的数据创建 Grafana 仪表板。 How do I add Google's Managed Prometheus as a data source in Grafana, running on Windows 10?
如何在 Windows 10 上运行的 Grafana 中添加 Google 的托管 Prometheus 作为数据源? Is there a way to accomplish this purely with native Windows binaries, without using Linux binaries via Docker?
有没有一种方法可以完全使用本机 Windows 二进制文件来完成此操作,而无需通过 Docker 使用 Linux 二进制文件?
I've not done this (myself yet).我还没有这样做(我自己)。
I'm also using Google's (very good) Managed Service for Prometheus.我也在使用谷歌的(非常好的)普罗米修斯托管服务。
It's reasonably well-documented Managed Prometheus: Grafana它是有据可查的托管普罗米修斯:Grafana
There's an important caveat under Authenticating Google APIs : "Google Cloud APIs all require authentication using OAuth2; however, Grafana doesn't support OAuth2 authentication for Prometheus data sources. To use Grafana with Managed Service for Prometheus, you must use the Prometheus UI as an authentication proxy. 验证 Google API下有一个重要警告:“Google Cloud API 都需要使用 OAuth2 进行身份验证;但是,Grafana 不支持 Prometheus 数据源的 OAuth2 身份验证。要将 Grafana 与 Prometheus 的托管服务一起使用,您必须使用Prometheus UI作为身份验证代理。
Step #1: use the Prometheus UI步骤#1:使用普罗米修斯用户界面
The Prometheus UI is deployed to a GKE cluster and so, if you want to use it remotely, you have a couple of options: Prometheus UI 部署到 GKE 集群,因此,如果您想远程使用它,您有几个选择:
Step #2: Hacky第 2 步:Hacky
NAMESPACE="..." # Where you deployed Prometheus UI
kubectl port-forward deployment/frontend \
--namespace=${NAMESPACE} \
${PORT}:9090
Step #3: From the host where you're running the port-forward, you should now be able to configure Grafana to use the Prometheus UI datasource on http://localhost:${PORT}
.第 3 步:从运行端口转发的主机,您现在应该能够配置 Grafana 以使用
http://localhost:${PORT}
上的 Prometheus UI 数据源。 localhost
because it's port-forwarding to your (local)host and ${PORT}
because that's the port it's using. localhost
因为它是端口转发到您的(本地)主机和${PORT}
因为这是它正在使用的端口。
Now we can connect gcp prometheus directly from grafana using service account.现在我们可以使用服务帐户直接从 grafana 连接 gcp prometheus。 Feature available from version 9.1.X
9.1.X 版提供的功能
I have tested gmp with standalone Grafana on GKE it is working well as expected.我已经在 GKE 上使用独立的 Grafana 测试了 gmp,它按预期运行良好。
https://grafana.com/docs/grafana/latest/datasources/google-cloud-monitoring/google-authentication/ https://grafana.com/docs/grafana/latest/datasources/google-cloud-monitoring/google-authentication/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.