Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename cloud server to cloud host #8976

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ DeepFlow 社区版由企业版的核心组件构成。通过开源,我们希

# 软件架构

DeepFlow Community 版本主要由 Agent 和 Server 两个进程组成。每个 K8s 容器节点、传统服务器或云服务器中运行一个 Agent ,负责该服务器上所有应用进程的数据采集。Server 运行在一个 K8s 集群中,提供 Agent 管理、标签注入、数据写入、数据查询服务。
DeepFlow Community 版本主要由 Agent 和 Server 两个进程组成。每个 K8s 容器节点、传统服务器或云主机中运行一个 Agent ,负责该服务器上所有应用进程的数据采集。Server 运行在一个 K8s 集群中,提供 Agent 管理、标签注入、数据写入、数据查询服务。

![DeepFlow 软件架构](./docs/deepflow-architecture.png)

Expand Down
2 changes: 1 addition & 1 deletion message/voucher.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ message Voucher {
optional uint32 recharge_amount = 7; // 充值金额
optional string activation_time = 8; // 生效日期 "2019-09-11"
optional uint32 expiration_days = 9; // 有效时间
optional float tm_cloud_server_price = 10; // 流量监控-云服务器单价
optional float tm_cloud_server_price = 10; // 流量监控-云主机单价
optional float tm_container_node_price = 11; // 流量监控-容器节点单价
}

4 changes: 2 additions & 2 deletions server/controller/cloud/huawei/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (h *HuaWei) getVMs() ([]model.VM, []model.VInterface, []model.IP, error) {
var ips []model.IP
for project, token := range h.projectTokenMap {
// 华为云官方文档:
// 云服务器的标签列表。微版本2.26及以上版本支持,如果不使用微版本查询,响应中无tags字段。
// 云主机的标签列表。微版本2.26及以上版本支持,如果不使用微版本查询,响应中无tags字段。
jVMs, err := h.getRawData(newRawDataGetContext(
fmt.Sprintf("https://ecs.%s.%s/v2.1/%s/servers/detail", project.name, h.config.Domain, project.id), token.token, "servers", pageQueryMethodMarker,
).addHeader("X-OpenStack-Nova-API-Version", "2.26"))
Expand Down Expand Up @@ -106,7 +106,7 @@ func (h *HuaWei) getVMs() ([]model.VM, []model.VInterface, []model.IP, error) {
}

// 华为云官方文档:
// 华为云云服务器标签规则
// 华为云云主机标签规则
//
// key与value使用“=”连接,如“key=value”。
// 如果value为空字符串,则仅返回key。
Expand Down
2 changes: 1 addition & 1 deletion server/controller/cloud/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (c *Cloud) getKubernetesData() model.Resource {
regions = append(regions, kubernetesGatherResource.Region)
}

// 将所有容器节点默认同步为云服务器
// 将所有容器节点默认同步为云主机
vms := []model.VM{}
vmPodNodeConnections := []model.VMPodNodeConnection{}
for _, node := range kubernetesGatherResource.PodNodes {
Expand Down
4 changes: 2 additions & 2 deletions server/controller/common/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ var VTapTypeName = map[int]string{
var VTapTypeChinese = map[int]string{
VTAP_TYPE_KVM: "KVM",
VTAP_TYPE_ESXI: "ESXI",
VTAP_TYPE_WORKLOAD_V: "云服务器-V",
VTAP_TYPE_WORKLOAD_P: "云服务器-P",
VTAP_TYPE_WORKLOAD_V: "云主机-V",
VTAP_TYPE_WORKLOAD_P: "云主机-P",
VTAP_TYPE_DEDICATED: "专属服务器",
VTAP_TYPE_POD_HOST: "容器-P",
VTAP_TYPE_POD_VM: "容器-V",
Expand Down
4 changes: 2 additions & 2 deletions server/controller/db/mysql/migrator/schema/rawsql/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1417,14 +1417,14 @@ INSERT INTO alarm_policy(user_id, tag_conditions, query_conditions, query_url, q
app_type, contrast_type, target_field, threshold_warning, lcuuid)
values(1, '过滤项: tag.type = chost_pod_node_connection', '[{\"type\":\"deepflow\",\"tableName\":\"deepflow_server_controller_resource_relation_exception\",\"dbName\":\"deepflow_tenant\",\"metrics\":[{\"description\":\"\",\"typeName\":\"counter\",\"METRIC_CATEGORY\":\"metrics\",\"METRIC\":\"metrics.count\",\"METRIC_NAME\":\"metrics.count\",\"isTimeUnit\":false,\"type\":1,\"unit\":[\"data\",\"short\"],\"checked\":true,\"operatorLv2\":[],\"_key\":\"77b0ee61-e213-4d10-9342-bb172f861f39\",\"perOperator\":\"\",\"operatorLv1\":\"Sum\",\"percentile\":null,\"markLine\":null,\"diffMarkLine\":null,\"METRIC_LABEL\":\"Sum(metrics.count)\",\"ORIGIN_METRIC_LABEL\":\"Sum(metrics.count)\"}],\"condition\":{\"dbName\":\"deepflow_tenant\",\"tableName\":\"deepflow_server_controller_resource_relation_exception\",\"type\":\"simplified\",\"RESOURCE_SETS\":[{\"id\":\"R1\",\"condition\":[{\"key\":\"tag.type\",\"op\":\"=\",\"val\":[\"chost_pod_node_connection\"]}],\"groupBy\":[\"_\",\"tag.domain\"],\"groupInfo\":{\"mainGroupInfo\":[\"_\"],\"otherGroupInfo\":[\"tag.domain\"]},\"inputMode\":\"free\"}]},\"dataSource\":\"\"}]',
'/v1/stats/querier/UniversalHistory', '{\"DATABASE\":\"deepflow_tenant\",\"TABLE\":\"deepflow_server_controller_resource_relation_exception\",\"interval\":60,\"fill\": \"none\",\"window_size\":1,\"QUERIES\":[{\"QUERY_ID\":\"R1\",\"SELECT\":\"Sum(`metrics.count`) AS `Sum(metrics.count)`\",\"WHERE\":\"`tag.type`=\'chost_pod_node_connection\'\",\"GROUP_BY\":\"`tag.domain`\",\"METRICS\":[\"Sum(`metrics.count`) AS `Sum(metrics.count)`\"]}]}',
'云资源关联关系异常 (云服务器与容器节点)', 0, 1, 1, 1, '{\"displayName\":\"Sum(metrics.count)\",\"unit\":\"\"}', '{\"OP\":\">=\",\"VALUE\":1}', @lcuuid);
'云资源关联关系异常 (云主机与容器节点)', 0, 1, 1, 1, '{\"displayName\":\"Sum(metrics.count)\",\"unit\":\"\"}', '{\"OP\":\">=\",\"VALUE\":1}', @lcuuid);

set @lcuuid = (select uuid());
INSERT INTO alarm_policy(user_id, tag_conditions, query_conditions, query_url, query_params, name, level, state,
app_type, contrast_type, target_field, threshold_warning, lcuuid)
values(1, '过滤项: N/A', '[{\"type\":\"deepflow\",\"tableName\":\"deepflow_server_controller_resource_sync_delay\",\"dbName\":\"deepflow_tenant\",\"metrics\":[{\"description\":\"\",\"typeName\":\"counter\",\"METRIC_CATEGORY\":\"metrics\",\"METRIC\":\"metrics.max_delay\",\"METRIC_NAME\":\"metrics.max_delay\",\"isTimeUnit\":false,\"type\":1,\"unit\":[\"data\",\"short\"],\"checked\":true,\"operatorLv2\":[],\"_key\":\"77b0ee61-e213-4d10-9342-bb172f861f39\",\"perOperator\":\"\",\"operatorLv1\":\"Max\",\"percentile\":null,\"markLine\":null,\"diffMarkLine\":null,\"METRIC_LABEL\":\"Max(metrics.max_delay)\",\"ORIGIN_METRIC_LABEL\":\"Max(metrics.max_delay)\"}],\"condition\":{\"dbName\":\"deepflow_tenant\",\"tableName\":\"deepflow_server_controller_resource_sync_delay\",\"type\":\"simplified\",\"RESOURCE_SETS\":[{\"id\":\"R1\",\"condition\":[],\"groupBy\":[\"_\",\"tag.domain\"],\"groupInfo\":{\"mainGroupInfo\":[\"_\"],\"otherGroupInfo\":[\"tag.domain\"]},\"inputMode\":\"free\"}]},\"dataSource\":\"\"}]',
'/v1/stats/querier/UniversalHistory', '{\"DATABASE\":\"deepflow_tenant\",\"TABLE\":\"deepflow_server_controller_resource_sync_delay\",\"interval\":60,\"fill\": \"none\",\"window_size\":1,\"QUERIES\":[{\"QUERY_ID\":\"R1\",\"SELECT\":\"Max(`metrics.max_delay`) AS `Max(metrics.max_delay)`\",\"WHERE\":\"1=1\",\"GROUP_BY\":\"`tag.domain`\",\"METRICS\":[\"Max(`metrics.max_delay`) AS `Max(metrics.max_delay)`\"]}]}',
'云资源同步滞后 (云服务器)', 0, 1, 1, 1, '{\"displayName\":\"Max(metrics.max_delay)\",\"unit\":\"\"}', '{\"OP\":\">=\",\"VALUE\":150}', @lcuuid);
'云资源同步滞后 (云主机)', 0, 1, 1, 1, '{\"displayName\":\"Max(metrics.max_delay)\",\"unit\":\"\"}', '{\"OP\":\">=\",\"VALUE\":150}', @lcuuid);

set @lcuuid = (select uuid());
INSERT INTO alarm_policy(user_id, tag_conditions, query_conditions, query_url, query_params, name, level, state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ INSERT INTO alarm_policy(user_id, tag_conditions, query_conditions, query_url, q
app_type, contrast_type, target_field, threshold_warning, lcuuid)
values(1, '过滤项: tag.type = chost_pod_node_connection', '[{\"type\":\"deepflow\",\"tableName\":\"deepflow_server_controller_resource_relation_exception\",\"dbName\":\"deepflow_tenant\",\"metrics\":[{\"description\":\"\",\"typeName\":\"counter\",\"METRIC_CATEGORY\":\"metrics\",\"METRIC\":\"metrics.count\",\"METRIC_NAME\":\"metrics.count\",\"isTimeUnit\":false,\"type\":1,\"unit\":[\"data\",\"short\"],\"checked\":true,\"operatorLv2\":[],\"_key\":\"77b0ee61-e213-4d10-9342-bb172f861f39\",\"perOperator\":\"\",\"operatorLv1\":\"Sum\",\"percentile\":null,\"markLine\":null,\"diffMarkLine\":null,\"METRIC_LABEL\":\"Sum(metrics.count)\",\"ORIGIN_METRIC_LABEL\":\"Sum(metrics.count)\"}],\"condition\":{\"dbName\":\"deepflow_tenant\",\"tableName\":\"deepflow_server_controller_resource_relation_exception\",\"type\":\"simplified\",\"RESOURCE_SETS\":[{\"id\":\"R1\",\"condition\":[{\"key\":\"tag.type\",\"op\":\"=\",\"val\":[\"chost_pod_node_connection\"]}],\"groupBy\":[\"_\",\"tag.domain\"],\"groupInfo\":{\"mainGroupInfo\":[\"_\"],\"otherGroupInfo\":[\"tag.domain\"]},\"inputMode\":\"free\"}]},\"dataSource\":\"\"}]',
'/v1/stats/querier/UniversalHistory', '{\"DATABASE\":\"deepflow_tenant\",\"TABLE\":\"deepflow_server_controller_resource_relation_exception\",\"interval\":60,\"fill\": \"none\",\"window_size\":1,\"QUERIES\":[{\"QUERY_ID\":\"R1\",\"SELECT\":\"Sum(`metrics.count`) AS `Sum(metrics.count)`\",\"WHERE\":\"`tag.type`=\'chost_pod_node_connection\'\",\"GROUP_BY\":\"`tag.domain`\",\"METRICS\":[\"Sum(`metrics.count`) AS `Sum(metrics.count)`\"]}]}',
'云资源关联关系异常 (云服务器与容器节点)', 0, 1, 1, 1, '{\"displayName\":\"Sum(metrics.count)\",\"unit\":\"\"}', '{\"OP\":\">=\",\"VALUE\":1}', @lcuuid);
'云资源关联关系异常 (云主机与容器节点)', 0, 1, 1, 1, '{\"displayName\":\"Sum(metrics.count)\",\"unit\":\"\"}', '{\"OP\":\">=\",\"VALUE\":1}', @lcuuid);

set @lcuuid = (select uuid());
INSERT INTO alarm_policy(user_id, tag_conditions, query_conditions, query_url, query_params, name, level, state,
app_type, contrast_type, target_field, threshold_warning, lcuuid)
values(1, '过滤项: N/A', '[{\"type\":\"deepflow\",\"tableName\":\"deepflow_server_controller_resource_sync_delay\",\"dbName\":\"deepflow_tenant\",\"metrics\":[{\"description\":\"\",\"typeName\":\"counter\",\"METRIC_CATEGORY\":\"metrics\",\"METRIC\":\"metrics.max_delay\",\"METRIC_NAME\":\"metrics.max_delay\",\"isTimeUnit\":false,\"type\":1,\"unit\":[\"data\",\"short\"],\"checked\":true,\"operatorLv2\":[],\"_key\":\"77b0ee61-e213-4d10-9342-bb172f861f39\",\"perOperator\":\"\",\"operatorLv1\":\"Max\",\"percentile\":null,\"markLine\":null,\"diffMarkLine\":null,\"METRIC_LABEL\":\"Max(metrics.max_delay)\",\"ORIGIN_METRIC_LABEL\":\"Max(metrics.max_delay)\"}],\"condition\":{\"dbName\":\"deepflow_tenant\",\"tableName\":\"deepflow_server_controller_resource_sync_delay\",\"type\":\"simplified\",\"RESOURCE_SETS\":[{\"id\":\"R1\",\"condition\":[],\"groupBy\":[\"_\",\"tag.domain\"],\"groupInfo\":{\"mainGroupInfo\":[\"_\"],\"otherGroupInfo\":[\"tag.domain\"]},\"inputMode\":\"free\"}]},\"dataSource\":\"\"}]',
'/v1/stats/querier/UniversalHistory', '{\"DATABASE\":\"deepflow_tenant\",\"TABLE\":\"deepflow_server_controller_resource_sync_delay\",\"interval\":60,\"fill\": \"none\",\"window_size\":1,\"QUERIES\":[{\"QUERY_ID\":\"R1\",\"SELECT\":\"Max(`metrics.max_delay`) AS `Max(metrics.max_delay)`\",\"WHERE\":\"1=1\",\"GROUP_BY\":\"`tag.domain`\",\"METRICS\":[\"Max(`metrics.max_delay`) AS `Max(metrics.max_delay)`\"]}]}',
'云资源同步滞后 (云服务器)', 0, 1, 1, 1, '{\"displayName\":\"Max(metrics.max_delay)\",\"unit\":\"\"}', '{\"OP\":\">=\",\"VALUE\":150}', @lcuuid);
'云资源同步滞后 (云主机)', 0, 1, 1, 1, '{\"displayName\":\"Max(metrics.max_delay)\",\"unit\":\"\"}', '{\"OP\":\">=\",\"VALUE\":150}', @lcuuid);

set @lcuuid = (select uuid());
INSERT INTO alarm_policy(user_id, tag_conditions, query_conditions, query_url, query_params, name, level, state,
Expand Down
2 changes: 1 addition & 1 deletion server/controller/recorder/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func (r *domain) executeUpdaters(updatersInUpdateOrder []updater.ResourceUpdater

// 删除操作的顺序,是创建的逆序
// 特殊资源:VMPodNodeConnection虽然是末序创建,但需要末序删除,序号-1;
// 原因:避免数据量大时,此数据删除后,云服务器、容器节点还在,导致采集器类型变化
// 原因:避免数据量大时,此数据删除后,云主机、容器节点还在,导致采集器类型变化
processUpdater := updatersInUpdateOrder[len(updatersInUpdateOrder)-1]
vmPodNodeConnectionUpdater := updatersInUpdateOrder[len(updatersInUpdateOrder)-2]
// 因为 processUpdater 是 -1,VMPodNodeConnection 是 -2,特殊处理后,逆序删除从 -3 开始
Expand Down
2 changes: 1 addition & 1 deletion server/controller/recorder/sub_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func (r *subDomain) executeUpdaters(updatersInUpdateOrder []updater.ResourceUpda

// 删除操作的顺序,是创建的逆序
// 特殊资源:VMPodNodeConnection虽然是末序创建,但需要末序删除,序号-1;
// 原因:避免数据量大时,此数据删除后,云服务器、容器节点还在,导致采集器类型变化
// 原因:避免数据量大时,此数据删除后,云主机、容器节点还在,导致采集器类型变化
processUpdater := updatersInUpdateOrder[len(updatersInUpdateOrder)-1]
vmPodNodeConnectionUpdater := updatersInUpdateOrder[len(updatersInUpdateOrder)-2]
// 因为 processUpdater 是 -1,VMPodNodeConnection 是 -2,特殊处理后,逆序删除从 -3 开始
Expand Down
6 changes: 3 additions & 3 deletions server/controller/tagrecorder/ch_ip_relation.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func (i *ChIPRelation) generateFromNATGateway(keyToDBItem map[IPRelationKey]mysq
}
}
// VPCID:网关VPC
// IP:网关关联的云服务器自身IP
// IP:网关关联的云主机自身IP
for _, natVMConn := range natVMConns {
if natVMConn.NATGatewayID != natGateway.ID {
continue
Expand Down Expand Up @@ -299,7 +299,7 @@ func (i *ChIPRelation) generateFromLB(keyToDBItem map[IPRelationKey]mysqlmodel.C
}
}
// VPCID:负载均衡器VPC
// IP:负载均衡器关联的云服务器自身IP
// IP:负载均衡器关联的云主机自身IP
for _, lbVMConn := range lbVMConns {
if lbVMConn.LBID != lb.ID {
continue
Expand Down Expand Up @@ -334,7 +334,7 @@ func (i *ChIPRelation) generateFromLB(keyToDBItem map[IPRelationKey]mysqlmodel.C
TeamID: DomainToTeamID[lb.Domain],
}
}
// VPCID:负载均衡器VPC、后端主机云服务器VPC
// VPCID:负载均衡器VPC、后端主机云主机VPC
// IP:后端主机IP
for _, lbTS := range lbListenerIDToLBTargetServers[lbListener.ID] {
parsedIP := net.ParseIP(lbTS.IP)
Expand Down
6 changes: 3 additions & 3 deletions server/controller/tagrecorder/check/ch_ip_relation.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (i *ChIPRelation) generateFromNATGateway(keyToDBItem map[IPRelationKey]mysq
}
}
// VPCID:网关VPC
// IP:网关关联的云服务器自身IP
// IP:网关关联的云主机自身IP
for _, natVMConn := range natVMConns {
if natVMConn.NATGatewayID != natGateway.ID {
continue
Expand Down Expand Up @@ -290,7 +290,7 @@ func (i *ChIPRelation) generateFromLB(keyToDBItem map[IPRelationKey]mysqlmodel.C
}
}
// VPCID:负载均衡器VPC
// IP:负载均衡器关联的云服务器自身IP
// IP:负载均衡器关联的云主机自身IP
for _, lbVMConn := range lbVMConns {
if lbVMConn.LBID != lb.ID {
continue
Expand Down Expand Up @@ -319,7 +319,7 @@ func (i *ChIPRelation) generateFromLB(keyToDBItem map[IPRelationKey]mysqlmodel.C
LBListenerName: lbListener.Name,
}
}
// VPCID:负载均衡器VPC、后端主机云服务器VPC
// VPCID:负载均衡器VPC、后端主机云主机VPC
// IP:后端主机IP
for _, lbTS := range lbListenerIDToLBTargetServers[lbListener.ID] {
var vpcID int
Expand Down
4 changes: 2 additions & 2 deletions server/querier/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ parse/
"chost",
"chost_0",
"chost_1",
"云服务器",
"云主机",
"resource_id"
],
[
"chost_name",
"chost_name_0",
"chost_name_1",
"云服务器名称",
"云主机名称",
"resource_name"
]
]
Expand Down
2 changes: 1 addition & 1 deletion server/querier/app/prometheus/service/converters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ func TestParsePromQLTag(t *testing.T) {
}
p.getExternalTagFromCache = executor.convertExternalTagToQuerierAllowTag
tagdescription.TAG_ENUMS["l7_protocol"] = []*tagdescription.TagEnum{{Value: 20, DisplayNameEN: "HTTP"}}
tagdescription.TAG_ENUMS["auto_service_type.ch"] = []*tagdescription.TagEnum{{Value: 1, DisplayNameZH: "云服务器"}}
tagdescription.TAG_ENUMS["auto_service_type.ch"] = []*tagdescription.TagEnum{{Value: 1, DisplayNameZH: "云主机"}}
tagdescription.TAG_ENUMS["auto_service_type.en"] = []*tagdescription.TagEnum{{Value: 1, DisplayNameEN: "Cloud Host"}}

// Test cases generation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ timestamp , 时间微秒 , 单位: 微秒
region , 区域 ,
az , 可用区 ,
host , 宿主机 , 承载虚拟机的宿主机。
chost , 云服务器 , 包括虚拟机、裸金属服务器。
chost , 云主机 , 包括虚拟机、裸金属服务器。
vpc , VPC ,
router , 路由器 ,
subnet , 子网 ,
Expand All @@ -31,8 +31,8 @@ auto_service , 自动服务 , 在`auto_instance`
gprocess , 进程 ,
host_ip , 宿主机 , 宿主机的管理 IP。
host_hostname , 宿主机 , 宿主机的 Hostname。
chost_ip , 云服务器 , 云服务器的主 IP。
chost_hostname , 云服务器 , 云服务器的 Hostname。
chost_ip , 云主机 , 云主机的主 IP。
chost_hostname , 云主机 , 云主机的 Hostname。
pod_node_ip , K8s 容器节点 , 容器节点的主 IP。
pod_node_hostname , K8s 容器节点 , 容器节点的 Hostname。
user , 用户 ,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Value , DisplayName , Description
0 , Internet IP ,
1 , 云服务器 ,
1 , 云主机 ,
5 , 路由器 ,
6 , 宿主机 ,
9 , DHCP 网关 ,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Value , DisplayName , Description
0 , Internet IP ,
1 , 云服务器 ,
1 , 云主机 ,
5 , 路由器 ,
6 , 宿主机 ,
9 , DHCP 网关 ,
Expand Down
Loading
Loading