Skip to content

logrus_error="can not add field \"reason\"" when sending trace #1477

Closed
@CalPully

Description

@CalPully

Versions

  • Go: 1.23.5
  • Refinery: 2.9.1

Steps to reproduce

  1. Run the refinery docker image
  2. Apply configuration using the DeterministicSampler with one or more Rules
  3. Send traces to the refinery instance
  4. Observe info level logs showing a logrus error "can not add field "reason""

Additional context

The logging library in use uses a map[string]interface{} to build the fields for logging. The library performs a check on the data provided that it is not a function or a pointer to a function when calling the WithFields method. In the snippet linked below, "reason" is being set to the function td.KeptReason whereas I believe the intention is to set to the return of the function, td.KeptReason().

logFields["reason"] = td.KeptReason

The sirupsen/logrus code performing the check can be found here.

https://github.com/sirupsen/logrus/blob/d1e6332644483cfee14de11099f03645561d55f8/entry.go#L125

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions