yzeng25 commented on code in PR #1196: URL: https://github.com/apache/apisix-website/pull/1196#discussion_r917477018
########## website/i18n/zh/docusaurus-plugin-content-blog/2022/07/05/use-dataant-to-monitor-apisix.md: ########## @@ -0,0 +1,92 @@ +--- +title: "如何使用 DataAnt 监控 Apache APISIX" +authors: + - name: "韩飞" + title: "Technical Writer" + url: "https://github.com/hf400159" + image_url: "https://github.com/hf400159.png" +keywords: +- Apache APISIX +- API 网关 +- DataAnt +description: 本文主要介绍如何通过 DataAnt Agent 将 API Gateway Apache APISIX 的指标数据上传到 DataAnt 监控系统。 +tags: [Authentication] +--- + +> 本文主要介绍如何通过 DataAnt Agent 将 API Gateway Apache APISIX 的指标数据上传到 DATAANT 监控系统。 + +<!--truncate--> + +## 背景信息 + +Apache APISIX 是一个开源的云原生 API 网关,作为 API 网关,它兼具动态、实时、高性能等特点,提供了负载均衡、动态上游、灰度发布、服务熔断、身份认证、可观测性等丰富的流量管理功能。你可以使用 Apache APISIX 来处理传统的南北向流量,以及服务间的东西向流量,也可以当做 K8s Ingress controller 来使用。得益于 APISIX 全动态的设计,可以随时进行配置更改并且均不需要重启服务。 + +DataAnt 全栈云监控系统通过大数据和机器学习能够汇总 IaaS、PaaS 和 SaaS 层所有运维数据,给用户提供统一可视化界面。DataAnt 允许用户在相关监控数据源之间无缝快速地移动,而无需切换工具,更精细地了解到自己 IT 系统的状态。其提供的 DataAnt Agent 可以实时监控 APISIX 并将其监控数据上传到 DataAnt PaSS 平台,实现云端一站式监控。 + +## 原理简介 + + + +1. 采集配置 + + DataAnt Agent 首先会通过 `config.yaml` 的配置的 APISIX 项进行采集器初始化和注册。同一个 Agent 可以注册多个采集器。采集器收集 APISIX 暴露的指标后,对指标数据进行加密上传到 DataAnt Cloud。 + +2. 数据可视化 + + DataAnt Cloud 在接收到数据后,数据经过初步的监控信息补充和处理会存放到时序数据库中,之后可以通过 DataAnt 的 Dashboard 实时监控 APISIX。 + +3. 告警通知 + + 数据还将通过消息分发到告警匹配处理,然后再进行通知聚合最终通过配置的通知方式将告警发送,即可以实时接收到 APISIX 的异常情况。 + +## 配置指南 + +1. 首先请访问 [DataAnt Cloud](http://139.224.11.158),注册账户并登录平台。 + +2. 通过[下载链接](https://pan.baidu.com/s/1fabvSiDLDh8ZRTjpzINHLg?pwd=87d4)获取 DataAnt 的 Agent,下载完成后上传到 APISIX 所在的机器上并给 Agent 添加执行权限。 + +3. 在当前目录下创建 DataAnt Agent 所需的配置文件 `./config.yaml`。详细配置如下: + +```yaml +tenantId: 11 # 该 ID 是您的 DataAnt 平台的用户 ID +hostIp: 127.0.0.1 # 主机的标识 IP +hostName: apisix +configs: +- uri: http://127.0.0.1:9091 # APISIX 监控指标所暴露的端口 + type: apisix # 监控类型选择 APISIX + asName: apisix_test # 别名 +``` + +4. 使用以下命令启动 Agent。 + +```shell +./agent +``` + + 启动成功后,则会返回以下数据: + +```shell +2022/06/21 20:50:10 {"code":200,"msg":"请求成功","data":null} +2022/06/21 20:50:30 {"code":200,"msg":"请求成功","data":null} +2022-06-21 20:51:00:000 INFO apisix/apisix.go:25 获取对应监控数据,数据长度1675 +2022-06-21 20:51:00:000 INFO prometheus/prometheusCollector.go:43 获取对应监控数据开始解析1675 +2022-06-21 20:51:00:000 INFO prometheus/prometheusCollector.go:43 获取对应监控数据完成解析 解析指标数量21 +2022-06-21 20:51:00:000 INFO collector/collector.go:82 apisix采集到数据数量21 +2022-06-21 20:51:00:000 INFO runtime/asm_amd64.s:1581 apisix_test9091:指标数:21 +``` + +5. 在 DataAnt 平台首页单击安装集成插件>监控插件,选择 APISIX,并单击`配置`下的`点击配置`。 + +6. 在 DataAnt 平台首页单击左侧导航栏的`仪表盘`并新建仪表盘。选择自己需要的指标,并拖拽到仪表盘上,配置完成的指标如下: + Review Comment: Indentation <img width="777" alt="image" src="https://user-images.githubusercontent.com/36651058/178170487-0e30a9bc-0feb-4f3e-ba25-8a2ceb97c738.png"> ########## website/blog/2022/07/05/use-dataant-to-monitor-apisix.md: ########## @@ -0,0 +1,92 @@ +--- +title: "How to monitor Apache APISIX with DataAnt" +authors: + - name: "Fei Han" + title: "Technical Writer" + url: "https://github.com/hf400159" + image_url: "https://github.com/hf400159.png" +keywords: +- Apache APISIX +- API Gateway +- DataAnt +description: This article mainly introduces how to upload the API Gateway Apache APISIX indicator data to the DataAnt monitoring system through the DataAnt Agent. +tags: [Authentication] +--- + +> This article mainly introduces how to upload the APISIX indicator data to the DATA ANT monitoring system through the DataAnt Agent. + +<!--truncate--> + +## Background + +[Apache APISIX](https://github.com/apache/apisix) is an open source cloud native API gateway. As an API gateway, it has the characteristics of dynamic, real-time, and high performance. It provides rich traffic management functions such as load balancing, dynamic upstream, grayscale publishing, service fusing, identity authentication and observability. You can use APISIX to handle the traditional north-south traffic and the east-west traffic between services. It can also be used as a K8s ingress controller. Thanks to the full dynamic design of APISIX, configuration changes can be made at any time without restarting the service. + +The DataAnt full-stack cloud monitoring system can aggregate all the operation and maintenance data of IaaS, PaaS and SaaS layers through big data and machine learning, and provide users with a unified visual interface. DataAnt allows users to move seamlessly and quickly between relevant monitoring data sources without having to switch tools and gain more granular visibility into the state of their IT systems. The DataAnt Agent it provides can monitor APISIX in real time and upload its monitoring data to the DataAnt PaSS platform to realize one-stop cloud monitoring. + +## Introduction + + + +1. Collection configuration + + The DataAnt Agent will first initialize and register the collector through the APISIX item in `config.yaml`. The same Agent can register multiple collectors. After the collector collects the indicators exposed by APISIX, it encrypts the indicator data and uploads it to DataAnt Cloud. + +2. Data visualization + + After DataAnt Cloud receives the data, the data will be stored in the time series database after preliminary monitoring information supplementation and processing, and then APISIX can be monitored in real time through DataAnt's Dashboard. + +3. Alarm notification + + The data will also be distributed to the alarm matching processing through the message, and then the notification aggregation will be carried out. Finally, the alarm will be sent through the configured notification method, that is, the abnormal situation of APISIX can be received in real time. + +## Operation steps + + 1. First, you need to access [DataAnt Cloud](http://139.224.11.158), register an account and log in to the platform. + + 2. Obtain the Agent of DataAnt through the [download link](https://pan.baidu.com/s/1fabvSiDLDh8ZRTjpzINHLg?pwd=87d4). After the download is complete, upload it to the machine where APISIX is located and add execution permission to the Agent. + + 3. Create the configuration file `./config.yaml` required by DataAnt Agent in the current directory. The detailed configuration is as follows: + + ```yaml + tenantId: 11 + hostIp: 127.0.0.1 + hostName: apisix + configs: + - uri: http://127.0.0.1:9091 + type: apisix + asName: apisix_test + ``` + + 4. Start the Agent using the following command.。 + + ```shell + ./agent + ``` + + After successful startup, the following data will be returned: + + ```shell + 2022/06/21 20:50:10 {"code":200,"msg":"请求成功","data":null} + 2022/06/21 20:50:30 {"code":200,"msg":"请求成功","data":null} + 2022-06-21 20:51:00:000 INFO apisix/apisix.go:25 获取对应监控数据,数据长度1675 + 2022-06-21 20:51:00:000 INFO prometheus/prometheusCollector.go:43 获取对应监控数据开始解析1675 + 2022-06-21 20:51:00:000 INFO prometheus/prometheusCollector.go:43 获取对应监控数据完成解析 解析指标数量21 + 2022-06-21 20:51:00:000 INFO collector/collector.go:82 apisix采集到数据数量21 + 2022-06-21 20:51:00:000 INFO runtime/asm_amd64.s:1581 apisix_test9091:指标数:21 + ``` + Review Comment: Content in the code block shows up in a wrong way. <img width="807" alt="image" src="https://user-images.githubusercontent.com/36651058/178170718-ce24c691-35c8-4d36-917d-68295cf06691.png"> -- 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]
