Skip to content

Bug: Slice is initialised with nil field values #3

@swdee

Description

@swdee

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions