Prometheus 关于普罗米修斯如何根据特定标签提取度量
团队 我形成了一个查询,也有结果,但无法通过标签对其进行进一步过滤 我想根据装入点/和/raid进一步筛选结果。。我该怎么办? 质疑 输出Prometheus 关于普罗米修斯如何根据特定标签提取度量,prometheus,Prometheus,团队 我形成了一个查询,也有结果,但无法通过标签对其进行进一步过滤 我想根据装入点/和/raid进一步筛选结果。。我该怎么办? 质疑 输出 {device="/dev/sdb1",instance="101.1.1.1:1401",mountpoint="/raid",namespace="monitoring",node="team11",pod="prometheus-node-ex
{device="/dev/sdb1",instance="101.1.1.1:1401",mountpoint="/raid",namespace="monitoring",node="team11",pod="prometheus-node-exporter-dcp-173-4l2dr"}
{device="/dev/sdb1",instance="101.1.1.1:1401",mountpoint="/",namespace="monitoring",node="team11",pod="prometheus-node-exporter-dcp-173-4l2dr"}
我使用的解决方法如下所示
yes want to see based on either of those two [/ or /raid] like using grep on results obtained..but i figure out a work around by setting them in expression itself like below
```node_filesystem_size_bytes{fstype=~"ext[234]|btrfs|xfs|zfs", mountpoint="/raid"`
因此,充分表达将是必要的
(kube_pod_info{namespace="monitoring",node=~"(team|wkr).*"}
*
on(pod) group_right(node)
(
max by(instance, namespace, pod, device, mountpoint) (
(
node_filesystem_size_bytes{fstype=~"ext[234]|btrfs|xfs|zfs",mountpoint="/raid"}
-
node_filesystem_avail_bytes{fstype=~"ext[234]|btrfs|xfs|zfs",mountpoint="/raid"}
)
/
node_filesystem_size_bytes{fstype=~"ext[234]|btrfs|xfs|zfs",mountpoint="/raid"}
)
))
“基于装入点/和/raid筛选我的结果”是什么意思?您只想查看这两个装入点的结果吗?是的,您想查看基于这两个装入点的结果,比如在获得的结果上使用grep。但是我通过在表达式中设置它们来解决问题,如下所示
节点文件系统大小字节数{fstype=~“ext[234]|btrfs | xfs | zfs”,mountpoint=“/raid”
我将其添加到了我的答案中,但需要知道是否有一种方法可以使用相当于grep的prom ql
来解决问题
(kube_pod_info{namespace="monitoring",node=~"(team|wkr).*"}
*
on(pod) group_right(node)
(
max by(instance, namespace, pod, device, mountpoint) (
(
node_filesystem_size_bytes{fstype=~"ext[234]|btrfs|xfs|zfs",mountpoint="/raid"}
-
node_filesystem_avail_bytes{fstype=~"ext[234]|btrfs|xfs|zfs",mountpoint="/raid"}
)
/
node_filesystem_size_bytes{fstype=~"ext[234]|btrfs|xfs|zfs",mountpoint="/raid"}
)
))