Gil
06/11/2025, 7:39 AMhttpcheck
with my collector. This generate 5 datapoint with the value http_status_class
to be 1xx, 2xx, 3xx, 4xx and 5xx. It get also the http_status_code
with the response from the ping, 200 if everything is ok. Then generate a metrics value of 1 if http_status_class
== http_status_code
.
I tried from PromQL but I don't master the grammar, the query builder doesn't let me compare value to get the right one, ClickHouse Query, I have to understand how the schema works and is subject to future change.
That's why I calculate a health_score
with a processor like this :
transform/http_code:
metric_statements:
- context: datapoint
statements:
- set(attributes["health_score"], 3) where attributes["http.status_code"] == 200
- set(attributes["health_score"], 2) where attributes["http.status_code"] >= 300 and attributes["http.status_code"] < 500
- set(attributes["health_score"], 1) where attributes["http.status_code"] >= 500
I don't understand how to get this 1,2 or 3 value on a panel.
The ultimate goal is to show green|orange|red depending on the score