Skip to content

Fix: “pointer to empty string” is not omitted bug of AWS X-Ray Exporter #830

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

Merged
merged 11 commits into from
Aug 27, 2020

Conversation

EdZou
Copy link
Contributor

@EdZou EdZou commented Aug 26, 2020

Description:
current exporter is broken because of #691 - unfortunately omitempty doesn’t work because “pointer to empty string” is not omitted.

Now added a util function under "internal/common/awsxray" repository and take use of this to check the "pointer to empty string"

If you would like to check @anuraaga

@EdZou EdZou requested a review from a team August 26, 2020 18:54
@pjanotti
Copy link
Contributor

Hi @EdZou - the change itself looks fine but could you please add a test to cover this case?

/cc @kbrockhoff @anuraaga

@EdZou
Copy link
Contributor Author

EdZou commented Aug 27, 2020

Hello @pjanotti I just added unit test, if you would like to review
cc: @kbrockhoff @anuraaga

@codecov
Copy link

codecov bot commented Aug 27, 2020

Codecov Report

Merging #830 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #830   +/-   ##
=======================================
  Coverage   88.16%   88.16%           
=======================================
  Files         231      232    +1     
  Lines       12408    12412    +4     
=======================================
+ Hits        10939    10943    +4     
  Misses       1114     1114           
  Partials      355      355           
Flag Coverage Δ
#integration 72.00% <ø> (ø)
#unit 87.98% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
exporter/awsxrayexporter/translator/aws.go 96.74% <100.00%> (ø)
exporter/awsxrayexporter/translator/http.go 94.11% <100.00%> (ø)
exporter/awsxrayexporter/translator/segment.go 93.25% <100.00%> (ø)
exporter/awsxrayexporter/translator/service.go 100.00% <100.00%> (ø)
exporter/awsxrayexporter/translator/sql.go 83.60% <100.00%> (ø)
internal/common/awsxray/util.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 02f7291...1776559. Read the comment docs.

Copy link
Contributor

@anuraaga anuraaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks like there's a small build failure and one doc comment, but otherwise LGTM


package awsxray

// Util to check nil string pointer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Util to check nil string pointer
// String returns a pointer to the provided string, or nil if it is an empty string.

@anuraaga
Copy link
Contributor

Looks like just a flaky loadtest - @pjanotti @open-telemetry/collector-maintainers do you mind rerunning it and merging if things look ok? Thanks!

@pjanotti pjanotti merged commit cb45b36 into open-telemetry:master Aug 27, 2020
dyladan referenced this pull request in dynatrace-oss-contrib/opentelemetry-collector-contrib Jan 29, 2021
ljmsc referenced this pull request in ljmsc/opentelemetry-collector-contrib Feb 21, 2022
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ET <[email protected]>
Co-authored-by: Liz Fong-Jones <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants