You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/04/20 01:41:18 UTC

[GitHub] [apisix-ingress-controller] tokers commented on a diff in pull request #973: Doc: add an article on "how to access Apache APISIX Prometheus Metrics on k8s"

tokers commented on code in PR #973:
URL: https://github.com/apache/apisix-ingress-controller/pull/973#discussion_r853655179


##########
docs/en/latest/practices/how-to-access-Apache-APISIX-Prometheus-Metrics-on-k8s.md:
##########
@@ -0,0 +1,113 @@
+---
+title: How to access Apache APISIX Prometheus metrics on k8s
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+Observability (monitoring functionality) has always played an important role in system maintenance. A good monitoring system can help engineers quickly understand the status of services running in production environments and can locate problems or give early warning of anomalies when they occur.
+
+Prometheus is a leading open-source project focused on metrics and alerting that has changed the way the world does monitoring and observability. And Apache APISIX has enhanced its support for Prometheus Metrics in recent releases, adding a new feature for use in conjunction with the `public-api` plugin. This article will introduce how to configure `public-api` to protect Prometheus to collect Apache APISIX 's Metrics data.
+
+## Initial Knowledge about `public-api`
+
+When users develop custom plugins in Apache APISIX, they can define some APIs (hereinafter referred to as public API) for the plugins. In practical application scenarios, the provided interface is for internal calls, rather than being open on the public network for anyone to call.
+
+Therefore, Apache APISIX has designed a `public-api` plugin. With this plugin, you can solve the pain points of using the public API. You can set a custom URI for the public API and configure any type of plugin. For more information about `public-api`, see the [public-api](https://apisix.apache.org/docs/apisix/plugins/public-api/) plugin's document.
+
+The main role of the `public-api` plugin in this document is to protect the URI exposed by Prometheus.
+
+**Note**: One thing we should note is that this feature is only available in APISIX version 2.13 and later.
+
+## Begin to access Apache APISIX Prometheus Metrics
+
+### Step1: Install APISIX Ingress Controller

Review Comment:
   ```suggestion
   ### Step 1: Install APISIX Ingress Controller
   ```



##########
docs/en/latest/practices/how-to-access-Apache-APISIX-Prometheus-Metrics-on-k8s.md:
##########
@@ -0,0 +1,113 @@
+---
+title: How to access Apache APISIX Prometheus metrics on k8s
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+Observability (monitoring functionality) has always played an important role in system maintenance. A good monitoring system can help engineers quickly understand the status of services running in production environments and can locate problems or give early warning of anomalies when they occur.
+
+Prometheus is a leading open-source project focused on metrics and alerting that has changed the way the world does monitoring and observability. And Apache APISIX has enhanced its support for Prometheus Metrics in recent releases, adding a new feature for use in conjunction with the `public-api` plugin. This article will introduce how to configure `public-api` to protect Prometheus to collect Apache APISIX 's Metrics data.
+
+## Initial Knowledge about `public-api`
+
+When users develop custom plugins in Apache APISIX, they can define some APIs (hereinafter referred to as public API) for the plugins. In practical application scenarios, the provided interface is for internal calls, rather than being open on the public network for anyone to call.
+
+Therefore, Apache APISIX has designed a `public-api` plugin. With this plugin, you can solve the pain points of using the public API. You can set a custom URI for the public API and configure any type of plugin. For more information about `public-api`, see the [public-api](https://apisix.apache.org/docs/apisix/plugins/public-api/) plugin's document.
+
+The main role of the `public-api` plugin in this document is to protect the URI exposed by Prometheus.
+
+**Note**: One thing we should note is that this feature is only available in APISIX version 2.13 and later.
+
+## Begin to access Apache APISIX Prometheus Metrics
+
+### Step1: Install APISIX Ingress Controller
+
+First, we deploy Apache APISIX, ETCD, and APISIX Ingress Controller to a local Kubernetes cluster via Helm.
+
+```sh
+helm repo add apisix https://charts.apiseven.com
+helm repo update
+kubectl create namespace ingress-apisix
+helm install apisix apisix/apisix --namespace ingress-apisix \
+ --set ingress-controller.enabled=true
+```
+
+After installation, please wait until all services are up and running. Specific status confirmation can be checked with the following command.
+
+```sh
+kubectl get all -n ingress-apisix

Review Comment:
   Do we have any dedicated docs to introduce the way we install Apache APSIX Ingress Controller? @tao12345666333 
   
   I don't think show the installation in a lot of docs is a good idea.



##########
docs/en/latest/practices/how-to-access-Apache-APISIX-Prometheus-Metrics-on-k8s.md:
##########
@@ -0,0 +1,113 @@
+---
+title: How to access Apache APISIX Prometheus metrics on k8s
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+Observability (monitoring functionality) has always played an important role in system maintenance. A good monitoring system can help engineers quickly understand the status of services running in production environments and can locate problems or give early warning of anomalies when they occur.
+
+Prometheus is a leading open-source project focused on metrics and alerting that has changed the way the world does monitoring and observability. And Apache APISIX has enhanced its support for Prometheus Metrics in recent releases, adding a new feature for use in conjunction with the `public-api` plugin. This article will introduce how to configure `public-api` to protect Prometheus to collect Apache APISIX 's Metrics data.

Review Comment:
   Add a Prometheus website link.



##########
docs/en/latest/practices/how-to-access-Apache-APISIX-Prometheus-Metrics-on-k8s.md:
##########
@@ -0,0 +1,113 @@
+---
+title: How to access Apache APISIX Prometheus metrics on k8s
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+Observability (monitoring functionality) has always played an important role in system maintenance. A good monitoring system can help engineers quickly understand the status of services running in production environments and can locate problems or give early warning of anomalies when they occur.
+
+Prometheus is a leading open-source project focused on metrics and alerting that has changed the way the world does monitoring and observability. And Apache APISIX has enhanced its support for Prometheus Metrics in recent releases, adding a new feature for use in conjunction with the `public-api` plugin. This article will introduce how to configure `public-api` to protect Prometheus to collect Apache APISIX 's Metrics data.
+
+## Initial Knowledge about `public-api`
+
+When users develop custom plugins in Apache APISIX, they can define some APIs (hereinafter referred to as public API) for the plugins. In practical application scenarios, the provided interface is for internal calls, rather than being open on the public network for anyone to call.
+
+Therefore, Apache APISIX has designed a `public-api` plugin. With this plugin, you can solve the pain points of using the public API. You can set a custom URI for the public API and configure any type of plugin. For more information about `public-api`, see the [public-api](https://apisix.apache.org/docs/apisix/plugins/public-api/) plugin's document.
+
+The main role of the `public-api` plugin in this document is to protect the URI exposed by Prometheus.
+
+**Note**: One thing we should note is that this feature is only available in APISIX version 2.13 and later.
+
+## Begin to access Apache APISIX Prometheus Metrics
+
+### Step1: Install APISIX Ingress Controller
+
+First, we deploy Apache APISIX, ETCD, and APISIX Ingress Controller to a local Kubernetes cluster via Helm.
+
+```sh
+helm repo add apisix https://charts.apiseven.com
+helm repo update
+kubectl create namespace ingress-apisix
+helm install apisix apisix/apisix --namespace ingress-apisix \
+ --set ingress-controller.enabled=true
+```
+
+After installation, please wait until all services are up and running. Specific status confirmation can be checked with the following command.
+
+```sh
+kubectl get all -n ingress-apisix
+```
+
+### Step 2: Enable Prometheus Plugin
+
+If you need to monitor Apache APISIX at the same time, you can create the following ApisixClusterConfig resource.
+
+```yaml
+apiVersion: apisix.apache.org/v2beta3
+kind: ApisixClusterConfig
+metadata:
+  name: default
+spec:
+  monitoring:
+    prometheus:
+      enable: true
+```
+
+### Step 3: Enable `public-api` Plugin
+
+This is a basic routing setup, please note that further configuration should be done based on your local backend service information. The main solution concept is to use the `public-api` plugin to protect the routes exposed by Prometheus. For a more detailed configuration, you can refer to the [example](https://apisix.apache.org/zh/docs/apisix/plugins/public-api/#example) section of the `public-api` plugin.
+
+```yaml

Review Comment:
   @tao12345666333 I think we can add an option to help users expose the Prometheus endpoint in the helm chart.



##########
docs/en/latest/practices/how-to-access-Apache-APISIX-Prometheus-Metrics-on-k8s.md:
##########
@@ -0,0 +1,113 @@
+---
+title: How to access Apache APISIX Prometheus metrics on k8s
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+Observability (monitoring functionality) has always played an important role in system maintenance. A good monitoring system can help engineers quickly understand the status of services running in production environments and can locate problems or give early warning of anomalies when they occur.
+
+Prometheus is a leading open-source project focused on metrics and alerting that has changed the way the world does monitoring and observability. And Apache APISIX has enhanced its support for Prometheus Metrics in recent releases, adding a new feature for use in conjunction with the `public-api` plugin. This article will introduce how to configure `public-api` to protect Prometheus to collect Apache APISIX 's Metrics data.
+
+## Initial Knowledge about `public-api`
+
+When users develop custom plugins in Apache APISIX, they can define some APIs (hereinafter referred to as public API) for the plugins. In practical application scenarios, the provided interface is for internal calls, rather than being open on the public network for anyone to call.
+
+Therefore, Apache APISIX has designed a `public-api` plugin. With this plugin, you can solve the pain points of using the public API. You can set a custom URI for the public API and configure any type of plugin. For more information about `public-api`, see the [public-api](https://apisix.apache.org/docs/apisix/plugins/public-api/) plugin's document.
+
+The main role of the `public-api` plugin in this document is to protect the URI exposed by Prometheus.
+
+**Note**: One thing we should note is that this feature is only available in APISIX version 2.13 and later.
+

Review Comment:
   I think we don't have to introduce `public-api` here as it's APISIX's feature, we just need to add a link. Duplicated documentation will cause inconsistence.



-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org