Skip to content

Commit e80594f

Browse files
fix
Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
1 parent 1c7633b commit e80594f

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

t/stream-plugin/prometheus.t

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff 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
142159
qr/apisix_stream_connection_total\{route="mqtt"\} 2/
143160

0 commit comments

Comments
 (0)