Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate awsentity processor last when translating pipelines #1428

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,12 @@ func (t *translator) Translate(conf *confmap.Conf) (*common.ComponentTranslators
}

mode := context.CurrentContext().KubernetesMode()
translators.Processors.Set(resourcedetection.NewTranslator(resourcedetection.WithDataType(t.dataType)))
phugay marked this conversation as resolved.
Show resolved Hide resolved
translators.Processors.Set(awsapplicationsignals.NewTranslator(awsapplicationsignals.WithDataType(t.dataType)))

if t.dataType == component.DataTypeMetrics && mode != "" {
translators.Processors.Set(awsentity.NewTranslatorWithEntityType(awsentity.Service, common.AppSignals, false))
}
translators.Processors.Set(resourcedetection.NewTranslator(resourcedetection.WithDataType(t.dataType)))
translators.Processors.Set(awsapplicationsignals.NewTranslator(awsapplicationsignals.WithDataType(t.dataType)))

if enabled, _ := common.GetBool(conf, common.AgentDebugConfigKey); enabled {
translators.Exporters.Set(debug.NewTranslator(common.WithName(common.AppSignals)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func TestTranslatorMetricsForKubernetes(t *testing.T) {
},
want: &want{
receivers: []string{"otlp/application_signals"},
processors: []string{"metricstransform/application_signals", "awsentity/service/application_signals", "resourcedetection", "awsapplicationsignals"},
processors: []string{"metricstransform/application_signals", "resourcedetection", "awsapplicationsignals", "awsentity/service/application_signals"},
exporters: []string{"awsemf/application_signals"},
extensions: []string{"agenthealth/logs"},
},
Expand All @@ -147,7 +147,7 @@ func TestTranslatorMetricsForKubernetes(t *testing.T) {
},
want: &want{
receivers: []string{"otlp/application_signals"},
processors: []string{"metricstransform/application_signals", "awsentity/service/application_signals", "resourcedetection", "awsapplicationsignals"},
processors: []string{"metricstransform/application_signals", "resourcedetection", "awsapplicationsignals", "awsentity/service/application_signals"},
exporters: []string{"debug/application_signals", "awsemf/application_signals"},
extensions: []string{"agenthealth/logs"},
},
Expand All @@ -165,7 +165,7 @@ func TestTranslatorMetricsForKubernetes(t *testing.T) {
},
want: &want{
receivers: []string{"otlp/application_signals"},
processors: []string{"metricstransform/application_signals", "awsentity/service/application_signals", "resourcedetection", "awsapplicationsignals"},
processors: []string{"metricstransform/application_signals", "resourcedetection", "awsapplicationsignals", "awsentity/service/application_signals"},
exporters: []string{"awsemf/application_signals"},
extensions: []string{"agenthealth/logs"},
},
Expand Down
Loading