小编Kre*_*zon的帖子

我可以在Python中设置Prometheus标签的默认值吗?

我正在使用官方 python (2.7) 客户端。

我想用一些标签定义一个指标,但我并不总是让它们发送所有标签。当我只发送其中一些时,我收到错误:

AttributeError:“计数器”对象没有属性“_value”

这是我使用的代码:

c = Counter("counterTest, "explain this counter, labelnames=("label1", "label2",), namespace="namespace") 
c.labels(label1="1").inc(1)
Run Code Online (Sandbox Code Playgroud)

这是 python 库的限制吗?或者这可能是 Prometheus 端的限制?

python python-2.7 prometheus

7
推荐指数
1
解决办法
4933
查看次数

标签 统计

prometheus ×1

python ×1

python-2.7 ×1