Skip to content

Commit

Permalink
Fix translation unit test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
lisguo committed Oct 26, 2023
1 parent e753620 commit 3f84280
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ exporters:
- Fault
- Error
metric_descriptors: []
middleware: agenthealth/logs
namespace: AppSignals
no_verify_ssl: false
num_workers: 8
Expand Down Expand Up @@ -99,6 +100,7 @@ exporters:
- HostedIn.Environment
local_mode: false
max_retries: 2
middleware: agenthealth/traces
no_verify_ssl: false
num_workers: 8
profile: ""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
log_group_name: "/aws/appsignals/eks"
namespace: "AppSignals"
middleware: agenthealth/logs
dimension_rollup_option: "NoDimensionRollup"
metric_declarations:
- dimensions:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
log_group_name: "/aws/appsignals/generic"
namespace: "AppSignals"
middleware: agenthealth/logs
dimension_rollup_option: "NoDimensionRollup"
metric_declarations:
- dimensions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func TestTranslator(t *testing.T) {
"enabled": true,
"include_metadata": true,
},
"middleware": "agenthealth/traces",
}),
},
}
Expand Down
10 changes: 5 additions & 5 deletions translator/translate/otel/pipeline/appsignals/translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
)

const (
pipelineName = "app_signals"
pipelineName = "appsignals"
)

type translator struct {
Expand Down Expand Up @@ -48,17 +48,17 @@ func (t *translator) Translate(conf *confmap.Conf) (*common.ComponentTranslators
}

translators := &common.ComponentTranslators{
Receivers: common.NewTranslatorMap(otlp.NewTranslatorWithName(common.AppSignals, otlp.WithDataType(t.dataType))),
Receivers: common.NewTranslatorMap(otlp.NewTranslatorWithName(pipelineName, otlp.WithDataType(t.dataType))),
Processors: common.NewTranslatorMap(resourcedetection.NewTranslator(resourcedetection.WithDataType(t.dataType)), awsappsignals.NewTranslator(awsappsignals.WithDataType(t.dataType))),
Exporters: common.NewTranslatorMap[component.Config](),
Extensions: common.NewTranslatorMap[component.Config](),
}

if t.dataType == component.DataTypeTraces {
translators.Exporters.Set(awsxray.NewTranslatorWithName(common.AppSignals))
translators.Extensions.Set(awsproxy.NewTranslatorWithName(common.AppSignals))
translators.Exporters.Set(awsxray.NewTranslatorWithName(pipelineName))
translators.Extensions.Set(awsproxy.NewTranslatorWithName(pipelineName))
} else {
translators.Exporters.Set(awsemf.NewTranslatorWithName(common.AppSignals))
translators.Exporters.Set(awsemf.NewTranslatorWithName(pipelineName))
}
return translators, nil
}

0 comments on commit 3f84280

Please sign in to comment.