It looks like you have a 5 x_y_z__resilience4j_circuitbreaker_state
metrics for every name
, each with a different kind
label, one with a value of 1.0
and the others with a value of 0.0
.
In this case if you do not expose 0.0
and a circuitbreaker changes through all states all metrics will report 1.0
.
To reduce cardinality, you should remove the kind
label and set the value to a state.
Instead of this:
x_y_z__resilience4j_circuitbreaker_state{kind="disabled",name="a",} 0.0
x_y_z__resilience4j_circuitbreaker_state{kind="closed",name="a",} 1.0
x_y_z__resilience4j_circuitbreaker_state{kind="open",name="a",} 0.0
x_y_z__resilience4j_circuitbreaker_state{kind="half_open",name="a",} 0.0
x_y_z__resilience4j_circuitbreaker_state{kind="forced_open",name="a",} 0.0
x_y_z__resilience4j_circuitbreaker_state{kind="disabled",name="b",} 0.0
x_y_z__resilience4j_circuitbreaker_state{kind="closed",name="b",} 0.0
x_y_z__resilience4j_circuitbreaker_state{kind="open",name="b",} 1.0
x_y_z__resilience4j_circuitbreaker_state{kind="half_open",name="b",} 0.0
x_y_z__resilience4j_circuitbreaker_state{kind="forced_open",name="b",} 0.0
x_y_z__resilience4j_circuitbreaker_state{kind="disabled",name="c",} 0.0
x_y_z__resilience4j_circuitbreaker_state{kind="closed",name="c",} 0.0
x_y_z__resilience4j_circuitbreaker_state{kind="open",name="c",} 0.0
x_y_z__resilience4j_circuitbreaker_state{kind="half_open",name="c",} 1.0
x_y_z__resilience4j_circuitbreaker_state{kind="forced_open",name="c",} 0.0
You should report something like this:
x_y_z__resilience4j_circuitbreaker_state{name="a"} 1.0 # 1 represents "closed"
x_y_z__resilience4j_circuitbreaker_state{name="b"} 2.0 # 2 represents "open"
x_y_z__resilience4j_circuitbreaker_state{name="c"} 3.0 # 3 represents "half_open"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…