无法使用标签在Google Cloud监控中筛选自定义指标。

huangapple go评论79阅读模式
英文:

Can't filter custom metrics in google cloud monitoring with tags

问题

我使用opencensus注册了统计信息,并通过StackDriver导出器附加了标签:

ctx, err = tag.New(ctx, tag.Upsert(key, val))
stats.Record(ctx, []stats.Measurement{csqAverage.M(m)}...)

在指标浏览器中,我可以看到指标,但无法看到或使用相关的标签进行筛选。当我通过REST API检索资源时,根本看不到标签,并且在描述指标的文档中也没有提到这种属性。然而,gcloud文档指出opencensus标签可以导出以筛选指标。

英文:

I registered stats with opencensus and attached tags thanks to a StackDriver exporter:

ctx, err = tag.New(ctx, tag.Upsert(key, val))
stats.Record(ctx, []stats.Measurement{csqAverage.M(m)}...)

In the metric explorer, I can see the metrics, but I can't see or filter with the associated tag. When I retrieve the resources thanks to the REST API, I don't see tags at all, and this kind of property is not mentionened in the documentation describing a metric. However, the gcloud documentation indicates that opencensus tag can be exported to filter the metrics.

答案1

得分: 1

TagKeys必须在注册的视图中声明。

英文:

TagKeys must be declared in the registered view.

huangapple
  • 本文由 发表于 2021年10月13日 23:54:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/69558625.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定