diff --git a/server/agent_config/config.go b/server/agent_config/config.go index bb3710d7513..86e39f90307 100644 --- a/server/agent_config/config.go +++ b/server/agent_config/config.go @@ -188,6 +188,7 @@ type StaticConfig struct { ExternalProfileIntegrationDisabled *bool `yaml:"external-profile-integration-disabled,omitempty"` ExternalTraceIntegrationDisabled *bool `yaml:"external-trace-integration-disabled,omitempty"` ExternalMetricIntegrationDisabled *bool `yaml:"external-metric-integration-disabled,omitempty"` + ExternalLogIntegrationDisabled *bool `yaml:"external_log_integration_disabled,omitempty"` NtpMaxInterval *string `yaml:"ntp-max-interval,omitempty"` NtpMinInterval *string `yaml:"ntp-min-interval,omitempty"` DispatcherQueue *bool `yaml:"dispatcher-queue,omitempty"` diff --git a/server/controller/common/const.go b/server/controller/common/const.go index 10af0a053be..6b4ed1c965c 100644 --- a/server/controller/common/const.go +++ b/server/controller/common/const.go @@ -216,6 +216,7 @@ const ( VTAP_LICENSE_FUNCTION_APPLICATION_MONITORING VTAP_LICENSE_FUNCTION_INDICATOR_MONITORING VTAP_LICENSE_FUNCTION_DATABASE_MONITORING + VTAP_LICENSE_FUNCTION_LOG_MONITORING VTAP_LICENSE_FUNCTION_MAX ) diff --git a/server/controller/trisolaris/vtap/vtap_cache.go b/server/controller/trisolaris/vtap/vtap_cache.go index bc6b45f59ab..5dd693cd3c7 100644 --- a/server/controller/trisolaris/vtap/vtap_cache.go +++ b/server/controller/trisolaris/vtap/vtap_cache.go @@ -176,6 +176,7 @@ type VTapCache struct { enabledFunctionMonitoring atomicbool.Bool enabledApplicationMonitoring atomicbool.Bool enabledIndicatorMonitoring atomicbool.Bool + enabledLogMonitoring atomicbool.Bool cachedAt time.Time expectedRevision *string @@ -257,6 +258,7 @@ func NewVTapCache(vtap *models.VTap, vTapInfo *VTapInfo) *VTapCache { vTapCache.enabledFunctionMonitoring = atomicbool.NewBool(false) vTapCache.enabledApplicationMonitoring = atomicbool.NewBool(false) vTapCache.enabledIndicatorMonitoring = atomicbool.NewBool(false) + vTapCache.enabledLogMonitoring = atomicbool.NewBool(false) vTapCache.cachedAt = time.Now() vTapCache.config = &atomic.Value{} @@ -303,6 +305,7 @@ func (c *VTapCache) unsetLicenseFunctionEnable() { c.enabledFunctionMonitoring.Unset() c.enabledApplicationMonitoring.Unset() c.enabledIndicatorMonitoring.Unset() + c.enabledLogMonitoring.Unset() } func (c *VTapCache) convertLicenseFunctions() { @@ -343,6 +346,9 @@ func (c *VTapCache) convertLicenseFunctions() { if Find[int](licenseFunctionsInt, VTAP_LICENSE_FUNCTION_APPLICATION_MONITORING) { c.enabledApplicationMonitoring.Set() } + if Find[int](licenseFunctionsInt, VTAP_LICENSE_FUNCTION_LOG_MONITORING) { + c.enabledLogMonitoring.Set() + } if Find[int](licenseFunctionsInt, VTAP_LICENSE_FUNCTION_INDICATOR_MONITORING) { c.enabledIndicatorMonitoring.Set() } @@ -422,6 +428,9 @@ func (c *VTapCache) modifyVTapConfigByLicense(configure *VTapConfig) { if c.EnabledIndicatorMonitoring() == false { yamlConfig.ExternalMetricIntegrationDisabled = proto.Bool(true) } + if c.EnabledLogMonitoring() == false { + yamlConfig.ExternalLogIntegrationDisabled = proto.Bool(true) + } b, err := yaml.Marshal(yamlConfig) if err != nil { @@ -455,6 +464,10 @@ func (c *VTapCache) EnabledIndicatorMonitoring() bool { return c.enabledIndicatorMonitoring.IsSet() } +func (c *VTapCache) EnabledLogMonitoring() bool { + return c.enabledLogMonitoring.IsSet() +} + func (c *VTapCache) updateLicenseFunctions(licenseFunctions string) { c.licenseFunctions = proto.String(licenseFunctions) c.convertLicenseFunctions()