Skip to content
Open
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
14 changes: 12 additions & 2 deletions extension/agenthealth/handler/useragent/useragent.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const (
flagEnhancedContainerInsights = "enhanced_container_insights"
flagSELinux = "selinux"
flagROSA = "rosa"
flagLogConcurrency = "log_concurrency"
separator = " "

typeInputs = "inputs"
Expand All @@ -48,6 +49,7 @@ var (
type UserAgent interface {
SetComponents(otelCfg *otelcol.Config, telegrafCfg *telegraf.Config)
SetContainerInsightsFlag()
SetLogConcurrencyFlag()
Header(isUsageDataEnabled bool) string
Listen(listener func())
}
Expand Down Expand Up @@ -136,10 +138,18 @@ func (ua *userAgent) SetComponents(otelCfg *otelcol.Config, telegrafCfg *telegra
}

func (ua *userAgent) SetContainerInsightsFlag() {
ua.setFlag(flagContainerInsights)
}

func (ua *userAgent) SetLogConcurrencyFlag() {
ua.setFlag(flagLogConcurrency)
}

func (ua *userAgent) setFlag(flag string) {
ua.dataLock.Lock()
defer ua.dataLock.Unlock()
if !ua.outputs.Contains(flagContainerInsights) {
ua.outputs.Add(flagContainerInsights)
if !ua.outputs.Contains(flag) {
ua.outputs.Add(flag)
ua.outputsStr.Store(componentsStr(typeOutputs, ua.outputs))
ua.notify()
}
Expand Down
1 change: 1 addition & 0 deletions plugins/outputs/cloudwatchlogs/cloudwatchlogs.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ func (c *CloudWatchLogs) getDest(t pusher.Target, logSrc logs.LogSrc) *cwDest {
c.once.Do(func() {
if c.Concurrency > 1 {
c.workerPool = pusher.NewWorkerPool(c.Concurrency)
useragent.Get().SetLogConcurrencyFlag()
}
c.targetManager = pusher.NewTargetManager(c.Log, client)
})
Expand Down