spacewander commented on code in PR #7412:
URL: https://github.com/apache/apisix/pull/7412#discussion_r917618470
##########
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 = core.request.header(ngx.ctx, "shared_dict")
Review Comment:
People don't use Prometheus in that way. Usually the application developers
decide what metrics will be exposed via their local configuration, but not
Prometheus's configuration.
##########
apisix/plugins/prometheus/exporter.lua:
##########
@@ -122,6 +123,10 @@ function _M.http_init(prometheus_enabled_in_stream)
"Etcd modify index for APISIX keys",
{"key"})
+ metrics.shared_dict = prometheus:gauge("shared_dict",
+ "nginx shared DICT of APISIX",
+ {"key"})
Review Comment:
This is not a standard way to name a prometheus metric.
We should distinguish them with name, instead of abusing the label.
They should be:
```
apisix_shared_dict_free_space{name="internal-status"}
...
```
and the unit should be byte.
See https://prometheus.io/docs/practices/naming/#metric-names
--
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]