通过标签过滤时,云运行计费报告GCP未显示

发布于 2025-01-17 16:53:51 字数 419 浏览 1 评论 0原文

我已经在Google Cloud Run GCP中的项目中添加了标签,因此我可以查看nvim vy to n embel to to billing Report ( key:env and value:prod ) >)。无论将任何标签应用于云运行,COST表都不会显示服务,即使我没有ENV标签的任何其他云运行服务。

我尝试重新部署了一个月前的服务,但没有任何改变。

有什么想法如何解决?

下图显示了附带的标签和成本表中的问题。

“此处附加到云运行的标签”标题=“此处附加到云运行的标签”

​“ alt =”通过标签过滤时的费用表” title =“通过标签过滤时的费用表”>

I've added labels to the projects in Google Cloud Run GCP, so that I can view the cost filtered by env label to the billing report ( key: env and value: prod ). Regardless of applying any label to Cloud Run, Cost Table does not show the service, even if I do not have any other Cloud Run services without the env label.

I tried redeploying the services a month ago, but nothing changed.

Any idea how to resolve?

Below images show attached labels and the problem inside the Cost Table.

Here Labels attached to Cloud Run

Here Cost Table without filtering by label

Here Cost Table when filtering by label

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

愚人国度 2025-01-24 16:53:51

根据 Google的文档,标签必须应用于> spec.template.metadata.label

metadata.labels在服务对象上设置标签,而spec.template.metadata.label在创建的修订版中设置标签。 只有修订版中设置的标签传递给日志和计费。

重点是我的。此关键信息仅在YAML实施下提供。 Terraform选项卡简单地指出:

在您的Terraform配置中的google__cloud_run_service资源中,将以下内容添加到Template属性

metadata {
  # Labels
  # https://cloud.google.com/run/docs/configuring/labels
  labels = {
    foo : "bar"
    baz : "quux"
  }
}

查看您提出的问题,看起来您已经在服务对象上设置了标签而不是设置标签比修订。起初我也犯了同样的错误!

According to Google's documentation, the label must be applied to spec.template.metadata.label.

metadata.labels sets labels on the service object, while spec.template.metadata.label sets labels on the created revision. Only labels set on the revision are passed to logs and billing.

Emphasis mine. This key piece of information is only provided under the YAML implementation. The terraform tab simply states:

Add the following to a google_cloud_run_service resource in your Terraform configuration, under the template attribute

metadata {
  # Labels
  # https://cloud.google.com/run/docs/configuring/labels
  labels = {
    foo : "bar"
    baz : "quux"
  }
}

Looking at the issue you raised, it looks like you have set the label on the service object rather than the revision. I made the same mistake at first, too!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文