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

tag error is wrong when return error #2

Open
salmon7 opened this issue Jul 19, 2020 · 1 comment
Open

tag error is wrong when return error #2

salmon7 opened this issue Jul 19, 2020 · 1 comment

Comments

@salmon7
Copy link

salmon7 commented Jul 19, 2020

error tag is always is false in span, even return error in handler.

the code is here:
https://github.com/opentracing-contrib/echo/blob/master/middleware.go#L58~L63

			if err := next(c); err != nil {
				sp.SetTag("error", true)
				c.Error(err)
			}

			sp.SetTag("error", false)

Maybe it should be changed to:

			err = next(c)
			if err != nil {
				sp.SetTag("error", true)
				c.Error(err)
			} else {
				sp.SetTag("error", false)
			}
@fananchong
Copy link

I also found this problem

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