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

Logging warn and error when using open tracing #238

Open
steveww opened this issue Jun 22, 2021 · 4 comments
Open

Logging warn and error when using open tracing #238

steveww opened this issue Jun 22, 2021 · 4 comments

Comments

@steveww
Copy link
Contributor

steveww commented Jun 22, 2021

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?

@andrewslotin
Copy link
Contributor

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?

@steveww
Copy link
Contributor Author

steveww commented Jun 23, 2021

Thanks for the reply.
I'm using span.LogFields(otlog.Object("error", err)) any reason this would not work?

@andrewslotin
Copy link
Contributor

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.

@steveww
Copy link
Contributor Author

steveww commented Jun 25, 2021

I have an intermediate span that validates some data. I'd like to log an error if the validation fails.

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