Skip to content

Commit

Permalink
[Controller] agent config add new fields
Browse files Browse the repository at this point in the history
  • Loading branch information
jin-xiaofeng authored and SongZhen0704 committed May 28, 2024
1 parent d645f76 commit 5613b66
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cli/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/bitly/go-simplejson v0.5.0
github.com/deepflowio/deepflow/message v0.0.0-20240521151831-c9de50d1a803
github.com/deepflowio/deepflow/message v0.0.0-20240527060827-9ad113dbccad
github.com/deepflowio/deepflow/server v0.0.0-20240521151831-c9de50d1a803
github.com/golang/protobuf v1.5.4
github.com/mattn/go-runewidth v0.0.14
Expand Down
4 changes: 2 additions & 2 deletions cli/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/deepflowio/deepflow/message v0.0.0-20240521151831-c9de50d1a803 h1:uph8H3r/9j58oH/kFspuu2yh6pnlZ6no7nQUwD6KNME=
github.com/deepflowio/deepflow/message v0.0.0-20240521151831-c9de50d1a803/go.mod h1:e+1lUMMlycCvFRKvlwt/y/0vxJnF8wVss3GyR1ARXY0=
github.com/deepflowio/deepflow/message v0.0.0-20240527060827-9ad113dbccad h1:7fDWYpLr7Xd0LXrYDkFqQSv2luydJ+uqrU2c9bVCKgw=
github.com/deepflowio/deepflow/message v0.0.0-20240527060827-9ad113dbccad/go.mod h1:e+1lUMMlycCvFRKvlwt/y/0vxJnF8wVss3GyR1ARXY0=
github.com/deepflowio/deepflow/server v0.0.0-20240521151831-c9de50d1a803 h1:Dh1tTAiMOWrhOVp6idJydvV+hHCZgcfBoGi9tU2mI60=
github.com/deepflowio/deepflow/server v0.0.0-20240521151831-c9de50d1a803/go.mod h1:C4Tk88hF3MBM+MexSqbbwI+6UxA9Yo0OJede6ab4pTE=
github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ func (e *VTapEvent) generateConfigInfo(c *vtap.VTapCache, clusterID string, gVTa
SystemLoadCircuitBreakerThreshold: proto.Float32((vtapConfig.SystemLoadCircuitBreakerThreshold)),
SystemLoadCircuitBreakerRecover: proto.Float32((vtapConfig.SystemLoadCircuitBreakerRecover)),
SystemLoadCircuitBreakerMetric: &loadMetric,

TeamId: proto.Uint32(uint32(c.GetTeamID())),
OrganizeId: proto.Uint32(uint32(c.GetOrganizeID())),
}

cacheTSBIP := c.GetTSDBIP()
Expand Down
14 changes: 12 additions & 2 deletions server/controller/trisolaris/vtap/vtap_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ type VTapCache struct {
licenseType int
tapMode int
teamID int
organizeID int
lcuuid *string
licenseFunctions *string
licenseFunctionSet mapset.Set
Expand Down Expand Up @@ -218,7 +219,7 @@ func (c *VTapCache) String() string {
"ctrlIP:%s, ctrlMac:%s, tsdbIP: %s, curTSDBIP: %s, controllerIP: %s, "+
"curControllerIP: %s, launchServer: %s, launchServerID: %d, syncedControllerAt: %s, "+
"syncedTSDBAt: %s, bootTime: %d, exceptions: %d, vTapGroupLcuuid: %s, licenseType: %d, "+
"tapMode: %d, teamID: %d, licenseFunctionSet: %s, enabledTrafficDistribution: %v, "+
"tapMode: %d, teamID: %d, organizeID: %d, licenseFunctionSet: %s, enabledTrafficDistribution: %v, "+
"enabledNetworkMonitoring: %v, enabledCallMonitoring: %v, enabledFunctionMonitoring: %v, "+
"enabledApplicationMonitoring: %v, enabledIndicatorMonitoring: %v, enabledLogMonitoring: %v, "+
"podDomains: %v, pushVersionPlatformData: %d, pushVersionPolicy: %d, pushVersionGroups: %d, "+
Expand All @@ -227,7 +228,7 @@ func (c *VTapCache) String() string {
c.GetCtrlIP(), c.GetCtrlMac(), c.GetTSDBIP(), c.GetCurTSDBIP(), c.GetControllerIP(),
c.GetCurControllerIP(), c.GetLaunchServer(), c.GetLaunchServerID(), c.GetSyncedControllerAt(),
c.GetSyncedTSDBAt(), c.GetBootTime(), c.GetExceptions(), c.GetVTapGroupLcuuid(), c.licenseType,
c.tapMode, c.teamID, c.licenseFunctionSet, c.EnabledTrafficDistribution(),
c.tapMode, c.teamID, c.organizeID, c.licenseFunctionSet, c.EnabledTrafficDistribution(),
c.EnabledNetworkMonitoring(), c.EnabledCallMonitoring(), c.EnabledFunctionMonitoring(),
c.EnabledApplicationMonitoring(), c.EnabledIndicatorMonitoring(), c.EnabledLogMonitoring(),
c.podDomains, c.pushVersionPlatformData, c.pushVersionPolicy, c.pushVersionGroups,
Expand Down Expand Up @@ -272,6 +273,7 @@ func NewVTapCache(vtap *mysql.VTap, vTapInfo *VTapInfo) *VTapCache {
vTapCache.licenseType = vtap.LicenseType
vTapCache.tapMode = vtap.TapMode
vTapCache.teamID = vtap.TeamID
vTapCache.organizeID = vTapInfo.GetORGID()
vTapCache.lcuuid = proto.String(vtap.Lcuuid)
vTapCache.licenseFunctions = proto.String(vtap.LicenseFunctions)
vTapCache.licenseFunctionSet = mapset.NewSet()
Expand Down Expand Up @@ -865,6 +867,14 @@ func (c *VTapCache) updateTeamID(teamID int) {
c.teamID = teamID
}

func (c *VTapCache) updateOrganizeID(organizeID int) {
c.organizeID = organizeID
}

func (c *VTapCache) GetOrganizeID() int {
return c.organizeID
}

func (c *VTapCache) UpdateRevision(revision string) {
c.revision = &revision
}
Expand Down
2 changes: 1 addition & 1 deletion server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ require (
github.com/cornelk/hashmap v1.0.8
github.com/deckarep/golang-set v1.8.0
github.com/deckarep/golang-set/v2 v2.1.0
github.com/deepflowio/deepflow/message v0.0.0-20240508092310-e45a3d549f9b
github.com/deepflowio/deepflow/message v0.0.0-20240527060827-9ad113dbccad
github.com/deepflowio/deepflow/server/controller/cloud/kubernetes_gather/expand v0.0.0-00010101000000-000000000000
github.com/deepflowio/deepflow/server/controller/cloud/platform v0.0.0-00010101000000-000000000000
github.com/deepflowio/deepflow/server/controller/cloud/tencent/expand v0.0.0-00010101000000-000000000000
Expand Down
4 changes: 2 additions & 2 deletions server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsP
github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo=
github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI=
github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4=
github.com/deepflowio/deepflow/message v0.0.0-20240508092310-e45a3d549f9b h1:dDrPqgS+JP/2tc8zIIO58Xm6ulv8nOnezEpo2wgPSEc=
github.com/deepflowio/deepflow/message v0.0.0-20240508092310-e45a3d549f9b/go.mod h1:e+1lUMMlycCvFRKvlwt/y/0vxJnF8wVss3GyR1ARXY0=
github.com/deepflowio/deepflow/message v0.0.0-20240527060827-9ad113dbccad h1:7fDWYpLr7Xd0LXrYDkFqQSv2luydJ+uqrU2c9bVCKgw=
github.com/deepflowio/deepflow/message v0.0.0-20240527060827-9ad113dbccad/go.mod h1:e+1lUMMlycCvFRKvlwt/y/0vxJnF8wVss3GyR1ARXY0=
github.com/deepflowio/tempopb v0.0.0-20230215110519-15853baf3a79 h1:erRwXyZiUZxxZX/Q1QHesZXgxjiunZUFy+ggCRimkD4=
github.com/deepflowio/tempopb v0.0.0-20230215110519-15853baf3a79/go.mod h1:h2rkZ319TExIUGuK8a2dlcGd8qc6wdhsrcpXWaJQaQE=
github.com/dennwc/varint v1.0.0 h1:kGNFFSSw8ToIy3obO/kKr8U9GZYUAxQEVuix4zfDWzE=
Expand Down

0 comments on commit 5613b66

Please sign in to comment.