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

Add error tag to spans on OT endpoint middleware #804

Closed
jlordiales opened this issue Nov 23, 2018 · 3 comments · Fixed by #1072
Closed

Add error tag to spans on OT endpoint middleware #804

jlordiales opened this issue Nov 23, 2018 · 3 comments · Fixed by #1072

Comments

@jlordiales
Copy link
Contributor

jlordiales commented Nov 23, 2018

Hi!
I think it would be useful for the OpenTracing endpoint middleware (https://github.com/go-kit/kit/blob/master/tracing/opentracing/endpoint.go) to inspect the error returned by the next endpoint and set the error tag to true/false accordingly (it could also optionally set the error.object log field).
In addition to just inspecting the returned error it could also check if the response struct implements endpoint.Failer and apply the same logic.

If you think this would be useful I'd be happy to create a PR, just wanted to get your thoughts first.

@peterbourgon
Copy link
Member

@basvanbeek?

@basvanbeek
Copy link
Member

Makes sense to add. The OpenCensus middleware already does somethjng similar with the status object and also inspects the endpoint.Failer checks.

@jlordiales
Copy link
Contributor Author

Great, I'll create a PR this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants