CircuitBreaker仪表板

时间:2020-03-29 15:02:15

标签: grafana influxdb resilience4j

https://resilience4j.readme.io/docs/micrometer 有一个公开的指标列表。

现在我的问题是我如何在Grafana中创建一个仪表板,以显示断开的断路器数量。

当我检查数据库时,我可以获取此数据

> SELECT * FROM "resilience4j_circuitbreaker_state" WHERE ("app" = 'document-upload' AND "environment" = 'dev' AND "state" = 'closed')
name: resilience4j_circuitbreaker_state
time                app             environment metric_type name       state  value
----                ---             ----------- ----------- ----       -----  -----
1585421689542000000 document          dev         gauge       sunService closed 1
1585421689548000000 document          dev         gauge       awsS3      closed 1
1585421749532000000 document          dev         gauge       sunService closed 1
1585421749535000000 document          dev         gauge       awsS3      closed 1
1585421809533000000 document          dev         gauge       sunService closed 1
1585421809535000000 document          dev         gauge       awsS3      closed 1
1585421869535000000 document          dev         gauge       sunService closed 1
1585421869537000000 document          dev         gauge       awsS3      closed 1

由此,我应该如何构造一个返回2的查询,因为我们有两种类型的circuitBreaker,一种用于AWSS3,另一种是SunService 我想要的是一个查询,由于两个断路器现在已闭合,该查询将返回2。

我尝试了

之类的查询
SELECT sum(value)  FROM "resilience4j_circuitbreaker_state" WHERE ("app" = 'document-upload' AND "environment" = 'dev' AND "state" = 'closed')

但是没有运气

0 个答案:

没有答案