Skip to content

Commit

Permalink
fix: don't assume kube_cluster_name tag, allow users to set via event…
Browse files Browse the repository at this point in the history
… metadata
  • Loading branch information
mrparkers committed Aug 7, 2023
1 parent 0cef615 commit 55f9bd8
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions internal/notifier/datadog.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,6 @@ func (d *DataDog) toDataDogTags(event *eventv1.Event) []string {
fmt.Sprintf("kube_namespace:%s", event.InvolvedObject.Namespace),
}

// set the cluster name to the value of the summary field if it exists
// otherwise, set it to the value of the channel
if v, ok := event.Metadata["summary"]; ok {
tags = append(tags, fmt.Sprintf("kube_cluster_name:%s", v))
delete(event.Metadata, "summary")
} else {
tags = append(tags, fmt.Sprintf("kube_cluster_name:%s", d.env))
}

// add extra tags from event metadata
for k, v := range event.Metadata {
tags = append(tags, fmt.Sprintf("%s:%s", k, v))
Expand Down

0 comments on commit 55f9bd8

Please sign in to comment.