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/12 07:35:32 UTC

[GitHub] [apisix] Chever-John commented on a diff in pull request #6616: docs: add datadog document(zh)

Chever-John commented on code in PR #6616:
URL: https://github.com/apache/apisix/pull/6616#discussion_r848081719


##########
docs/zh/latest/plugins/datadog.md:
##########
@@ -0,0 +1,200 @@
+---
+title: datadog
+---
+
+<!--
+#
+# 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.
+#
+-->
+
+## 简介
+
+`datadog` 是 Apache APISIX 内置的监控插件,可与 [Datadog](https://www.datadoghq.com/)(云应用最常用的监控和可观测性平台之一)无缝集成。`datadog` 插件支持对每个请求和响应周期进行多种指标参数的获取,这些指标参数基本反映了系统的行为和健康状况。
+
+`datadog` 插件通过 UDP 协议将其自定义指标推送给 DogStatsD 服务器,该服务器通过 UDP 连接与 Datadog Agent 捆绑在一起(关于如何安装 Datadog Agent,请参考[Agent](https://docs.datadoghq.com/agent/) )。DogStatsD 基本上是 StatsD 协议的实现,它为 Apache APISIX Agent 收集自定义指标,并将其聚合成单个数据点,发送到配置的 Datadog 服务器。更多关于 DogStatsD 的信息,请参考 [DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent) 。
+
+`datadog` 插件具有将多个指标参数组成一个批处理统一推送给外部 Datadog Agent 的能力,并且可以重复使用同一个数据包套接字。
+
+此功能可以有效解决日志数据发送不及时的问题。在创建批处理器之后,如果对 `inactive_timeout` 参数进行配置,那么批处理器会在配置好的时间内自动发送日志数据。如果不进行配置,时间默认为 5s。
+
+关于 Apache APISIX 的批处理程序的更多信息,请参考 [Batch-Processor](../batch-processor.md#配置)
+
+## APISIX-Datadog plugin 工作原理
+
+![APISIX-Datadog 插件架构图](https://static.apiseven.com/202108/1636685752757-d02d8305-2a68-4b3e-b2cc-9e5410c8bf11.png)
+
+APISIX-Datadog 插件将其自定义指标推送到 DogStatsD server。而 DogStatsD server 通过 UDP 连接与 Datadog agent 捆绑在一起。DogStatsD 是 StatsD 协议的一个实现。它为 Apache APISIX agent 收集自定义指标,将其聚合成一个数据点,并将其发送到配置的 Datadog server。要了解更多关于 DogStatsD 的信息,请访问 DogStatsD 文档。
+
+当你启用 APISIX-Datadog 插件时,Apache APISIX agent 会在每个请求响应周期向 DogStatsD server 输出以下指标:
+
+| 参数名称         | StatsD 类型 | 描述                                                       |
+| ---------------- | ----------- | ---------------------------------------------------------- |
+| Request Counter  | Counter     | 收到的请求数量。                                           |
+| Request Latency  | Histogram   | 处理该请求所需的时间,以毫秒为单位。                       |
+| Upstream latency | Histogram   | 上游 server agent 请求到收到响应所需的时间,以毫秒为单位。 |
+| APISIX Latency   | Histogram   | APISIX agent 处理该请求的时间,以毫秒为单位。              |
+| Ingress Size     | Timer       | 请求体大小,以字节为单位。                                 |
+| Egress Size      | Timer       | 响应体大小,以字节为单位。                                 |
+
+这些指标将被发送到 DogStatsD agent,并带有以下标签。如果任何特定的标签没有合适的值,该标签将被直接省略。
+
+| 参数名称        | 描述                                                         |
+| --------------- | ------------------------------------------------------------ |
+| route_name      | 路由的名称,如果不存在,将显示路由 ID。                      |
+| service_id      | 如果一个路由是用服务的抽象概念创建的,那么特定的服务 ID 将被使用。 |
+| consumer        | 如果路由有一个链接的消费者,消费者的用户名将被添加为一个标签。 |
+| balancer_ip     | 处理了当前请求的上游复制均衡器的的 IP。                      |
+| response_status | HTTP 响应状态代码。                                          |
+| scheme          | 已用于提出请求的协议,如 HTTP、gRPC、gRPCs 等。              |
+
+APISIX-Datadog 插件维护了一个带有 timer 的 buffer。当 timer 失效时,APISIX-Datadog 插件会将 buffer 的指标作为一个批量处理程序传送给本地运行的 DogStatsD server。这种方法通过重复使用相同的 UDP 套接字,对资源的占用较少,而且由于可以配置 timer,所以不会一直让网络过载。
+
+## 如何使用插件
+
+### 启动 Datadog Agent

Review Comment:
   Solved



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