feat(promethues): add ngx.shared.DICT status#7412
Conversation
…onfiguration file. 2.distinguish prometheus metric of ngx.shared.DICT with name, instead of label.
2.compact prometheus docs.
spacewander
left a comment
There was a problem hiding this comment.
Please make the CI pass, thanks!
I don't know why this ci error is reported here, Would you give me some suggestion. |
The error message is: You can look up it. |
The error message report that === TEST 42: fetch the prometheus multiple shared dict data
--- request eval
["GET /apisix/prometheus/metrics",
"GET /apisix/prometheus/metrics",
"GET /apisix/prometheus/metrics",
"GET /apisix/prometheus/metrics",
"GET /apisix/prometheus/metrics",
"GET /apisix/prometheus/metrics",
"GET /apisix/prometheus/metrics",
"GET /apisix/prometheus/metrics"]
--- response_body_like eval
[qr/.*apisix_shared_dict_capacity_bytes{name="internal-status"} \d+(?:.|\n)*
apisix_shared_dict_free_space_bytes{name="internal-status"} \d+.*/,
qr/.*apisix_shared_dict_capacity_bytes{name="upstream-healthcheck"} \d+(?:.|\n)*
apisix_shared_dict_free_space_bytes{name="upstream-healthcheck"} \d+.*/,
qr/.*apisix_shared_dict_capacity_bytes{name="worker-events"} \d+(?:.|\n)*
apisix_shared_dict_free_space_bytes{name="worker-events"} \d+.*/,
qr/.*apisix_shared_dict_capacity_bytes{name="lrucache-lock"} \d+(?:.|\n)*
apisix_shared_dict_free_space_bytes{name="lrucache-lock"} \d+.*/,
qr/.*apisix_shared_dict_capacity_bytes{name="balancer-ewma"} \d+(?:.|\n)*
apisix_shared_dict_free_space_bytes{name="balancer-ewma"} \d+.*/,
qr/.*apisix_shared_dict_capacity_bytes{name="balancer-ewma-locks"} \d+(?:.|\n)*
apisix_shared_dict_free_space_bytes{name="balancer-ewma-locks"} \d+.*/,
qr/.*apisix_shared_dict_capacity_bytes{name="balancer-ewma-last-touched-at"} \d+(?:.|\n)*
apisix_shared_dict_free_space_bytes{name="balancer-ewma-last-touched-at"} \d+.*/,
qr/.*apisix_shared_dict_capacity_bytes{name="etcd-cluster-health-check"} \d+(?:.|\n)*
apisix_shared_dict_free_space_bytes{name="etcd-cluster-health-check"} \d+.*/]which has a array result. and commit dbf7e7e have a similar test case: Line 665 in dbf7e7e |
It does seem strange, so if you don't know how to modify it, consider a different type of validation. |
define lua_shared_dict in test case and check it.
You are right! I found a new type of validation, it maybe more suitable. |
|
Is the error a false report? |
rerun |
|
@ccxhwmy could you update the apisix-grafana-dashboard meta for shared dict? |
Yes, I can. |
Thanks a lot, let's do it in another PR. |
|
I have update the apisix-grafana-dashboard meta for shared dict in the (PR)[https://github.com//pull/7529]. |
Description
Fixes #5837
Use the request header to carry the name of ngx.shared.DICT that needs to be fetched, use
ngx.shared.DICT.capacityandngx.shared.DICT.free_spaceto get the current status ofngx.shared.DICT, and usegaugeto store the statusChecklist