简体   繁体   English

从 Windows 上的 Grafana 访问 GCP Managed Prometheus 指标

[英]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 集群,因此,如果您想远程使用它,您有几个选择:

  1. Hacky: port-forward Hacky:端口转发
  2. Better: expose it as a service更好:将其公开为服务

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.

相关问题 prometheus-kube-stack:如何在 GCP GKE - v1.21.10-gke.2000 上禁用节点导出器和 Grafana - prometheus-kube-stack: How to disable node exporters & Grafana on GCP GKE - v1.21.10-gke.2000 Prometheus 新注册表启用 HTTP 指标 - Prometheus New Registry enable HTTP Metrics 从 GCP Vertex AI Workbench 中的托管笔记本单元运行 !docker build - Run !docker build from Managed Notebook cell in GCP Vertex AI Workbench 无法将 spring 引导指标发布到 GCP 堆栈驱动程序 - Unable to publish spring boot metrics to GCP stackdriver 获取 GCP(托管)实例组的状态 - Get GCP (managed) instanced group's status 如何从端点内访问 sagemaker 模型注册表指标 - How to access sagemaker model registry metrics from within the endpoint 无法从命令终端(Windows 机器)使用 ssh 连接到 gcp - Unable to connect to gcp using ssh from command terminal (windows machine) 无法从独立的 go 应用程序访问 gcp 秘密管理器 - Not able to access gcp secret manager from standalone go application 带 SSO 的 AWS Managed Grafana - 如何在自助服务终端保持登录状态? - AWS Managed Grafana w/SSO - How to stay logged in for kiosk? 如何远程连接到 GCP ML Engine/AWS Sagemaker 托管笔记本? - How to remotely connect to GCP ML Engine/AWS Sagemaker managed notebooks?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM