tao12345666333 opened a new issue #6276:
URL: https://github.com/apache/apisix/issues/6276
### Issue description
In the recent Apache APISIX Ingress controller CI, we found that the
Prometheus plugin does not take effect when set via global_rules. (we using
apache/apisix:dev docker image)
**If we fallback this image to `apache/apisix:2.11.0-alpine` then it works
fine.**
Below is our configuration:
```yaml
apisix:
enable_control: true
enable_reuseport: true # Enable nginx SO_REUSEPORT switch if set
to true.
allow_admin:
- 127.0.0.0/24
- 0.0.0.0/0
port_admin: 9180
stream_proxy: # TCP/UDP proxy
only: false
tcp: # TCP proxy port list
- 9100
udp:
- 9200
etcd:
host: # it's possible to define multiple etcd
hosts addresses of the same etcd cluster.
- "http://{{ .EtcdServiceFQDN }}:2379" # multiple etcd address
prefix: "/apisix" # apisix configurations prefix
timeout: 30 # 30 seconds
plugin_attr:
prometheus:
enable_export_server: false
```
xref: https://github.com/apache/apisix-ingress-controller/issues/857
### Environment
- apisix version (cmd: `apisix version`): using dev image.
`apache/apisix@sha256:6e6b8999a981ab00e1a1373fbebf049d08e15aeddfec8e5945910eba134e66c7`
- OS (cmd: `uname -a`):
- OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):
- etcd version, if have (cmd: run `curl
http://127.0.0.1:9090/v1/server_info` to get the info from server-info API):
- apisix-dashboard version, if have:
- the plugin runner version, if the issue is about a plugin runner (cmd:
depended on the kind of runner):
- luarocks version, if the issue is about installation (cmd: `luarocks
--version`):
### Steps to reproduce
1. `git clone https://github.com/apache/apisix-ingress-controller.git`
2. `make push-images-to-kind`
3. `kubectl apply -k samples/deploy/crd`
4. ` cd test/e2e/`
5. `ginkgo --focus='enable prometheus'`
### Actual result
`/apisix/prometheus/metrics` return 404
### Error log
```
127.0.0.1 - - [09/Feb/2022:15:32:54 +0000] localhost:32150 "GET
/apisix/admin/global_rules HTTP/1.1" 200 303 0.005 "-" "Go-http-client/1.1" - -
- "http://localhost:32150"
127.0.0.1 - - [09/Feb/2022:15:32:54 +0000] localhost:31883 "GET
/apisix/prometheus/metrics HTTP/1.1" 404 47 0.000 "-" "Go-http-client/1.1" - -
- "http://localhost:31883"
```
### Expected result
`/apisix/prometheus/metrics` return 200
--
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]