简体   繁体   English

监控多个 GCP 环境的性能指标

[英]Monitoring Performance metrics more than one GCP environment

My requirement is to monitor performance metrics of GCP Environments.我的要求是监控 GCP 环境的性能指标。 We have to monitor more than one GCP environment (Service Account).我们必须监控多个 GCP 环境(服务帐户)。 Now Problem is how can I set the all service Accounts JSON files in Environment variable "GOOGLE_APPLICATION_CREDENTIALS".现在的问题是如何在环境变量“GOOGLE_APPLICATION_CREDENTIALS”中设置所有服务帐户 JSON 文件。

creating MetricServiceClient like below after setting JSON file in an environment variable MetricServiceClient client = MetricServiceClient.create()在环境变量 MetricServiceClient client = MetricServiceClient.create() 中设置 JSON 文件后,创建如下所示的 MetricServiceClient

Is there another way to create MetricServiceClient using credentials.是否有另一种使用凭据创建 MetricServiceClient 的方法。

I suggest you use the StackDriver Workspace and add all the GCP Project you want to monitor to that workspace.我建议您使用 StackDriver 工作区并将所有要监视的 GCP 项目添加到该工作区。 Here is the detailed guide https://cloud.google.com/monitoring/workspaces/guide .这是详细指南https://cloud.google.com/monitoring/workspaces/guide

By using a single Workspace for all GCP Project, you will have all the Metrics/Logging data in a single place and then you can use one set of credentials to access all GCP Project Monitoring data.通过为所有 GCP 项目使用单个工作区,您将在一个地方拥有所有指标/日志记录数据,然后您可以使用一组凭据访问所有 GCP 项目监控数据。

If the Single workspace is not a feasible option, then you can create a single GCP Service account and add StackDriver related permission from all the projects.如果单一工作区不是一个可行的选项,那么您可以创建一个单一的 GCP 服务帐户并添加所有项目的 StackDriver 相关权限。 Then you can use this service account to interact with Stackdriver metrics.然后,您可以使用此服务帐号与 Stackdriver 指标进行交互。

Note: Always try to use the principle of least privilege注意:始终尽量使用最小权限原则

Hope this helps.希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM