Skip to content

Commit

Permalink
Merge pull request #351 from deepflowio/u-imgs-autotagging
Browse files Browse the repository at this point in the history
update imgs and autotagging docs
  • Loading branch information
sharang authored Nov 12, 2023
2 parents 8a904fa + 77f2116 commit 08ec9cd
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 26 deletions.
2 changes: 1 addition & 1 deletion docs/zh/01-about/02-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DeepFlow 企业版拥有更多的软件组件,以提供更加完善的数据

DeepFlow 的名称来自于我们对实现可观测性的认知:**对每一次应用调用(Flow)的深度(Deep)洞察**。DeepFlow 中的所有可观测性数据都是以调用为核心组织的:原始的调用日志、聚合生成的应用性能指标和服务全景图、关联生成的分布式追踪火焰图,以及在每一个调用生命周期内的网络性能指标、文件读写性能指标、函数调用栈性能剖析等。我们认识到这些可观测性数据在采集和关联上的困难,使用 eBPF 技术实现了零侵扰(Zero Code)的数据采集,并利用智能编码(SmartEncoding)机制实现了所有数据的全栈(Full Stack)关联。

![DeepFlow 基于 eBPF 技术实现零侵扰的全栈数据采集](https://yunshan-guangzhou.oss-cn-beijing.aliyuncs.com/pub/pic/2023091164febaf0c68bc.png)
![DeepFlow 基于 eBPF 技术实现零侵扰的全栈数据采集](https://yunshan-guangzhou.oss-cn-beijing.aliyuncs.com/pub/pic/202311046546371f08829.png)

除了能够利用 eBPF 技术零侵扰采集观测数据以外,DeepFlow 还支持集成主流的可观测性技术栈,例如支持作为 Prometheus、OpenTelemetry、SkyWalking、Pyroscope 等技术栈的存储后端,并提供 SQL、PromQL、OTLP Export 能力作为 Grafana、Prometheus、OpenTelemetry、SkyWalking 的数据源,使得开发者可以快速将其融入到自己的可观测性解决方案中。当作为存储后端时,DeepFlow 并不只是简单的存储数据,利用领先的 AutoTagging 和 SmartEncoding 机制,高性能、自动化的为所有观测信号注入统一的属性标签,消除数据孤岛,并增强数据的下钻切分能力。

Expand Down
2 changes: 1 addition & 1 deletion docs/zh/01-about/03-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ permalink: /about/features

**全景图直接体现出了 eBPF 零侵扰的优势,对比 APM 有限的覆盖能力,所有的服务都能出现在全景图中**。但 eBPF 获取的调用日志不能直接用于拓扑展现,DeepFlow 为所有的数据注入了丰富的标签,包括云资源属性、K8s 资源属性、自定义 K8s 标签等。通过这些标签可以快速过滤出指定业务的全景图,并且可以按不同标签分组展示,例如 K8s Pod、K8s Deployment、K8s Service、自定义标签等。**全景图不仅描述了服务之间的调用关系,还展现了调用路径上的全栈性能指标**,例如下图右侧为两个 K8s 服务的进程在相互访问时的逐跳时延变化。我们可以很快的发现性能瓶颈到底位于业务进程、容器网络、K8s 网络、KVM 网络还是 Underlay 网络。充足的中立观测数据是快速定界的必要条件。

![DeepFlow 的全景图对比 APM Agent 获取的拓扑图](https://yunshan-guangzhou.oss-cn-beijing.aliyuncs.com/pub/pic/2023091164fec16f9c9ad.png)
![DeepFlow 的全景图对比 APM Agent 获取的拓扑图](https://yunshan-guangzhou.oss-cn-beijing.aliyuncs.com/pub/pic/2023110465463725dd5ff.png)

目前,DeepFlow 已经内置支持解析主流应用协议,包括 HTTP 1/2、HTTPS(Golang/openssl)、Dubbo、gRPC、SOFARPC、FastCGI、MySQL、PostgreSQL、Redis、MongoDB、Kafka、MQTT、DNS,未来还将扩展更多应用协议的支持。

Expand Down
2 changes: 1 addition & 1 deletion docs/zh/05-features/04-auto-tagging/02-smart-encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ permalink: /features/auto-tagging/smart-encoding

DeepFlow 为所有观测数据自动注入资源、服务和业务标签。在一个典型的生产环境中,需要为一条数据自动注入的标签数可能多达 100+ 个。这些标签为后端存储带来了很大的压力,DeepFlow 领先的 SmartEncoding 机制创新的解决了此问题,使得性能开销显著降低。

![DeepFlow 中的 SmartEncoding](https://deepflow.io/images/V3/V2-06-01.svg)
![DeepFlow 中的 SmartEncoding](https://yunshan-guangzhou.oss-cn-beijing.aliyuncs.com/pub/pic/202310096523b164952a5.png)

SmartEncoding 依赖于对各类标签数据的编码和关联。首先 Agent 获取到字符串格式的标签并汇总到 Server 上,接下来 Server 会对所有的标签进行编码。在此之后,对观测数据的 SmartEncoding 过程包含三个阶段:
- 采集阶段:Agent 为每一条观测数据自动注入 VPC(Integer)、IP、PID 标签
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/05-features/04-auto-tagging/03-meta-tags.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: K8s 资源信息注入
title: 基础资源标签
permalink: /features/auto-tagging/meta-tags
---

Expand Down
8 changes: 4 additions & 4 deletions docs/zh/05-features/04-auto-tagging/04-custom-tags.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: K8s 自定义 Label 注入
title: 自定义资源标签
permalink: /features/auto-tagging/custom-tags
---

Expand All @@ -19,18 +19,18 @@ DeepFlow 目前支持自动关联 K8s 自定义 Label 的资源包括:

# K8s Annotation

DeepFlow 目前支持自动关联 K8s 自定义 Annotation 的资源包括:
DeepFlow(仅企业版)目前支持自动关联 K8s 自定义 Annotation 的资源包括:
- 容器服务
- Pod

# K8s Env

DeepFlow 目前支持自动关联 K8s 自定义 Annotation 的资源包括:
DeepFlow(仅企业版)目前支持自动关联 K8s 自定义 Annotation 的资源包括:
- Pod

# 云资源自定义标签

DeepFlow 目前支持自动关联云资源自定义标签的资源包括:
DeepFlow(仅企业版)目前支持自动关联云资源自定义标签的资源包括:
- 云服务器

支持的公有云厂商包括:
Expand Down
4 changes: 3 additions & 1 deletion docs/zh/05-features/04-auto-tagging/05-process-tags.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
---
title: 进程信息标签
title: 可选的进程信息标签
permalink: /features/auto-tagging/process-tags
---

# 注入进程信息标签

默认情况下,DeepFlow 采集的所有观测数据中,auto\_instance 标签的最细粒度为 IP 地址所属的容器 Pod 或云服务器等资源。当希望为数据注入进程粒度的标签信息时,需要开启 Agent 的进程信息同步功能。

此功能一般用于 Agent 运行于云服务器(而非 K8s Node)的场景。

# 所有配置项的 Yaml 文档

具体来讲涉及到如下 agent group config([最新的 Yaml 文档参考 GitHub](https://github.com/deepflowio/deepflow/blob/main/server/controller/model/agent_group_config_example.yaml)):
Expand Down
30 changes: 13 additions & 17 deletions docs/zh/05-features/04-auto-tagging/06-additional-cloud-tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ permalink: /features/auto-tagging/additional-cloud-tags

# 简介

DeepFlow 除了能够主动调用云服务商的 API 以同步资源信息以外,还提供了一个 `domain-additional-resource` 的声明式接口以允许外部推送云资源信息。这种方式适用于 DeepFlow 缺乏内置支持的云服务商,以及私有云场景
DeepFlow 除了能够主动调用(拉取)云服务商、K8s apiserver 的 API 以同步资源信息以外,还提供了一个 `domain-additional-resource` 的声明式接口以允许外部服务推送额外的资源信息。这种方式适用于同步 DeepFlow 尚未支持的公有云资源、使用 DeepFlow 社区版同步私有云资源、以及同步 CMDB 中的业务标签等场景

使用该 API 可推送的资源信息包括:
- 可用区
- VPC
- 子网
- 服务器
- 云服务器
- 自定义业务标签
- 负载均衡器

使用该 API 可推送的自定义标签包括:
Expand Down Expand Up @@ -43,15 +44,15 @@ PUT

### body

| 名称 | 类型 | 是否必填 | 说明 |
| ---------- | ------------------- | -------- | --------------------------- |
| azs | AZ 结构体数组 || availability zone(可用区) |
| vpcs | VPC 结构体数组 || virtual private cloud |
| subnets | Subnet 结构体数组 || 子网 |
| hosts | Host 结构体数组 || 服务器 |
| chosts | Chost 结构体数组 || 云服务器 |
| cloud_tags | CloudTag 结构体数组 || |
| lbs | LB 结构体数组 || load balance |
| 名称 | 类型 | 是否必填 | 说明 |
| ---------- | ------------------- | -------- | ------------------------------------------------------------ |
| azs | AZ 结构体数组 || Availability Zone(可用区) |
| vpcs | VPC 结构体数组 || Virtual Private Cloud |
| subnets | Subnet 结构体数组 || 子网 |
| hosts | Host 结构体数组 || 服务器 |
| chosts | Chost 结构体数组 || 云服务器 |
| cloud_tags | CloudTag 结构体数组 || 一般用于注入业务标签,详见[注入 CMDB 中的标签](./cmdb-tags/) |
| lbs | LB 结构体数组 || Load Balancer |


AZ 结构体
Expand Down Expand Up @@ -123,13 +124,8 @@ Vinterface 2 结构体
| ips | 字符串数组 || 例:["x.x.x.x"] |


CloudTag 结构体
| 名称 | 类型 | 是否必填 | 说明 |
| ------------- | -------------- | -------- | -------------------------------------------------------- |
| resource_type | 字符串 || 可选:chost 和 pod_ns(pod namespace) |
| resource_name | 字符串 || 资源名,从 vm.name 或 pod_namespace.name 中获取 |
| domain_uuid | 字符串 || 云平台 UUID,从 vm.domain 或 pod_namespace.domain 中获取 |
| tags | Tag 结构体数组 || 需要打标签的信息 |
CloudTag 结构体:详见[注入 CMDB 中的标签](./cmdb-tags/)


Tag 结构体
| 名称 | 类型 | 是否必填 | 说明 |
Expand Down
81 changes: 81 additions & 0 deletions docs/zh/05-features/04-auto-tagging/07-cmdb-tags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
title: 注入 CMDB 中的业务标签
permalink: /features/auto-tagging/cmdb-tags
---

当我们希望将 CMDB 中的业务标签信息与观测信号进行关联时,可以使用 DeepFlow 的 `domain-additional-resources` 声明式 API。该 API 的详细使用说明请参考[额外的云资源标签](./additional-cloud-tags/)章节,本章节主要介绍如何利用其中的 `cloud_tags` 资源同步 CMDB 中的业务标签。

通过该 API,我们可以实现如下的效果:
-**云服务器**的业务、应用、服务、负责人等标签注入至 DeepFlow 的所有观测信号中
-**K8s 命名空间**的业务、应用等标签注入至 DeepFlow 的所有观测信号中

# API 中的字段定义

CloudTag 结构体定义如下:
| 名称 | 类型 | 是否必填 | 说明 |
| ------------- | -------------- | -------- | -------------------------------------------------------- |
| resource_type | 字符串 || 可选:chost 和 pod_ns(pod namespace) |
| resource_name | 字符串 || 资源名,从 vm.name 或 pod_namespace.name 中获取 |
| domain_uuid | 字符串 || 云平台 UUID,从 vm.domain 或 pod_namespace.domain 中获取 |
| tags | Tag 结构体数组 || 需要打标签的信息 |

其中,Tag 结构体的定义如下:
| 名称 | 类型 | 是否必填 | 说明 |
| ----- | ------ | -------- | ------------------------------------------------------- |
| key | 字符串 || 限制 255 字符,不支持空格、冒号、反引号、反斜杠、单引号 |
| value | 字符串 || 限制 255 字符,不支持空格、冒号、反引号、反斜杠 |

# 调用示例

具体的调用方法请参考[额外的云资源标签](./additional-cloud-tags/)章节,本章节主要介绍其中的 cloud_tags 部分。

## 通过 HTTP API 调用

```bash
curl -XPUT -H "Content-Type:application/json" \
${deepflow_server_node_ip}:${port}/v1/domain-additional-resources/ \
-d@additional_resource.json
```

```json
{
// 注意:本 API 为声明式 API,请注意携带 API 中的其他资源信息(若有)
// "azs": [],
// "vpcs": [],
// ...

"cloud_tags": [
{
"resource_type": "xxxx",
"resource_name": "xxxx",
"domain_uuid": "xxxx",
"tags": [
{
"key": "xxxx",
"value": "xxxx"
}
]
}
],

// ...
}
```

## 通过 deepflow-ctl 命令调用

```yaml
## 注意:本 API 为声明式 API,请注意携带 API 中的其他资源信息(若有)
#azs: []
#vpcs: []
#...

cloud_tags:
- resource_type: xxxx # required. options: chost, pod_ns
resource_name: xxxx # required. (If there is a duplicate name, one will be chosen at random.)
domain_uuid: xxxx # required
subdomain_uuid: # optional. (Fill in this value if you need to set cloud tags for subdomain)
tags: # required
- key: xxxx # required. (Limited to 255 characters and does not support spaces, colon, back quotes, backslash, single quotes.)
value: xxxx # required. (Limited to 255 characters and does not support spaces, colon, back quotes, backslash.)
```

0 comments on commit 08ec9cd

Please sign in to comment.