chore: update agent config with cluster name (#148)

* chore: update agent config with cluster name

* docs: update release-notes

---------

Co-authored-by: hardy <luohf@infinilabs.com>
This commit is contained in:
Hardy 2025-02-18 20:29:41 +08:00 committed by GitHub
parent 06f7d3bc77
commit 1e601f259b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 1 deletions

View File

@ -34,6 +34,7 @@ pipeline:
labels:
cluster_id: $[[CLUSTER_ID]]
cluster_uuid: $[[CLUSTER_UUID]]
cluster_name: $[[CLUSTER_NAME]]
when:
cluster_available: ["$[[TASK_ID]]"]
@ -49,6 +50,7 @@ pipeline:
labels:
cluster_id: $[[CLUSTER_ID]]
cluster_uuid: $[[CLUSTER_UUID]]
cluster_name: $[[CLUSTER_NAME]]
logs_path: $[[NODE_LOGS_PATH]]
queue_name: logs
when:

View File

@ -6,6 +6,7 @@ title: "Release Notes"
# Release Notes
Information about release notes of INFINI Console is provided here.
## Latest (In development)
### Breaking changes
@ -15,7 +16,9 @@ Information about release notes of INFINI Console is provided here.
### Bug fix
- Fixed the error when querying empty metric data (#144)
- Fixed empty host when setup step finishes (#147)
### Improvements
- Update agent config with cluster name (#148)
## 1.28.2 (2025-02-15)

View File

@ -6,6 +6,7 @@ title: "版本历史"
# 版本发布日志
这里是 INFINI Console 历史版本发布的相关说明。
## Latest (In development)
### Breaking changes
@ -15,7 +16,9 @@ title: "版本历史"
### Bug fix
- 修复指标数据为空时的查询错误 (#144)
- 修复初始化结束步骤中主机显示为错误的问题 (#147)
### Improvements
- 优化下发给 Agent 的配置,增加集群名称 (#148)
## 1.28.2 (2025-02-15)

View File

@ -199,11 +199,13 @@ func getAgentIngestConfigs(instance string, items map[string]BindingItem) (strin
var password = ""
var version = ""
var distribution = ""
var clusterName = ""
if metadata.Config != nil {
version = metadata.Config.Version
distribution = metadata.Config.Distribution
clusterName = metadata.Config.Name
if metadata.Config.AgentCredentialID != "" {
credential, err := common2.GetCredential(metadata.Config.AgentCredentialID)
@ -250,6 +252,7 @@ func getAgentIngestConfigs(instance string, items map[string]BindingItem) (strin
"variable:\n "+
"TASK_ID: %v\n "+
"CLUSTER_ID: %v\n "+
"CLUSTER_NAME: %v\n "+
"CLUSTER_UUID: %v\n "+
"NODE_UUID: %v\n "+
"CLUSTER_VERSION: %v\n "+
@ -260,7 +263,7 @@ func getAgentIngestConfigs(instance string, items map[string]BindingItem) (strin
"CLUSTER_LEVEL_TASKS_ENABLED: %v\n "+
"NODE_LEVEL_TASKS_ENABLED: %v\n "+
"NODE_LOGS_PATH: \"%v\"\n\n\n", taskID, taskID,
v.ClusterID, v.ClusterUUID, v.NodeUUID, version, distribution, nodeEndPoint, username, password, clusterLevelEnabled, nodeLevelEnabled, pathLogs)))
v.ClusterID, clusterName, v.ClusterUUID, v.NodeUUID, version, distribution, nodeEndPoint, username, password, clusterLevelEnabled, nodeLevelEnabled, pathLogs)))
}
hash := util.MD5digest(buffer.String())