go-sensor
go-sensor copied to clipboard
Logging warn and error when using open tracing
I'm using the go sensor with open tracing. Everything works OK apart from logging an error.
What are the magic tags I need to set to generate a log message so that it shows up under the service log messages?
Hey @steveww! The Go sensor does not support logging spans yet, but there is an option to log an error with (opentracing.Span).LogKV()
by providing "error"
as a key. This would mark the span accordingly and the error message will be displayed in UI. Would this work in your case?
Thanks for the reply.
I'm using span.LogFields(otlog.Object("error", err))
any reason this would not work?
Apologies for confusion, I just checked the code and while this should be enough to mark the span as erroneous, but the error message needs to go to span tags to be displayed in UI. There is no common tag that would work uniformly for all kind of spans, but if you could share the span types you're using, I can provide corresponding error tags for them.
I have an intermediate span that validates some data. I'd like to log an error if the validation fails.