Skip to content

Commit 35d1708

Browse files
committed
Support span event by default when application_signals is enabled
1 parent 5749e54 commit 35d1708

2 files changed

Lines changed: 48 additions & 12 deletions

File tree

translator/translate/otel/exporter/awsxray/translator.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ func (t *translator) Translate(conf *confmap.Conf) (component.Config, error) {
6666

6767
if isAppSignals(conf) {
6868
cfg.IndexedAttributes = indexedAttributes
69+
cfg.TransitSpansInOtlpFormat = true
6970
}
7071

7172
c := confmap.NewFromStringMap(map[string]interface{}{

translator/translate/otel/exporter/awsxray/translator_test.go

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,11 @@ func TestTranslator(t *testing.T) {
8080
"aws.remote.resource.identifier",
8181
"aws.remote.resource.type",
8282
},
83-
"certificate_file_path": "/ca/bundle",
84-
"region": "us-east-1",
85-
"role_arn": "global_arn",
86-
"imds_retries": 1,
83+
"certificate_file_path": "/ca/bundle",
84+
"region": "us-east-1",
85+
"role_arn": "global_arn",
86+
"imds_retries": 1,
87+
"transit_spans_in_otlp_format": true,
8788
"telemetry": map[string]any{
8889
"enabled": true,
8990
"include_metadata": true,
@@ -111,10 +112,11 @@ func TestTranslator(t *testing.T) {
111112
"aws.remote.resource.identifier",
112113
"aws.remote.resource.type",
113114
},
114-
"certificate_file_path": "/ca/bundle",
115-
"region": "us-east-1",
116-
"role_arn": "global_arn",
117-
"imds_retries": 1,
115+
"certificate_file_path": "/ca/bundle",
116+
"region": "us-east-1",
117+
"role_arn": "global_arn",
118+
"imds_retries": 1,
119+
"transit_spans_in_otlp_format": true,
118120
"telemetry": map[string]any{
119121
"enabled": true,
120122
"include_metadata": true,
@@ -142,10 +144,43 @@ func TestTranslator(t *testing.T) {
142144
"aws.remote.resource.identifier",
143145
"aws.remote.resource.type",
144146
},
145-
"certificate_file_path": "/ca/bundle",
146-
"region": "us-east-1",
147-
"role_arn": "global_arn",
148-
"imds_retries": 1,
147+
"certificate_file_path": "/ca/bundle",
148+
"region": "us-east-1",
149+
"role_arn": "global_arn",
150+
"imds_retries": 1,
151+
"transit_spans_in_otlp_format": true,
152+
"telemetry": map[string]any{
153+
"enabled": true,
154+
"include_metadata": true,
155+
},
156+
"middleware": "agenthealth/traces",
157+
}),
158+
mode: config.ModeEC2,
159+
},
160+
"WithAppSignalsAndTransitOtlpOverrideFalse": {
161+
input: map[string]any{
162+
"traces": map[string]any{
163+
"traces_collected": map[string]any{
164+
"app_signals": map[string]any{},
165+
},
166+
"transit_spans_in_otlp_format": false,
167+
}},
168+
want: confmap.NewFromStringMap(map[string]any{
169+
"indexed_attributes": []string{
170+
"aws.local.service",
171+
"aws.local.operation",
172+
"aws.local.environment",
173+
"aws.remote.service",
174+
"aws.remote.operation",
175+
"aws.remote.environment",
176+
"aws.remote.resource.identifier",
177+
"aws.remote.resource.type",
178+
},
179+
"certificate_file_path": "/ca/bundle",
180+
"region": "us-east-1",
181+
"role_arn": "global_arn",
182+
"imds_retries": 1,
183+
"transit_spans_in_otlp_format": false,
149184
"telemetry": map[string]any{
150185
"enabled": true,
151186
"include_metadata": true,

0 commit comments

Comments
 (0)