Skip to content

Commit

Permalink
flow-collector: add source ip to site-clients process name
Browse files Browse the repository at this point in the history
This results in flow metrics being generated for each
external client-vm ip.
  • Loading branch information
Karen-Schoener committed Dec 19, 2024
1 parent ddadb11 commit f4ea845
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/flow/flow_mem_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -2768,10 +2768,7 @@ func (fc *FlowCollector) purgeEventSource(eventSource EventSourceRecord) error {
return nil
}

func (fc *FlowCollector) createSiteProcess(name string, site SiteRecord) ProcessRecord {
parts := strings.Split(site.Identity, "-")
processName := name + "-" + parts[0]
processGroupName := name
func (fc *FlowCollector) createSiteProcess(processGroupName string, processName string, site SiteRecord) ProcessRecord {
process := ProcessRecord{}
process.RecType = recordNames[Process]
process.Identity = uuid.New().String()
Expand All @@ -2795,6 +2792,9 @@ func (fc *FlowCollector) needForSiteProcess(flow *FlowRecord, siteId string, sta
name = "site-clients"
}
processName := name + "-" + parts[0]
if client && flow.SourceHost != nil {
processName = processName + "-" + *flow.SourceHost
}
diffTime := startTime
wait := 120 * oneSecond
if fc.startTime > startTime {
Expand All @@ -2815,7 +2815,7 @@ func (fc *FlowCollector) needForSiteProcess(flow *FlowRecord, siteId string, sta
}
if !found {
if site, ok := fc.Sites[siteId]; ok {
process := fc.createSiteProcess(name, *site)
process := fc.createSiteProcess(name, processName, *site)
flow.Process = &process.Identity
flow.ProcessName = &processName
found = true
Expand Down

0 comments on commit f4ea845

Please sign in to comment.