Skip to content
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

Bug: Slice is initialised with nil field values #3

Open
swdee opened this issue Jan 23, 2020 · 1 comment
Open

Bug: Slice is initialised with nil field values #3

swdee opened this issue Jan 23, 2020 · 1 comment

Comments

@swdee
Copy link

swdee commented Jan 23, 2020

Concerning the following line of code the initialisation of the slice opentracingFields creates a slice of the size of the number of fields plus one presumable for the log string.

opentracingFields := make([]opentracinglog.Field, len(fields)+1)

However the method the real log fields are added to opentracingFields is done with an append function which causes these additional fields to be added after the nil fields initialized by make. As a result nil/empty fields are passed to span.LogFields() which causes empty log lines to be displayed in the WebUI of Jaeger.

To stop these empty fields being passed the opentracingFields slice should be initialized as zero size, eg: Line 141 above should be;

opentracingFields := make([]opentracinglog.Field, 0)
@bvandewalle
Copy link
Collaborator

Thanks for reporting, I confirmed this after a quick test. I will issue a PR for this.

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

No branches or pull requests

2 participants