You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/04/08 11:13:15 UTC
[GitHub] [apisix] spacewander commented on a change in pull request #4004: fix: use route/service name instead of id in prometheus metric
spacewander commented on a change in pull request #4004:
URL: https://github.com/apache/apisix/pull/4004#discussion_r609581734
##########
File path: apisix/plugins/prometheus.lua
##########
@@ -23,6 +23,13 @@ local plugin_name = "prometheus"
local default_export_uri = "/apisix/prometheus/metrics"
local schema = {
type = "object",
+ properties = {
+ route_type = {
Review comment:
`prefer_name` would be better?
##########
File path: t/plugin/prometheus.t
##########
@@ -809,3 +809,90 @@ qr/apisix_/
qr/etcd/
--- no_error_log
[error]
+
+
+
+=== TEST 45: create service with name
Review comment:
1. New test should be added to prometheus2.t
2. Test 45 & Test 46 should be merged into one
3. We need another two tests: one for route with name & one for name preferred but name missed.
##########
File path: apisix/plugins/prometheus/exporter.lua
##########
@@ -133,9 +139,10 @@ function _M.log(conf, ctx)
matched_host = ctx.curr_req_matched._host or ""
end
+
metrics.status:inc(1,
gen_arr(vars.status, route_id, matched_uri, matched_host,
- service_id, consumer_name, balancer_ip))
+ service_id, consumer_name, balancer_ip))
Review comment:
indent
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org