-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[chore][exporter/awsxrayexporter] run make modernize #43240
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
base: main
Are you sure you want to change the base?
[chore][exporter/awsxrayexporter] run make modernize #43240
Conversation
Signed-off-by: Paulo Dias <[email protected]>
|
Moved to draft to check the test errors |
Signed-off-by: Paulo Dias <[email protected]>
…-contrib into chore/exporter/awsxrayexporter Signed-off-by: Paulo Dias <[email protected]>
Signed-off-by: Paulo Dias <[email protected]>
|
Tests fixed. Previous error: https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/18372347836/job/52338400875?pr=43240 |
| "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil" | ||
| ) | ||
|
|
||
| func setSkipTimestampValidation(tb testing.TB, value bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this test failing intermittently before? not sure i understand why the refactor in this PR would have caused the tests to fail where they hadn't before 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The failure was not caused by this PR. I can reproduce it locally directly from the main branch. 🤔
I ran gotestsum as make run-changed-tests was doing nothing.
❯ ../../.tools/gotestsum --packages="./..." -- -race -timeout 900s -parallel 4 -count=3
∅ internal/metadata
✓ internal/translator (1.647s)
✖ . (3.537s)
=== Failed
=== FAIL: . TestXrayAndW3CSpanTraceResourceExtraction (0.00s)
awsxray_test.go:58:
Error Trace: /repos/opentelemetry-collector-contrib/exporter/awsxrayexporter/awsxray_test.go:58
Error: "[{"name":"/users/junit","id":"0d226912b0c77a4f","start_time":1760650419,"service":{"version":"v1"},"trace_id":"1-68f1650c-ebf18704c6a03c6866925d7d","end_time":1760650509,"http":{"request":{"method":"GET","url":"https://api.example.com/users/junit"},"response":{"status":200,"content_length":0}},"fault":false,"error":false,"throttle":false,"aws":{"xray":{"auto_instrumentation":false},"account_id":"999999998"},"namespace":"remote","parent_id":"1153bc3dcdac2878","type":"subsegment"}
{"name":"signup_aggregator","id":"a1cce7188fd5b544","start_time":1760650419,"service":{"version":"v1"},"trace_id":"1-68f1650c-f848e39bd59de27743b1dea3","end_time":1760650509,"http":{"request":{"x_forwarded_for":true,"method":"GET","url":"https://api.example.com/users/junit","client_ip":"192.168.15.32"},"response":{"status":200,"content_length":0}},"fault":false,"error":false,"throttle":false,"aws":{"xray":{"auto_instrumentation":false},"account_id":"999999998"},"metadata":{"default":{"otel.resource.cloud.account.id":"999999998","otel.resource.cloud.availability_zone":"us-west-1b","otel.resource.cloud.provider":"aws","otel.resource.cloud.region":"us-west-2","otel.resource.container.image.name":"otel/signupaggregator","otel.resource.container.image.tag":"v1","otel.resource.container.name":"signup_aggregator","otel.resource.service.name":"signup_aggregator"}},"parent_id":"f7b0b80664736000"}
]" should have 4 item(s), but has 2
Test: TestXrayAndW3CSpanTraceResourceExtraction
Messages: 4 spans have xray/w3c trace id
=== FAIL: . TestW3CSpanTraceResourceExtraction (0.00s)
awsxray_test.go:64:
Error Trace: /repos/opentelemetry-collector-contrib/exporter/awsxrayexporter/awsxray_test.go:64
Error: "[]" should have 2 item(s), but has 0
Test: TestW3CSpanTraceResourceExtraction
Messages: 2 spans have w3c trace id
=== FAIL: . TestCreateDefaultConfig (0.00s)
factory_test.go:25:
Error Trace: /repos/opentelemetry-collector-contrib/exporter/awsxrayexporter/factory_test.go:25
Error: Not equal:
expected: &awsxrayexporter.Config{AWSSessionSettings:awsutil.AWSSessionSettings{NumberOfWorkers:8, Endpoint:"", RequestTimeoutSeconds:30, MaxRetries:2, NoVerifySSL:false, ProxyAddress:"", Region:"", LocalMode:false, ResourceARN:"", RoleARN:"", ExternalID:""}, IndexedAttributes:[]string(nil), IndexAllAttributes:false, LogGroupNames:[]string(nil), TelemetryConfig:telemetry.Config{Enabled:false, IncludeMetadata:false, Contributors:[]component.ID(nil), Hostname:"", InstanceID:"", ResourceARN:""}, skipTimestampValidation:true}
actual : &awsxrayexporter.Config{AWSSessionSettings:awsutil.AWSSessionSettings{NumberOfWorkers:8, Endpoint:"", RequestTimeoutSeconds:30, MaxRetries:2, NoVerifySSL:false, ProxyAddress:"", Region:"", LocalMode:false, ResourceARN:"", RoleARN:"", ExternalID:""}, IndexedAttributes:[]string(nil), IndexAllAttributes:false, LogGroupNames:[]string(nil), TelemetryConfig:telemetry.Config{Enabled:false, IncludeMetadata:false, Contributors:[]component.ID(nil), Hostname:"", InstanceID:"", ResourceARN:""}, skipTimestampValidation:false}
Diff:
--- Expected
+++ Actual
@@ -25,3 +25,3 @@
},
- skipTimestampValidation: (bool) true
+ skipTimestampValidation: (bool) false
})
Test: TestCreateDefaultConfig
Messages: failed to create default config
=== FAIL: . TestXrayAndW3CSpanTraceResourceExtraction (0.00s)
awsxray_test.go:58:
Error Trace: /repos/opentelemetry-collector-contrib/exporter/awsxrayexporter/awsxray_test.go:58
Error: "[{"name":"/users/junit","id":"b236dfe5ad9cdf1a","start_time":1760650420,"service":{"version":"v1"},"trace_id":"1-68f1650d-fbafea511c2afcd12d12db97","end_time":1760650510,"http":{"request":{"method":"GET","url":"https://api.example.com/users/junit"},"response":{"status":200,"content_length":0}},"fault":false,"error":false,"throttle":false,"aws":{"xray":{"auto_instrumentation":false},"account_id":"999999998"},"namespace":"remote","parent_id":"0774bff62361e3c1","type":"subsegment"}
{"name":"signup_aggregator","id":"a6d7b4df40b42490","start_time":1760650420,"service":{"version":"v1"},"trace_id":"1-68f1650d-421f8106364c110886bab0d2","end_time":1760650510,"http":{"request":{"x_forwarded_for":true,"method":"GET","url":"https://api.example.com/users/junit","client_ip":"192.168.15.32"},"response":{"status":200,"content_length":0}},"fault":false,"error":false,"throttle":false,"aws":{"xray":{"auto_instrumentation":false},"account_id":"999999998"},"metadata":{"default":{"otel.resource.cloud.account.id":"999999998","otel.resource.cloud.availability_zone":"us-west-1b","otel.resource.cloud.provider":"aws","otel.resource.cloud.region":"us-west-2","otel.resource.container.image.name":"otel/signupaggregator","otel.resource.container.image.tag":"v1","otel.resource.container.name":"signup_aggregator","otel.resource.service.name":"signup_aggregator"}},"parent_id":"5b2ae7c011354d24"}
]" should have 4 item(s), but has 2
Test: TestXrayAndW3CSpanTraceResourceExtraction
Messages: 4 spans have xray/w3c trace id
=== FAIL: . TestW3CSpanTraceResourceExtraction (0.00s)
awsxray_test.go:64:
Error Trace: /repos/opentelemetry-collector-contrib/exporter/awsxrayexporter/awsxray_test.go:64
Error: "[]" should have 2 item(s), but has 0
Test: TestW3CSpanTraceResourceExtraction
Messages: 2 spans have w3c trace id
=== FAIL: . TestCreateDefaultConfig (0.00s)
factory_test.go:25:
Error Trace: /repos/opentelemetry-collector-contrib/exporter/awsxrayexporter/factory_test.go:25
Error: Not equal:
expected: &awsxrayexporter.Config{AWSSessionSettings:awsutil.AWSSessionSettings{NumberOfWorkers:8, Endpoint:"", RequestTimeoutSeconds:30, MaxRetries:2, NoVerifySSL:false, ProxyAddress:"", Region:"", LocalMode:false, ResourceARN:"", RoleARN:"", ExternalID:""}, IndexedAttributes:[]string(nil), IndexAllAttributes:false, LogGroupNames:[]string(nil), TelemetryConfig:telemetry.Config{Enabled:false, IncludeMetadata:false, Contributors:[]component.ID(nil), Hostname:"", InstanceID:"", ResourceARN:""}, skipTimestampValidation:true}
actual : &awsxrayexporter.Config{AWSSessionSettings:awsutil.AWSSessionSettings{NumberOfWorkers:8, Endpoint:"", RequestTimeoutSeconds:30, MaxRetries:2, NoVerifySSL:false, ProxyAddress:"", Region:"", LocalMode:false, ResourceARN:"", RoleARN:"", ExternalID:""}, IndexedAttributes:[]string(nil), IndexAllAttributes:false, LogGroupNames:[]string(nil), TelemetryConfig:telemetry.Config{Enabled:false, IncludeMetadata:false, Contributors:[]component.ID(nil), Hostname:"", InstanceID:"", ResourceARN:""}, skipTimestampValidation:false}
Diff:
--- Expected
+++ Actual
@@ -25,3 +25,3 @@
},
- skipTimestampValidation: (bool) true
+ skipTimestampValidation: (bool) false
})
Test: TestCreateDefaultConfig
Messages: failed to create default config
DONE 594 tests, 6 failures in 3.537s|
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
|
/label -stale |
Description
Run the
make modernizetool.https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize