Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: apisix’s upstream code and prometheus‘s code Inconsistency #11233

Open
sumeng001 opened this issue May 7, 2024 · 0 comments
Open

bug: apisix’s upstream code and prometheus‘s code Inconsistency #11233

sumeng001 opened this issue May 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@sumeng001
Copy link

Current Behavior

I'm using apisix response-rewrite to change the status code to 200, but the code in prometheus takes the upstream value 404. so the value of apisix_http_status in prometheus should distinguish between upstream_code and code. That is, one is the code returned by upstream, and the other is the code returned by apisix.

Expected Behavior

No response

Error Logs

[07/May/2024:15:40:34 +0800]|7921f83b9e523f23442d18a8578c5d51|0.019|10.100.250.113:19337|200|GET|http://ecs.example.com/fssc/02eb3863542e01fd9592400e906ce615.ico|HTTP/1.1|367|546|DIRECT/10.102.19.100:8080|application/json;charset=UTF-8|-|curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.44 zlib/1.2.3 libidn/1.18 libssh2/1.4.2|0.018|404|-|-|-|-|-|-|12880|17726|10|26832|OK|-
200 is apisix code
404 is upstream code

Steps to Reproduce

{
"uri": "/",
"name": "ecs.example.com_200",
"methods": [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH",
"HEAD",
"OPTIONS",
"CONNECT",
"TRACE",
"PURGE"
],
"host": "ecs.example.com",
"plugins": {
"response-rewrite": {
"body": " ",
"status_code": 200
}
},
"upstream_id": "1369277",
"labels": {
"API_VERSION": "v1"
},
"status": 1
}

Environment

  • APISIX version (run apisix version):3.2.0
  • Operating system (run uname -a):Linux 4.19.0-4.el7.ucloud.x86_64 change: added doc of how to load plugin. #1 SMP Mon Dec 16 08:54:55 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
  • OpenResty / Nginx version (run openresty -V or nginx -V):nginx version: openresty/1.21.4.2
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):{"hostname":"","boot_time":1711642728,"etcd_version":"3.5.0","version":"3.2.0","id":"710905a9-e853-4305-af4e-b2fd247fcb65"}
  • APISIX Dashboard version, if relevant:
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version):
@shreemaan-abhishek shreemaan-abhishek added the bug Something isn't working label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants