spacewander commented on a change in pull request #6318:
URL: https://github.com/apache/apisix/pull/6318#discussion_r810935177



##########
File path: docs/en/latest/plugins/prometheus.md
##########
@@ -93,6 +93,20 @@ Then add prometheus plugin:
 
 We fetch the metric data from the specified url `/apisix/prometheus/metrics`.
 
+First you need to setup the route for the metrics API, which will use the 
[public-api](public-api.md) plugin.
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/routes/p -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+    "uri": "/apisix/prometheus/metrics",
+    "plugins": {
+        "public-api": {}
+    }
+}'
+```
+
+Then, we can get the metrics.

Review comment:
       I think we should remove the example of public-api in prometheus. Better 
not encourage the abuse.




-- 
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]


Reply via email to