wankai123 opened a new issue #6583:
URL: https://github.com/apache/skywalking/issues/6583
Please answer these questions before submitting your issue.
- Why do you submit this issue?
- [ ] Question or discussion
- [ ] Bug
- [ ] Requirement
- [X] Feature or performance improvement
___
### Requirement or improvement
We need some functions to filter metrics according to the metric value.
Sometimes, we wan to aggregate the specific metrics which the values matched
some rules, for example :
```
kube_pod_status_phase{namespace="kube-system",pod="fluentbit-gke-gzhj7",phase="Pending"}
0
kube_pod_status_phase{namespace="kube-system",pod="fluentbit-gke-gzhj7",phase="Succeeded"}
0
kube_pod_status_phase{namespace="kube-system",pod="fluentbit-gke-gzhj7",phase="Failed"}
0
kube_pod_status_phase{namespace="kube-system",pod="fluentbit-gke-gzhj7",phase="Unknown"}
0
kube_pod_status_phase{namespace="kube-system",pod="fluentbit-gke-gzhj7",phase="Running"}
1
```
When we want to get the pods status, the metrics which value `=1` is the
flag, so we could filter the others.
I'm prepare to provide some functions in MAL, like
`valueEqual、valueNotEqual、valueGreaterEqual、valueLess etc.`
Use the above example:
The rule
`kube_pod_status_phase.valueEqual(1).sum(['pod'])`
The result should be
`kube_pod_status_phase{namespace="kube-system",pod="fluentbit-gke-gzhj7",phase="Running"}
1`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]