promql查询不起作用&quot“ cpu_usage_value或memory_usage_value”
根据Prometheus doc:
vector1或vector2的统计,将导致一个载体,该向量包含Vector1的所有原始元素(标签集 +值)以及vector2的所有元素,它们在vector1中没有匹配的标签集
但上述查询仅返回CPU_USAGE_VALUE
PROMPENKER,赦免如果理解错误
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
或
操作员在搜索或
标签的左侧时未考虑度量名称或
。参见这些文档。有以下解决方案:
明确提及
__ name __
label(aka metric name)在标签列表中,应在其标签匹配序列时考虑到这些标签:foo或在(__ name __)bar
将返回foo
和bar
names。在:
{__ name __ =〜“ foo | bar”}
返回系列,foo
bar bar names。使用 Union> Union 功能来自MetricsQl:
in code> in ocy> in ocy> in ocy> in ofcod> in ocy> in of code> in of code> inover(foo,bar bar bar bar bar bar bar bar bar bar )
带有foo
和bar
名称的系列。请注意,该解决方案仅在Victoriametrics(我使用的类似Prometheus的系统)中起作用。它在Prometheus中不起作用:(The
or
operator doesn't take into account metric names when searching for time series on the left side ofor
with labelsets, which are missing in time series on the right side ofor
. See these docs.There are the following solutions:
To explicitly mention
__name__
label (aka metric name) in the list of labels, which should be taken into account when matching series by their labelsets:foo or on(__name__) bar
would return series with bothfoo
andbar
names.To enumerate the needed metric names in series selector regexp:
{__name__=~"foo|bar"}
returns series with bothfoo
andbar
names.To use union function from MetricsQL:
union(foo, bar)
returns series withfoo
andbar
names. Note that this solution works only in VictoriaMetrics (Prometheus-like system I work on). It doesn't work in Prometheus :(