From c67569a5c2663f61c768b8100771145089ca26b4 Mon Sep 17 00:00:00 2001 From: Musa Date: Wed, 24 Apr 2024 15:19:11 -0400 Subject: [PATCH] Fixed test format and added new test case for kubernetes too. --- .../pipeline/appsignals/translator_test.go | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/translator/translate/otel/pipeline/appsignals/translator_test.go b/translator/translate/otel/pipeline/appsignals/translator_test.go index b8b432407b..d7ee95a7d3 100644 --- a/translator/translate/otel/pipeline/appsignals/translator_test.go +++ b/translator/translate/otel/pipeline/appsignals/translator_test.go @@ -132,6 +132,28 @@ func TestTranslatorMetricsForKubernetes(t *testing.T) { detector: eksdetector.TestEKSDetector, isEKSCache: eksdetector.TestIsEKSCacheEKS, }, + "WithAppSignalsAndLoggingEnabled": { + input: map[string]interface{}{ + "agent": map[string]interface{}{ + "debug": true, + }, + "logs": map[string]interface{}{ + "metrics_collected": map[string]interface{}{ + "app_signals": map[string]interface{}{ + "enabled": true, + }, + }, + }, + }, + want: &want{ + receivers: []string{"otlp/app_signals"}, + processors: []string{"resourcedetection", "awsappsignals"}, + exporters: []string{"logging", "awsemf/app_signals"}, + extensions: []string{"agenthealth/logs"}, + }, + detector: eksdetector.TestEKSDetector, + isEKSCache: eksdetector.TestIsEKSCacheEKS, + }, "WithAppSignalsEnabledK8s": { input: map[string]interface{}{ "logs": map[string]interface{}{ @@ -226,6 +248,8 @@ func TestTranslatorMetricsForEC2(t *testing.T) { exporters: []string{"logging", "awsemf/app_signals"}, extensions: []string{"agenthealth/logs"}, }, + detector: eksdetector.TestEKSDetector, + isEKSCache: eksdetector.TestIsEKSCacheEKS, }, } for name, testCase := range testCases {