Skip to content

Commit

Permalink
fix string issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jaskerv committed Jun 15, 2023
1 parent 3ac0bc4 commit 6cd2184
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions enricher/eks/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ func (e *Enricher) AddDropCount() {

func inferServiceName(record map[interface{}]interface{}) string {
k8sPayload := record[mappings.KUBERNETES_RESOURCE_FIELD_NAME].(map[interface{}]interface{})
var serviceName = fmt.Sprintf("%v", k8sPayload[mappings.KUBERNETES_CONTAINER_NAME])
var serviceName = fmt.Sprintf("%s", k8sPayload[mappings.KUBERNETES_CONTAINER_NAME])

labels, labelsExist := k8sPayload[mappings.KUBERNETES_LABELS_FIELD_NAME].(map[interface{}]interface{})
if labelsExist {
if val, ok := labels[mappings.KUBERNETES_LABELS_NAME]; ok {
serviceName = fmt.Sprintf("%v", val)
serviceName = fmt.Sprintf("%s", val)
}
}

Expand Down

0 comments on commit 6cd2184

Please sign in to comment.