Skip to content

Commit

Permalink
test stream hot reload
Browse files Browse the repository at this point in the history
  • Loading branch information
shreemaan-abhishek committed Apr 6, 2024
1 parent f30eaa9 commit eab64d3
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions t/cli/test_prometheus_reload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,31 @@ if curl -i http://127.0.0.1:9091/apisix/prometheus/metrics | grep "{}" > /dev/nu
echo "failed: metrics should not contain '{}' when prometheus is enabled"
exit 1
fi

echo "disable http prometheus and enable stream prometheus and call reload"

exit_if_not_customed_nginx

echo "
apisix:
proxy_mode: http&stream
enable_admin: true
stream_proxy:
tcp:
- addr: 9100
plugins:
- example-plugin
stream_plugins:
- prometheus
" > conf/config.yaml

curl -i http://127.0.0.1:9090/v1/plugins/reload -XPUT

sleep 2

echo "fetching metrics should actually work demonstrating hot reload"

if ! curl -i http://127.0.0.1:9091/apisix/prometheus/metrics | grep "{}" > /dev/null; then
echo "failed: metrics should not contain '{}' when prometheus is enabled"
exit 1
fi

0 comments on commit eab64d3

Please sign in to comment.