Skip to content

tracing setup has wrong logger syntax #603

@grantr

Description

@grantr

pkg/tracing/opencensus.go

Lines 126 to 129 in 73daad6

case config.Zipkin:
zipEP, err := zipkin.NewEndpoint(name, ":80")
if err != nil {
logger.Errorw("error building zipkin endpoint", err)

Line 129 uses logger.Errorw incorrectly. It should actually be

logger.Errorw("error building zipkin endpoint", "error", err)

The effect is that whenever an error occurs in zipkin.NewEndpoint, the actual error message is not present in the log line. (Zap also logs a warning "key without a value is ignored").

/cc @mattmoor @grac3gao

@Harwayne this is in-the-wild evidence that SugaredLogger is problematic. If this line were using the Logger type, this bug would be impossible.

Metadata

Metadata

Assignees

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