From e39c815157e3e65cd3c904769c7a5465468c5cd6 Mon Sep 17 00:00:00 2001 From: Rey Abolofia Date: Mon, 4 Nov 2024 12:46:00 -0800 Subject: [PATCH 1/4] Change StartServerlessTraceAgent to use args struct. --- cmd/serverless-init/main.go | 6 ++++- cmd/serverless/main.go | 7 +++++- pkg/serverless/daemon/daemon_test.go | 7 +++++- pkg/serverless/daemon/routes_test.go | 6 ++++- pkg/serverless/otlp/otlp_test.go | 5 ++++- pkg/serverless/trace/trace.go | 17 +++++++++----- pkg/serverless/trace/trace_test.go | 33 +++++++++++++++++++++++----- 7 files changed, 66 insertions(+), 15 deletions(-) diff --git a/cmd/serverless-init/main.go b/cmd/serverless-init/main.go index c7484233528fd..501efd2f6a073 100644 --- a/cmd/serverless-init/main.go +++ b/cmd/serverless-init/main.go @@ -151,7 +151,11 @@ func setup(_ mode.Conf, tagger tagger.Component) (cloudservice.CloudService, *se return cloudService, agentLogConfig, traceAgent, metricAgent, logsAgent } func setupTraceAgent(tags map[string]string, tagger tagger.Component) trace.ServerlessTraceAgent { - traceAgent := trace.StartServerlessTraceAgent(pkgconfigsetup.Datadog().GetBool("apm_config.enabled"), &trace.LoadConfig{Path: datadogConfigPath, Tagger: tagger}, nil, random.Random.Uint64()) + traceAgent := trace.StartServerlessTraceAgent(trace.StartServerlessTraceAgentArgs{ + Enabled: pkgconfigsetup.Datadog().GetBool("apm_config.enabled"), + LoadConfig: &trace.LoadConfig{Path: datadogConfigPath, Tagger: tagger}, + ColdStartSpanId: random.Random.Uint64(), + }) traceAgent.SetTags(tags) go func() { for range time.Tick(3 * time.Second) { diff --git a/cmd/serverless/main.go b/cmd/serverless/main.go index 0970277ae0a89..58a477301633e 100644 --- a/cmd/serverless/main.go +++ b/cmd/serverless/main.go @@ -337,7 +337,12 @@ func startOtlpAgent(wg *sync.WaitGroup, metricAgent *metrics.ServerlessMetricAge func startTraceAgent(wg *sync.WaitGroup, lambdaSpanChan chan *pb.Span, coldStartSpanId uint64, serverlessDaemon *daemon.Daemon, tagger tagger.Component) { defer wg.Done() - traceAgent := trace.StartServerlessTraceAgent(pkgconfigsetup.Datadog().GetBool("apm_config.enabled"), &trace.LoadConfig{Path: datadogConfigPath, Tagger: tagger}, lambdaSpanChan, coldStartSpanId) + traceAgent := trace.StartServerlessTraceAgent(trace.StartServerlessTraceAgentArgs{ + Enabled: pkgconfigsetup.Datadog().GetBool("apm_config.enabled"), + LoadConfig: &trace.LoadConfig{Path: datadogConfigPath, Tagger: tagger}, + LambdaSpanChan: lambdaSpanChan, + ColdStartSpanId: coldStartSpanId, + }) serverlessDaemon.SetTraceAgent(traceAgent) } diff --git a/pkg/serverless/daemon/daemon_test.go b/pkg/serverless/daemon/daemon_test.go index 9ed4d8a7d93ec..0321b361328de 100644 --- a/pkg/serverless/daemon/daemon_test.go +++ b/pkg/serverless/daemon/daemon_test.go @@ -171,7 +171,12 @@ func TestSetTraceTagOk(t *testing.T) { } t.Setenv("DD_API_KEY", "x") t.Setenv("DD_RECEIVER_PORT", strconv.Itoa(testutil.FreeTCPPort(t))) - agent := trace.StartServerlessTraceAgent(true, &trace.LoadConfig{Path: "/does-not-exist.yml"}, make(chan *pb.Span), random.Random.Uint64()) + agent := trace.StartServerlessTraceAgent(trace.StartServerlessTraceAgentArgs{ + Enabled: true, + LoadConfig: &trace.LoadConfig{Path: "/does-not-exist.yml"}, + LambdaSpanChan: make(chan *pb.Span), + ColdStartSpanId: random.Random.Uint64(), + }) defer agent.Stop() d := Daemon{ TraceAgent: agent, diff --git a/pkg/serverless/daemon/routes_test.go b/pkg/serverless/daemon/routes_test.go index 0937104e5b0f7..aa0e01e55aac4 100644 --- a/pkg/serverless/daemon/routes_test.go +++ b/pkg/serverless/daemon/routes_test.go @@ -441,7 +441,11 @@ func BenchmarkStartEndInvocation(b *testing.B) { func startAgents() *Daemon { d := StartDaemon(fmt.Sprint("127.0.0.1:", testutil.FreeTCPPort(nil))) - ta := trace.StartServerlessTraceAgent(true, &trace.LoadConfig{Path: "/some/path/datadog.yml"}, nil, 123) + ta := trace.StartServerlessTraceAgent(trace.StartServerlessTraceAgentArgs{ + Enabled: true, + LoadConfig: &trace.LoadConfig{Path: "/some/path/datadog.yml"}, + ColdStartSpanId: 123, + }) d.SetTraceAgent(ta) ma := &metrics.ServerlessMetricAgent{ diff --git a/pkg/serverless/otlp/otlp_test.go b/pkg/serverless/otlp/otlp_test.go index 2a33c0d3ff256..b7851f4488e14 100644 --- a/pkg/serverless/otlp/otlp_test.go +++ b/pkg/serverless/otlp/otlp_test.go @@ -65,7 +65,10 @@ func TestServerlessOTLPAgentReceivesTraces(t *testing.T) { t.Setenv("DD_OTLP_CONFIG_RECEIVER_PROTOCOLS_GRPC_ENDPOINT", grpcEndpoint) // setup trace agent - traceAgent := trace.StartServerlessTraceAgent(true, &trace.LoadConfig{Path: "./testdata/valid.yml"}, nil, 0) + traceAgent := trace.StartServerlessTraceAgent(trace.StartServerlessTraceAgentArgs{ + Enabled: true, + LoadConfig: &trace.LoadConfig{Path: "./testdata/valid.yml"}, + }) defer traceAgent.Stop() assert.NotNil(traceAgent) traceChan := make(chan struct{}) diff --git a/pkg/serverless/trace/trace.go b/pkg/serverless/trace/trace.go index 1b1b8e5d9d0d1..ea0a5716751d2 100644 --- a/pkg/serverless/trace/trace.go +++ b/pkg/serverless/trace/trace.go @@ -91,17 +91,24 @@ func (l *LoadConfig) Load() (*config.AgentConfig, error) { return comptracecfg.LoadConfigFile(l.Path, c, l.Tagger) } +type StartServerlessTraceAgentArgs struct { + Enabled bool + LoadConfig Load + LambdaSpanChan chan<- *pb.Span + ColdStartSpanId uint64 +} + // Start starts the agent // //nolint:revive // TODO(SERV) Fix revive linter -func StartServerlessTraceAgent(enabled bool, loadConfig Load, lambdaSpanChan chan<- *pb.Span, coldStartSpanId uint64) ServerlessTraceAgent { - if enabled { +func StartServerlessTraceAgent(args StartServerlessTraceAgentArgs) ServerlessTraceAgent { + if args.Enabled { // Set the serverless config option which will be used to determine if // hostname should be resolved. Skipping hostname resolution saves >1s // in load time between gRPC calls and agent commands. pkgconfigsetup.Datadog().Set("serverless.enabled", true, model.SourceAgentRuntime) - tc, confErr := loadConfig.Load() + tc, confErr := args.LoadConfig.Load() if confErr != nil { log.Errorf("Unable to load trace agent config: %s", confErr) } else { @@ -110,8 +117,8 @@ func StartServerlessTraceAgent(enabled bool, loadConfig Load, lambdaSpanChan cha tc.SynchronousFlushing = true ta := agent.NewAgent(context, tc, telemetry.NewNoopCollector(), &statsd.NoOpClient{}, zstd.NewComponent()) ta.SpanModifier = &spanModifier{ - coldStartSpanId: coldStartSpanId, - lambdaSpanChan: lambdaSpanChan, + coldStartSpanId: args.ColdStartSpanId, + lambdaSpanChan: args.LambdaSpanChan, ddOrigin: getDDOrigin(), } diff --git a/pkg/serverless/trace/trace_test.go b/pkg/serverless/trace/trace_test.go index c9d0c0355dc67..d8e8731583277 100644 --- a/pkg/serverless/trace/trace_test.go +++ b/pkg/serverless/trace/trace_test.go @@ -35,7 +35,10 @@ func TestStartEnabledFalse(t *testing.T) { setupTraceAgentTest(t) lambdaSpanChan := make(chan *pb.Span) - agent := StartServerlessTraceAgent(false, nil, lambdaSpanChan, random.Random.Uint64()) + agent := StartServerlessTraceAgent(StartServerlessTraceAgentArgs{ + LambdaSpanChan: lambdaSpanChan, + ColdStartSpanId: random.Random.Uint64(), + }) defer agent.Stop() assert.NotNil(t, agent) assert.IsType(t, noopTraceAgent{}, agent) @@ -53,7 +56,12 @@ func TestStartEnabledTrueInvalidConfig(t *testing.T) { setupTraceAgentTest(t) lambdaSpanChan := make(chan *pb.Span) - agent := StartServerlessTraceAgent(true, &LoadConfigMocked{}, lambdaSpanChan, random.Random.Uint64()) + agent := StartServerlessTraceAgent(StartServerlessTraceAgentArgs{ + Enabled: true, + LoadConfig: &LoadConfigMocked{}, + LambdaSpanChan: lambdaSpanChan, + ColdStartSpanId: random.Random.Uint64(), + }) defer agent.Stop() assert.NotNil(t, agent) assert.IsType(t, noopTraceAgent{}, agent) @@ -65,7 +73,12 @@ func TestStartEnabledTrueValidConfigInvalidPath(t *testing.T) { lambdaSpanChan := make(chan *pb.Span) t.Setenv("DD_API_KEY", "x") - agent := StartServerlessTraceAgent(true, &LoadConfig{Path: "invalid.yml"}, lambdaSpanChan, random.Random.Uint64()) + agent := StartServerlessTraceAgent(StartServerlessTraceAgentArgs{ + Enabled: true, + LoadConfig: &LoadConfig{Path: "invalid.yml"}, + LambdaSpanChan: lambdaSpanChan, + ColdStartSpanId: random.Random.Uint64(), + }) defer agent.Stop() assert.NotNil(t, agent) assert.IsType(t, &serverlessTraceAgent{}, agent) @@ -76,7 +89,12 @@ func TestStartEnabledTrueValidConfigValidPath(t *testing.T) { lambdaSpanChan := make(chan *pb.Span) - agent := StartServerlessTraceAgent(true, &LoadConfig{Path: "./testdata/valid.yml"}, lambdaSpanChan, random.Random.Uint64()) + agent := StartServerlessTraceAgent(StartServerlessTraceAgentArgs{ + Enabled: true, + LoadConfig: &LoadConfig{Path: "./testdata/valid.yml"}, + LambdaSpanChan: lambdaSpanChan, + ColdStartSpanId: random.Random.Uint64(), + }) defer agent.Stop() assert.NotNil(t, agent) assert.IsType(t, &serverlessTraceAgent{}, agent) @@ -89,7 +107,12 @@ func TestLoadConfigShouldBeFast(t *testing.T) { startTime := time.Now() lambdaSpanChan := make(chan *pb.Span) - agent := StartServerlessTraceAgent(true, &LoadConfig{Path: "./testdata/valid.yml"}, lambdaSpanChan, random.Random.Uint64()) + agent := StartServerlessTraceAgent(StartServerlessTraceAgentArgs{ + Enabled: true, + LoadConfig: &LoadConfig{Path: "./testdata/valid.yml"}, + LambdaSpanChan: lambdaSpanChan, + ColdStartSpanId: random.Random.Uint64(), + }) defer agent.Stop() assert.True(t, time.Since(startTime) < time.Second) } From 43e6f8b6296ae9a1186e5ba64d46faa450e1900c Mon Sep 17 00:00:00 2001 From: Rey Abolofia Date: Mon, 4 Nov 2024 13:03:53 -0800 Subject: [PATCH 2/4] Add AzureContainerAppTags to trace agent config struct. --- cmd/serverless-init/main.go | 28 ++++++++++++++++++++++++---- pkg/serverless/trace/trace.go | 11 +++++++---- pkg/trace/api/profiles.go | 18 ++---------------- pkg/trace/config/config.go | 4 ++++ 4 files changed, 37 insertions(+), 24 deletions(-) diff --git a/cmd/serverless-init/main.go b/cmd/serverless-init/main.go index 501efd2f6a073..8cb5d86665e5e 100644 --- a/cmd/serverless-init/main.go +++ b/cmd/serverless-init/main.go @@ -10,8 +10,10 @@ package main import ( "context" "errors" + "fmt" "os" "os/exec" + "strings" "sync" "time" @@ -150,13 +152,31 @@ func setup(_ mode.Conf, tagger tagger.Component) (cloudservice.CloudService, *se go flushMetricsAgent(metricAgent) return cloudService, agentLogConfig, traceAgent, metricAgent, logsAgent } + +var azureContainerAppTags = []string{ + "subscription_id", + "resource_group", + "resource_id", + "replicate_name", + "aca.subscription.id", + "aca.resource.group", + "aca.resource.id", + "aca.replica.name", +} + func setupTraceAgent(tags map[string]string, tagger tagger.Component) trace.ServerlessTraceAgent { + var azureTags strings.Builder + for _, azureContainerAppTag := range azureContainerAppTags { + if value, ok := tags[azureContainerAppTag]; ok { + azureTags.WriteString(fmt.Sprintf(",%s:%s", azureContainerAppTag, value)) + } + } traceAgent := trace.StartServerlessTraceAgent(trace.StartServerlessTraceAgentArgs{ - Enabled: pkgconfigsetup.Datadog().GetBool("apm_config.enabled"), - LoadConfig: &trace.LoadConfig{Path: datadogConfigPath, Tagger: tagger}, - ColdStartSpanId: random.Random.Uint64(), + Enabled: pkgconfigsetup.Datadog().GetBool("apm_config.enabled"), + LoadConfig: &trace.LoadConfig{Path: datadogConfigPath, Tagger: tagger}, + ColdStartSpanId: random.Random.Uint64(), + AzureContainerAppTags: azureTags.String(), }) - traceAgent.SetTags(tags) go func() { for range time.Tick(3 * time.Second) { traceAgent.Flush() diff --git a/pkg/serverless/trace/trace.go b/pkg/serverless/trace/trace.go index ea0a5716751d2..63a5e51354081 100644 --- a/pkg/serverless/trace/trace.go +++ b/pkg/serverless/trace/trace.go @@ -91,11 +91,13 @@ func (l *LoadConfig) Load() (*config.AgentConfig, error) { return comptracecfg.LoadConfigFile(l.Path, c, l.Tagger) } +// StartServerlessTraceAgentArgs are the arguments for the StartServerlessTraceAgent method type StartServerlessTraceAgentArgs struct { - Enabled bool - LoadConfig Load - LambdaSpanChan chan<- *pb.Span - ColdStartSpanId uint64 + Enabled bool + LoadConfig Load + LambdaSpanChan chan<- *pb.Span + ColdStartSpanId uint64 + AzureContainerAppTags string } // Start starts the agent @@ -115,6 +117,7 @@ func StartServerlessTraceAgent(args StartServerlessTraceAgentArgs) ServerlessTra context, cancel := context.WithCancel(context.Background()) tc.Hostname = "" tc.SynchronousFlushing = true + tc.AzureContainerAppTags = args.AzureContainerAppTags ta := agent.NewAgent(context, tc, telemetry.NewNoopCollector(), &statsd.NoOpClient{}, zstd.NewComponent()) ta.SpanModifier = &spanModifier{ coldStartSpanId: args.ColdStartSpanId, diff --git a/pkg/trace/api/profiles.go b/pkg/trace/api/profiles.go index a3f2ecf87a0cc..9b43efc94de74 100644 --- a/pkg/trace/api/profiles.go +++ b/pkg/trace/api/profiles.go @@ -30,17 +30,6 @@ 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. @@ -97,11 +86,8 @@ func (r *HTTPReceiver) profileProxyHandler() http.Handler { tags.WriteString(fmt.Sprintf("functionname:%s", strings.ToLower(r.conf.LambdaFunctionName))) tags.WriteString("_dd.origin:lambda") } - - for _, azureContainerAppTag := range azureContainerAppTags { - if value, ok := r.conf.GlobalTags[azureContainerAppTag]; ok { - tags.WriteString(fmt.Sprintf(",%s:%s", azureContainerAppTag, value)) - } + if r.conf.AzureContainerAppTags != "" { + tags.WriteString(r.conf.AzureContainerAppTags) } return newProfileProxy(r.conf, targets, keys, tags.String(), r.statsd) diff --git a/pkg/trace/config/config.go b/pkg/trace/config/config.go index 0426863d60be7..60e2e456c0a6c 100644 --- a/pkg/trace/config/config.go +++ b/pkg/trace/config/config.go @@ -450,6 +450,10 @@ type AgentConfig struct { // Lambda function name LambdaFunctionName string + + // Azure container apps tags, in the form of a comma-separated list of + // key-value pairs, starting with a comma + AzureContainerAppTags string } // RemoteClient client is used to APM Sampling Updates from a remote source. From 544a1c67c1357d00860b3af42bcfc03e02d60c74 Mon Sep 17 00:00:00 2001 From: Rey Abolofia Date: Mon, 4 Nov 2024 13:23:19 -0800 Subject: [PATCH 3/4] Fix linting issue. --- cmd/serverless-init/main.go | 2 +- cmd/serverless/main.go | 2 +- pkg/serverless/daemon/daemon_test.go | 2 +- pkg/serverless/daemon/routes_test.go | 2 +- pkg/serverless/trace/trace.go | 4 ++-- pkg/serverless/trace/trace_test.go | 10 +++++----- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cmd/serverless-init/main.go b/cmd/serverless-init/main.go index 8cb5d86665e5e..8540768bb1ca7 100644 --- a/cmd/serverless-init/main.go +++ b/cmd/serverless-init/main.go @@ -174,7 +174,7 @@ func setupTraceAgent(tags map[string]string, tagger tagger.Component) trace.Serv traceAgent := trace.StartServerlessTraceAgent(trace.StartServerlessTraceAgentArgs{ Enabled: pkgconfigsetup.Datadog().GetBool("apm_config.enabled"), LoadConfig: &trace.LoadConfig{Path: datadogConfigPath, Tagger: tagger}, - ColdStartSpanId: random.Random.Uint64(), + ColdStartSpanID: random.Random.Uint64(), AzureContainerAppTags: azureTags.String(), }) go func() { diff --git a/cmd/serverless/main.go b/cmd/serverless/main.go index 58a477301633e..b6c5189259eec 100644 --- a/cmd/serverless/main.go +++ b/cmd/serverless/main.go @@ -341,7 +341,7 @@ func startTraceAgent(wg *sync.WaitGroup, lambdaSpanChan chan *pb.Span, coldStart Enabled: pkgconfigsetup.Datadog().GetBool("apm_config.enabled"), LoadConfig: &trace.LoadConfig{Path: datadogConfigPath, Tagger: tagger}, LambdaSpanChan: lambdaSpanChan, - ColdStartSpanId: coldStartSpanId, + ColdStartSpanID: coldStartSpanId, }) serverlessDaemon.SetTraceAgent(traceAgent) } diff --git a/pkg/serverless/daemon/daemon_test.go b/pkg/serverless/daemon/daemon_test.go index 0321b361328de..dab72e9d4c6cf 100644 --- a/pkg/serverless/daemon/daemon_test.go +++ b/pkg/serverless/daemon/daemon_test.go @@ -175,7 +175,7 @@ func TestSetTraceTagOk(t *testing.T) { Enabled: true, LoadConfig: &trace.LoadConfig{Path: "/does-not-exist.yml"}, LambdaSpanChan: make(chan *pb.Span), - ColdStartSpanId: random.Random.Uint64(), + ColdStartSpanID: random.Random.Uint64(), }) defer agent.Stop() d := Daemon{ diff --git a/pkg/serverless/daemon/routes_test.go b/pkg/serverless/daemon/routes_test.go index aa0e01e55aac4..19d55ab3cd098 100644 --- a/pkg/serverless/daemon/routes_test.go +++ b/pkg/serverless/daemon/routes_test.go @@ -444,7 +444,7 @@ func startAgents() *Daemon { ta := trace.StartServerlessTraceAgent(trace.StartServerlessTraceAgentArgs{ Enabled: true, LoadConfig: &trace.LoadConfig{Path: "/some/path/datadog.yml"}, - ColdStartSpanId: 123, + ColdStartSpanID: 123, }) d.SetTraceAgent(ta) diff --git a/pkg/serverless/trace/trace.go b/pkg/serverless/trace/trace.go index 63a5e51354081..0227897547bee 100644 --- a/pkg/serverless/trace/trace.go +++ b/pkg/serverless/trace/trace.go @@ -96,7 +96,7 @@ type StartServerlessTraceAgentArgs struct { Enabled bool LoadConfig Load LambdaSpanChan chan<- *pb.Span - ColdStartSpanId uint64 + ColdStartSpanID uint64 AzureContainerAppTags string } @@ -120,7 +120,7 @@ func StartServerlessTraceAgent(args StartServerlessTraceAgentArgs) ServerlessTra tc.AzureContainerAppTags = args.AzureContainerAppTags ta := agent.NewAgent(context, tc, telemetry.NewNoopCollector(), &statsd.NoOpClient{}, zstd.NewComponent()) ta.SpanModifier = &spanModifier{ - coldStartSpanId: args.ColdStartSpanId, + coldStartSpanId: args.ColdStartSpanID, lambdaSpanChan: args.LambdaSpanChan, ddOrigin: getDDOrigin(), } diff --git a/pkg/serverless/trace/trace_test.go b/pkg/serverless/trace/trace_test.go index d8e8731583277..96e1e8e79bbb7 100644 --- a/pkg/serverless/trace/trace_test.go +++ b/pkg/serverless/trace/trace_test.go @@ -37,7 +37,7 @@ func TestStartEnabledFalse(t *testing.T) { lambdaSpanChan := make(chan *pb.Span) agent := StartServerlessTraceAgent(StartServerlessTraceAgentArgs{ LambdaSpanChan: lambdaSpanChan, - ColdStartSpanId: random.Random.Uint64(), + ColdStartSpanID: random.Random.Uint64(), }) defer agent.Stop() assert.NotNil(t, agent) @@ -60,7 +60,7 @@ func TestStartEnabledTrueInvalidConfig(t *testing.T) { Enabled: true, LoadConfig: &LoadConfigMocked{}, LambdaSpanChan: lambdaSpanChan, - ColdStartSpanId: random.Random.Uint64(), + ColdStartSpanID: random.Random.Uint64(), }) defer agent.Stop() assert.NotNil(t, agent) @@ -77,7 +77,7 @@ func TestStartEnabledTrueValidConfigInvalidPath(t *testing.T) { Enabled: true, LoadConfig: &LoadConfig{Path: "invalid.yml"}, LambdaSpanChan: lambdaSpanChan, - ColdStartSpanId: random.Random.Uint64(), + ColdStartSpanID: random.Random.Uint64(), }) defer agent.Stop() assert.NotNil(t, agent) @@ -93,7 +93,7 @@ func TestStartEnabledTrueValidConfigValidPath(t *testing.T) { Enabled: true, LoadConfig: &LoadConfig{Path: "./testdata/valid.yml"}, LambdaSpanChan: lambdaSpanChan, - ColdStartSpanId: random.Random.Uint64(), + ColdStartSpanID: random.Random.Uint64(), }) defer agent.Stop() assert.NotNil(t, agent) @@ -111,7 +111,7 @@ func TestLoadConfigShouldBeFast(t *testing.T) { Enabled: true, LoadConfig: &LoadConfig{Path: "./testdata/valid.yml"}, LambdaSpanChan: lambdaSpanChan, - ColdStartSpanId: random.Random.Uint64(), + ColdStartSpanID: random.Random.Uint64(), }) defer agent.Stop() assert.True(t, time.Since(startTime) < time.Second) From f5f0af630bcc1208bb50eae69393dffe6b329b54 Mon Sep 17 00:00:00 2001 From: Rey Abolofia Date: Mon, 4 Nov 2024 13:28:19 -0800 Subject: [PATCH 4/4] Use AzureContainerAppTags for azure tags. --- pkg/trace/api/profiles_test.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/pkg/trace/api/profiles_test.go b/pkg/trace/api/profiles_test.go index b11b162deaf9f..2727b76be02d4 100644 --- a/pkg/trace/api/profiles_test.go +++ b/pkg/trace/api/profiles_test.go @@ -323,15 +323,7 @@ func TestProfileProxyHandler(t *testing.T) { })) conf := newTestReceiverConfig() conf.ProfilingProxy = config.ProfilingProxyConfig{DDURL: srv.URL} - conf.GlobalTags = map[string]string{ - "subscription_id": "123", - "resource_group": "test-rg", - "resource_id": "456", - "aca.subscription.id": "123", - "aca.resource.group": "test-rg", - "aca.resource.id": "456", - "aca.replica.name": "test-replica", - } + conf.AzureContainerAppTags = ",subscription_id:123,resource_group:test-rg,resource_id:456,aca.subscription.id:123,aca.resource.group:test-rg,aca.resource.id:456,aca.replica.name:test-replica" req, err := http.NewRequest("POST", "/some/path", nil) if err != nil { t.Fatal(err)