8000 update k8s domain configuration, add cluster entity upsert logic, fix journal tail mode on Ubuntu by StartE · Pull Request #2270 · alibaba/loongcollector · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

update k8s domain configuration, add cluster entity upsert logic, fix journal tail mode on Ubuntu #2270

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

Merged
merged 10 commits into from
Jun 30, 2025

Conversation

StartE
Copy link
Collaborator
@StartE StartE commented Jun 24, 2025
  • update k8s domain configuration
  • add cluster entity upsert logic
  • fix journal tail mode on Ubuntu

@StartE StartE requested review from Abingcbc and messixukejia June 24, 2025 12:21
@@ -141,6 +141,8 @@ var (
DeployMode = flag.String("DEPLOY_MODE", DeployDaemonset, "alibaba log deploy mode, daemonset or statefulset or singleton")
EnableKubernetesMeta = flag.Bool("ENABLE_KUBERNETES_META", false, "enable kubernetes meta")
ClusterID = flag.String("GLOBAL_CLUSTER_ID", "", "cluster id")
ClusterName = flag.String("GLOBAL_CLUSTER_NAME", "", "cluster name")
ClusterRegion = flag.String("GLOBAL_CLUSTER_REGION", "", "cluster region")
ClusterType = flag.String("GLOBAL_CLUSTER_TYPE", "", "cluster type, supporting ack, one, asi and k8s")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个还有用吗?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个需要的,clusterName和region都由接入测注入

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
此处用到

Copy link
Collaborator Author
@StartE StartE Jun 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

优化了一下此处的描述

lastSendClusterTime = time.Now()
}

clusterEntity := m.generateClusterEntity()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个不用每次都生成,可以存起来

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

虽然entity的属性没有变化,但是observe的时间是在不断变化的,如果observe的时间不是近期的,那么实体就失效了,因此需要每次都生成

acsDomain = "acs"
infraDomain = "infra"

k8sDomain = "k8s"
ackCluster = "ack"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些还需要吗?

Copy link
Collaborator Author
@StartE StartE Jun 26, 2025
< 10000 div hidden="hidden" data-view-component="true" class="js-comment-show-on-error flash flash-error flash-full">

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

acs和infra都删除了,clusterType如果不配默认就是k8s,支持后续配置拓展

Copy link
Collaborator Author
@StartE StartE Jun 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack、one、asi等测试domain可配置化,这里用到,因此保留
image

@StartE StartE requested a review from Abingcbc June 26, 2025 02:20
acsDomain = "acs"
infraDomain = "infra"

k8sDomain = "k8s"
ackCluster = "ack"
>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

删掉这些吧

@@ -401,13 +403,15 @@ func (m *metaCollector) generateClusterEntity() models.PipelineEvent {
log.Timestamp = uint64(time.Now().Unix())
log.Contents.Add(entityDomainFieldName, m.serviceK8sMeta.domain)
log.Contents.Add(entityTypeFieldName, m.genEntityTypeKey(clusterTypeName))
log.Contents.Add(entityIDFieldName, m.genKey("", "", ""))
log.Contents.Add(entityIDFieldName, m.genKey(clusterTypeName, "", ""))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kind

8000

@yyuuttaaoo yyuuttaaoo merged commit aa45566 into alibaba:main Jun 30, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0