@@ -457,7 +457,7 @@ func (c *WatchClient) extractPodAttributes(pod *api_v1.Pod) (map[string]string,
457
457
if c .Rules .PodName {
458
458
tags [conventions .AttributeK8SPodName ] = pod .Name
459
459
}
460
- if c .Rules .Service {
460
+ if c .Rules .ServiceAttributes {
461
461
serviceNames [conventions .AttributeK8SPodName ] = pod .Name
462
462
}
463
463
@@ -494,7 +494,7 @@ func (c *WatchClient) extractPodAttributes(pod *api_v1.Pod) (map[string]string,
494
494
c .Rules .JobUID || c .Rules .JobName ||
495
495
c .Rules .StatefulSetUID || c .Rules .StatefulSetName ||
496
496
c .Rules .DeploymentName || c .Rules .DeploymentUID ||
497
- c .Rules .CronJobName || c .Rules .Service {
497
+ c .Rules .CronJobName || c .Rules .ServiceAttributes {
498
498
for _ , ref := range pod .OwnerReferences {
499
499
switch ref .Kind {
500
500
case "ReplicaSet" :
@@ -504,17 +504,17 @@ func (c *WatchClient) extractPodAttributes(pod *api_v1.Pod) (map[string]string,
504
504
if c .Rules .ReplicaSetName {
505
505
tags [conventions .AttributeK8SReplicaSetName ] = ref .Name
506
506
}
507
- if c .Rules .Service {
507
+ if c .Rules .ServiceAttributes {
508
508
serviceNames [conventions .AttributeK8SReplicaSetName ] = ref .Name
509
509
}
510
- if c .Rules .DeploymentName || c .Rules .Service {
510
+ if c .Rules .DeploymentName || c .Rules .ServiceAttributes {
511
511
if replicaset , ok := c .getReplicaSet (string (ref .UID )); ok {
512
512
name := replicaset .Deployment .Name
513
513
if name != "" {
514
514
if c .Rules .DeploymentName {
515
515
tags [conventions .AttributeK8SDeploymentName ] = name
516
516
}
517
- if c .Rules .Service {
517
+ if c .Rules .ServiceAttributes {
518
518
serviceNames [conventions .AttributeK8SDeploymentName ] = name
519
519
}
520
520
}
@@ -534,7 +534,7 @@ func (c *WatchClient) extractPodAttributes(pod *api_v1.Pod) (map[string]string,
534
534
if c .Rules .DaemonSetName {
535
535
tags [conventions .AttributeK8SDaemonSetName ] = ref .Name
536
536
}
537
- if c .Rules .Service {
537
+ if c .Rules .ServiceAttributes {
538
538
serviceNames [conventions .AttributeK8SDaemonSetName ] = ref .Name
539
539
}
540
540
case "StatefulSet" :
@@ -544,18 +544,18 @@ func (c *WatchClient) extractPodAttributes(pod *api_v1.Pod) (map[string]string,
544
544
if c .Rules .StatefulSetName {
545
545
tags [conventions .AttributeK8SStatefulSetName ] = ref .Name
546
546
}
547
- if c .Rules .Service {
547
+ if c .Rules .ServiceAttributes {
548
548
serviceNames [conventions .AttributeK8SStatefulSetName ] = ref .Name
549
549
}
550
550
case "Job" :
551
- if c .Rules .CronJobName || c .Rules .Service {
551
+ if c .Rules .CronJobName || c .Rules .ServiceAttributes {
552
552
parts := c .cronJobRegex .FindStringSubmatch (ref .Name )
553
553
if len (parts ) == 2 {
554
554
name := parts [1 ]
555
555
if c .Rules .CronJobName {
556
556
tags [conventions .AttributeK8SCronJobName ] = name
557
557
}
558
- if c .Rules .Service {
558
+ if c .Rules .ServiceAttributes {
559
559
serviceNames [conventions .AttributeK8SCronJobName ] = name
560
560
}
561
561
}
@@ -566,7 +566,7 @@ func (c *WatchClient) extractPodAttributes(pod *api_v1.Pod) (map[string]string,
566
566
if c .Rules .JobName {
567
567
tags [conventions .AttributeK8SJobName ] = ref .Name
568
568
}
569
- if c .Rules .Service {
569
+ if c .Rules .ServiceAttributes {
570
570
serviceNames [conventions .AttributeK8SJobName ] = ref .Name
571
571
}
572
572
}
@@ -657,7 +657,7 @@ func removeUnnecessaryPodData(pod *api_v1.Pod, rules ExtractionRules) *api_v1.Po
657
657
removeUnnecessaryContainerData := func (c api_v1.Container ) api_v1.Container {
658
658
transformedContainer := api_v1.Container {}
659
659
transformedContainer .Name = c .Name // we always need the name, it's used for identification
660
- if rules .ContainerImageName || rules .ContainerImageTag || rules .Service {
660
+ if rules .ContainerImageName || rules .ContainerImageTag || rules .ServiceAttributes {
661
661
transformedContainer .Image = c .Image
662
662
}
663
663
return transformedContainer
@@ -730,7 +730,7 @@ func (c *WatchClient) extractPodContainersAttributes(pod *api_v1.Pod) PodContain
730
730
if ! needContainerAttributes (c .Rules ) {
731
731
return containers
732
732
}
733
- if c .Rules .ContainerImageName || c .Rules .ContainerImageTag || c .Rules .Service {
733
+ if c .Rules .ContainerImageName || c .Rules .ContainerImageTag || c .Rules .ServiceAttributes {
734
734
for _ , spec := range append (pod .Spec .Containers , pod .Spec .InitContainers ... ) {
735
735
container := & Container {}
736
736
imageRef , err := dcommon .ParseImageName (spec .Image )
@@ -743,7 +743,7 @@ func (c *WatchClient) extractPodContainersAttributes(pod *api_v1.Pod) PodContain
743
743
}
744
744
serviceVersion , err := parseServiceVersionFromImage (spec .Image )
745
745
if err == nil {
746
- if c .Rules .Service {
746
+ if c .Rules .ServiceAttributes {
747
747
container .ServiceVersion = serviceVersion
748
748
}
749
749
}
@@ -761,7 +761,7 @@ func (c *WatchClient) extractPodContainersAttributes(pod *api_v1.Pod) PodContain
761
761
if c .Rules .ContainerName {
762
762
container .Name = containerName
763
763
}
764
- if c .Rules .Service {
764
+ if c .Rules .ServiceAttributes {
765
765
container .ServiceInstanceID = automaticServiceInstanceID (pod , containerName )
766
766
container .ServiceName = containerName
767
767
}
@@ -1097,7 +1097,7 @@ func needContainerAttributes(rules ExtractionRules) bool {
1097
1097
rules .ContainerImageTag ||
1098
1098
rules .ContainerImageRepoDigests ||
1099
1099
rules .ContainerID ||
1100
- rules .Service
1100
+ rules .ServiceAttributes
1101
1101
}
1102
1102
1103
1103
func (c * WatchClient ) handleReplicaSetAdd (obj any ) {
0 commit comments