Skip to content

Commit

Permalink
move azureContainerAppTags to global variable
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanpharvey committed Oct 31, 2024
1 parent 11d8528 commit 01dfdba
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions pkg/trace/api/profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ const (
profilingV1EndpointSuffix = "v1/input"
)

var azureContainerAppTags = []string{
"subscription_id",
"resource_group",
"resource_id",
"replicate_name",
"aca.subscription.id",
"aca.resource.group",
"aca.resource.id",
"aca.replica.name",
}

// profilingEndpoints returns the profiling intake urls and their corresponding
// api keys based on agent configuration. The main endpoint is always returned as
// the first element in the slice.
Expand Down Expand Up @@ -87,17 +98,6 @@ func (r *HTTPReceiver) profileProxyHandler() http.Handler {
tags.WriteString("_dd.origin:lambda")
}

azureContainerAppTags := []string{
"subscription_id",
"resource_group",
"resource_id",
"replicate_name",
"aca.subscription.id",
"aca.resource.group",
"aca.resource.id",
"aca.replica.name",
}

for _, azureContainerAppTag := range azureContainerAppTags {
if value, ok := r.conf.GlobalTags[azureContainerAppTag]; ok {
tags.WriteString(fmt.Sprintf(",%s:%s", azureContainerAppTag, value))
Expand Down

0 comments on commit 01dfdba

Please sign in to comment.