Chever-John commented on a change in pull request #6616:
URL: https://github.com/apache/apisix/pull/6616#discussion_r835711912



##########
File path: docs/zh/latest/plugins/datadog.md
##########
@@ -0,0 +1,147 @@
+---
+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` 
插件支持对每个请求和响应周期进行多种指标参数的获取,这些指标参数基本反映了系统的行为和健康状况。
+
+该插件通过 UDP 协议将其自定义指标推送给 DogStatsD 服务器,该服务器与 Datadog Agent 捆绑在一起(关于如何安装 Datadog 
Agent,请参考[Agent](https://docs.datadoghq.com/agent/) )。DogStatsD 基本上是 StatsD 
协议的实现,它将收集到的 Apache APISIX 代理的自定义指标聚合成单个数据点,并发送到设置的 Datadog 服务器上。更多关于 DogStatsD 
的信息,请参考 
[DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent) 。
+
+`datadog` 插件具有将多个指标参数组成一个批处理统一推送给外部 Datadog Agent 的能力,并且可以重复使用同一个数据包套接字。
+
+这样的功能可以有效解决日志数据不及时发送的问题,因为当生成一个批处理,并对其做了恰当的配置 (比如对 `inactive_timeout` 参数进行配置) 
之后。批处理器便会在配置时间(默认是 5s)内发送日志数据。
+
+关于 Apache APISIX 的批处理程序的更多信息,请参考 [Batch-Processor](../batch-processor.md#配置)
+
+## 属性
+
+| 名称             | 类型   | 必选项  | 默认值      | 有效值       | 描述                     
                                                           |
+| -----------      | ------ | -----------  | -------      | -----       | 
------------------------------------------------------------                    
           |
+| prefer_name      | boolean | optional    | true         | true/false  | 
如果设置为 `false`,将使用路由/服务的 id 值作为插件的 `route_name`,而不是带有参数的标签名称(默认)。   |
+
+该插件支持使用批处理程序来聚集和处理条目(日志/数据)的批次。这就避免了插件频繁地提交数据,默认情况下,批处理程序每 `5` 秒或当队列中的数据达到 
`1000` 时提交数据。有关信息或自定义批处理程序的参数设置,请参阅[批处理程序](../batch-processor.md#configuration) 
配置部分。
+
+## 元数据
+
+| 名称        | 类型    | 必选项 |     默认值        | 有效值         | 描述                  
                                          |
+| ----------- | ------  | ----------- |      -------       | -----         | 
---------------------------------------------------------------------- |
+| host        | string  | optional    |  "127.0.0.1"       |               | 
DogStatsD 服务器的主机地址                                      |
+| port        | integer | optional    |    8125            |               | 
DogStatsD 服务器的主机端口                                         |
+| namespace   | string  | optional    |    "apisix"        |               | 由 
APISIX 代理发送的所有自定义参数的前缀。对寻找指标图的实体很有帮助,例如:(apisix.request.counter)。               
                         |
+| constant_tags | array | optional    | [ "source:apisix" ] |              | 
静态标签嵌入到生成的指标中。这对某些信号的度量进行分组很有用。 |
+
+要了解更多关于如何有效地编写标签,请访问[这里](https://docs.datadoghq.com/getting_started/tagging/#defining-tags)
+
+## 输出指标
+
+Apache APISIX 代理,对于每个请求响应周期,如果启用了 datadog 插件,就会向 DogStatsD 服务器输出以下指标。
+
+| Metric Name               | StatsD Type   | Description               |
+| -----------               | -----------   | -------                   |
+| Request Counter           | Counter       | 收到的请求数量。   |
+| Request Latency           | Histogram     | 处理该请求所需的时间(以毫秒为单位)。 |
+| Upstream latency          | Histogram     | 代理请求到上游服务器直到收到响应所需的时间(以毫秒为单位)。 |
+| APISIX Latency            | Histogram     | APISIX 代理处理该请求的时间(以毫秒为单位)。|
+| Ingress Size              | Timer         | 以字节为单位的请求体大小。 |
+| Egress Size               | Timer         | 以字节为单位的响应体大小。 |
+
+这些指标将被发送到带有以下标签的 DogStatsD Agent。
+
+> 如果一个标签没有合适的值,该标签将被直接省略。
+
+- **route_name**:在路由模式定义中指定的名称,如果不存在或插件属性 `prefer_name` 被设置为 
`false`,它将默认使用路由/服务的 id 值。
+- **service_name**:如果一个路由是用服务的抽象概念创建的,特定的服务 name/id(基于插件的 `prefer_name` 
属性)将被使用。
+- **consumer**:如果路由有一个链接的消费者,消费者的用户名将被添加为一个标签。
+- **balancer_ip**:处理了当前请求的上游复制均衡器的的 IP。
+- **response_status**:HTTP 响应状态代码。
+- **scheme**:已用于提出请求的协议,如 HTTP、gRPC、gRPCs 等。
+
+## 如何启用
+
+本小节介绍了如何为特定路由启用 `datadog` 插件。进行以下操作之前请确认您的 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-unsubscr...@apisix.apache.org

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


Reply via email to