-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
fix errcheck issue for aws related exporter #9785
fix errcheck issue for aws related exporter #9785
Conversation
@mx-psi Please help review this pr, thanks :) |
@Aneurysm9 Can you help review this pr? |
I think this should have changelog entry |
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.
Left a couple of comments, but I think we should wait for @Aneurysm9 to be back and have a look at these
expConfig.Validate() | ||
err = expConfig.Validate() | ||
if err != nil { | ||
return nil, err | ||
} |
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.
This can go away entirely, validation is already done by the service so this will never fail.
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 "service" you mention is cwlogs.NewClient
fucntion?
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.
No, it's the one on opentelemetry-collector. The call happens here https://github.com/open-telemetry/opentelemetry-collector/blob/c56d20e9e0afccc43179da12f60e24e5729caca9/service/config_provider.go#L117, which validates the configuration of all components https://github.com/open-telemetry/opentelemetry-collector/blob/c56d20e9e0afccc43179da12f60e24e5729caca9/config/moved_config.go#L53
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.
Yes, this validation should be able to be removed. It seems overly defensive given that the service hosts will already have validated it.
expConfig.Validate() | ||
err = expConfig.Validate() | ||
if err != nil { | ||
return nil, err | ||
} |
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.
ditto
@@ -181,7 +180,7 @@ func fillJavaStacktrace(stacktrace string, exceptions []awsxray.Exception) []aws | |||
r := textproto.NewReader(bufio.NewReader(strings.NewReader(stacktrace))) | |||
|
|||
// Skip first line containing top level exception / message | |||
r.ReadLine() | |||
_, _ = r.ReadLine() |
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.
Should we check the error and return exceptions
here, the same way it's done when lines are actually read?
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.
Yes, probably. An error here would seem to indicate a failure that should stop further processing.
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.
This still needs to be addressed
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
exporter/awsxrayexporter/internal/translator/writer_pool_test.go
Outdated
Show resolved
Hide resolved
9857e69
to
248b459
Compare
@Aneurysm9 @mx-psi I've already fix comments and fix the gocritic failed cases in the mean time. |
This appears to need a |
err = expConfig.Validate() | ||
if err != nil { | ||
return nil, err | ||
} |
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.
This still needs to be removed
@@ -181,7 +180,7 @@ func fillJavaStacktrace(stacktrace string, exceptions []awsxray.Exception) []aws | |||
r := textproto.NewReader(bufio.NewReader(strings.NewReader(stacktrace))) | |||
|
|||
// Skip first line containing top level exception / message | |||
r.ReadLine() | |||
_, _ = r.ReadLine() |
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.
This still needs to be addressed
248b459
to
f362869
Compare
ping @mx-psi , please help review this again, thanks. :) |
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.
LGTM, but would like @Aneurysm9 to have a final look too
There are some unit tests failing: https://github.com/open-telemetry/opentelemetry-collector-contrib/runs/6918563670?check_suite_focus=true#step:7:202
|
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.
Please resolve unit test failures
Ok. |
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
91fed70
to
130bc28
Compare
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
@djaglowski unit test is fixed, but the check-links failed, but I checked that the failed issues are not related to aws related exporters, should I resolve those in another pr? |
Thanks @fatsheep9146. I agree the failure is unrelated. (I've opened #11167 to address it.) |
Signed-off-by: Ziqi Zhao zhaoziqi9146@gmail.com
Description:
fix errcheck and gocritic issue for aws related exporter, awscloudwatchlogsexporter, awsemfexporter, awsxrayexporter
Link to tracking Issue:
#9749 #10466