soulbird commented on code in PR #7412:
URL: https://github.com/apache/apisix/pull/7412#discussion_r917280773
##########
apisix/plugins/prometheus/exporter.lua:
##########
@@ -351,6 +356,42 @@ local function etcd_modify_index()
end
+local key = {}
+local combine_param = {}
+
+local function shared_dict_status()
+ local header_of_shared_dict = ngx.req.get_headers()["shared_dict"]
+ if not header_of_shared_dict then
Review Comment:
Let's use `core.request.header`, so that we can use cache.
##########
t/plugin/prometheus.t:
##########
@@ -632,3 +632,61 @@ GET /apisix/prometheus/metrics
qr/apisix_/
--- response_body_unlike eval
qr/etcd/
+
+
+
+=== TEST 42: fetch the prometheus one shared dict data
+--- request
+GET /apisix/prometheus/metrics
+--- more_headers
+Shared_DICT: worker-events
+--- response_body_like
+.*TYPE apisix_shared_dict
gauge.*worker-events_capacity.*worker-events_free_space.*
+
+
+
+=== TEST 43: fetch the prometheus multiple shared dict data
+--- request
+GET /apisix/prometheus/metrics
+--- more_headers
+Shared_DICT: worker-events
+Shared_DICT: upstream-healthcheck
+Shared_DICT: internal-status
+--- response_body_like
+.*TYPE apisix_shared_dict
gauge.*worker-events_capacity.*worker-events_free_space.*
+
+
+
+=== TEST 44: fetch the prometheus multiple shared dict data
+--- request
+GET /apisix/prometheus/metrics
+--- more_headers
+Shared_DICT: worker-events
+Shared_DICT: upstream-healthcheck
+Shared_DICT: internal-status
+--- response_body_like
+.*TYPE apisix_shared_dict
gauge.*upstream-healthcheck_capacity.*upstream-healthcheck_free_space.*
+
+
+
+=== TEST 45: fetch the prometheus multiple shared dict data
Review Comment:
Why use the same title? Are their test intents the same? It's confusing
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]