gpt4 book ai didi

普罗米修斯-格拉法纳 : How to use wildcard in query

转载 作者:行者123 更新时间:2023-12-04 01:35:41 25 4
gpt4 key购买 nike

我在普罗米修斯中有以下标签,如何在模板化时创建通配符查询
类似于“查询”:“label_values(application_*Count_Total,xyx)”。这些值是从 Eclipse Microprofile REST-API 生成的

application_getEnvVariablesCount_total
application_getFEPmemberCount_total
application_getLOBDetailsCount_total
application_getPropertiesCount_total
  {
"allValue": null,
"current": {
"isNone": true,
"selected": false,
"text": "None",
"value": ""
},
"datasource": "bcnc-prometheus",
"definition": "microprofile1",
"hide": 0,
"includeAll": false,
"label": null,
"multi": false,
"name": "newtest",
"options": [
{
"isNone": true,
"selected": true,
"text": "None",
"value": ""
}
],
"query": "microprofile1",
"refresh": 0,
"regex": "{__name__=~\"application_.*Count_total\"}",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
},

最佳答案

Prometheus 对待度量名称的方式与带有特殊标签的标签值相同 - __name__ .因此,以下查询应选择标签 xyx 的所有值跨度量名称匹配 application_.*Count_total正则表达式:
label_values({__name__=~"application_.*Count_total"}, xyx)

关于普罗米修斯-格拉法纳 : How to use wildcard in query,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59684225/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com