Prometheus-Grafana:如何在查询中使用通配符

我在prometheus中有以下标签,如何在模板化时创建通配符查询 类似于“查询”:“ 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,"value": ""
      }
    ],"query": "microprofile1","refresh": 0,"regex": "{__name__=~\"application_.*Count_total\"}","skipUrlSync": false,"sort": 0,"tagValuesQuery": "","tags": [],"tagsQuery": "","type": "query","usetags": false
  },
lantianniu 回答:Prometheus-Grafana:如何在查询中使用通配符

Prometheus将度量标准名称与带有特殊标签-__name__的标签值的处理方式相同。因此,以下查询应在名称与xyx regexp匹配的度量中选择标签application_.*Count_total的所有值:

label_values({__name__=~"application_.*Count_total"},xyx)

,

@valyala,我可以使用它

"query": "metrics(application_get.*Count_total)","regex": "/application_get(.*)Count_total/",
本文链接:https://www.f2er.com/2790125.html

大家都在问