-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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: Missing metrics in Prometheus #10921
Comments
I recommend you to test properly because we have a test cases covering this feature. https://github.com/apache/apisix/blob/master/t/plugin/prometheus.t#L132-L136 https://github.com/apache/apisix/blob/master/t/plugin/prometheus.t#L384-L389 Did you initiate requests properly? |
I get the metrics by doing this (environment runs in a k8s cluster):
The result is this, where I'd expect to see the missing metrics? Why are they missing?
|
From https://docs.api7.ai/hub/prometheus#metrics These two you mentioned should show up after some traffic to the APISIX instance, in my experience. |
I did a little test run on a route and I still don't get any data.
|
same issue with v3.8.0 |
@shreemaan-abhishek ok I can actually reproduce (latest, 3.8.0)... My steps are:
Some more info: I remember running into this issue when I worked on the prometheus plugin doc for api7 site, and had a convo with @AlinsRan on this topic, though for the heck of my life I cannot find the convo anymore. After a while and with more traffic generated, the metrics showed up for me. I cannot explain the exact reason for this or under what circumstances these metrics will show up. |
If I am not mistaken these values are not part of the default configuration (they are commented in apisix/conf/config-default.yaml Line 591 in 626dbae
https://apisix.apache.org/docs/apisix/plugins/prometheus/#specifying-metrics |
Try fixing the formatting of your yaml document (the |
Current Behavior
I don't see values such as
apisix_bandwidth
,apisix_http_status
in Prometheus or in Grafana. There are probably more missingExpected Behavior
Expect to see the data
Error Logs
I don't see any errors
Steps to Reproduce
Configure apisix with the following values:
Configure Prometheus with the following:
When doing curl to the endpoint I only see the following values:
Environment
apisix version
): 3.8.0uname -a
): Linux apisix-84786c95b7-sptpv 5.15.0-200.131.27.1.el8uek.x86_64 change: added an example of plugin. #2 SMP Wed Nov 22 18:08:57 PST 2023 x86_64 GNU/Linuxopenresty -V
ornginx -V
): nginx version: openresty/1.21.4.2curl http://127.0.0.1:9090/v1/server_info
):luarocks --version
):The text was updated successfully, but these errors were encountered: