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: radixtree_host_uri match pattern causes the prometheus metrics information to be incorrect #5134

Closed
zuiyangqingzhou opened this issue Sep 24, 2021 · 2 comments

Comments

@zuiyangqingzhou
Copy link
Contributor

Issue description

When I set the route matching pattern to radixtree_host_uri, I can see that the matched_uri in the matched_host in the metrics becomes a matched_host, and the order is exactly the opposite of host, and the matched_host is empty, as follows

apisix_http_status{code="101",route="test_master_route",matched_uri="moc.retsam.2ipa",matched_host="",service="",consumer="",node="xxxx"} 2
apisix_http_status{code="101",route="test_master_route",matched_uri="moc.retsam.2ipa",matched_host="",service="",consumer="",node="xxx"} 4
apisix_http_status{code="101",route="test_master_route",matched_uri="moc.retsam.2ipa",matched_host="",service="",consumer="",node="xxx"} 3

But my real matched_uri is /hello, and matched_host is api2.master.com

Environment

  • apisix version (cmd: apisix version): 2.9
  • 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. the route matching pattern is configured as radixtree_host_uri
  2. check out metrics: curl http://127.0.0.1:9091/apisix/prometheus/metrics

Actual result

matched_uri and matched_host do not match expectations,The expected results are as follows

matched_uri: /hello
matched_host: api2.master.com

Error log

none

Expected result

No response

@tzssangglass
Copy link
Member

can be fixed by: #5124

@zuiyangqingzhou
Copy link
Contributor Author

well done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants