File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -136,8 +136,25 @@ Received unexpected MQTT packet type+flags
136136
137137
138138=== TEST 5: fetch the prometheus metric data
139+ --- config
140+ location /t {
141+ content_by_lua_block {
142+ local t = require("lib.test_admin").test
143+ local core = require("apisix.core")
144+ local http = require("resty.http")
145+
146+ ngx.sleep(2) -- wait for the metrics to be updated
147+ local httpc = http.new()
148+ local res, err = httpc:request_uri("http://127.0.0.1:1984/apisix/prometheus/metrics")
149+ if not res then
150+ ngx.say(err)
151+ return
152+ end
153+ ngx.say(res.body)
154+ }
155+ }
139156--- request
140- GET /apisix/prometheus/metrics
157+ GET /t
141158--- response_body eval
142159qr/apisix_stream_connection_total\{route="mqtt"\} 2/
143160
You can’t perform that action at this time.
0 commit comments