Kong/kong-plugin-zipkin

Missing `error` tag to mark erroneous spans red in the zipkin-ui.

FlorianLautenschlager opened this issue · 4 comments

I took a look at the tags and i miss the error tag.
The zipkin-ui gitlab page says (source):

How do I make errors visible in yellow or red?
The UI interprets an "error" tag as a failed span, coloring it red. It interprets an annotation containing the substring "error" as a transient failure. To ensure the UI displays errors, please use the error key appropriately.

Hence it would be great if the kong-plugin-zipkin also writes the error tag. Perhaps every response with a http code >= 500 writes an error tag. But what is a good value? The code again?

The image below shows the behaviour of the zipkin-ui:

index

Currently the error tag is used to indicate the failure of an upstream.

I don't think using setting error based on the http error code makes sense: as kong is a proxy it's up to the upstream server to indicate the error.

However, we should probably come up with a way to find what errors are kong-internal (e.g. imagine the ldap plugin is unable to reach the ldap server; in which case it closes the request with a 500 error) and set the error tag for those.

Currently the error tag is used to indicate the failure of an upstream.

That is fine. These also includes timeouts, etc.?

I don't think using setting error based on the http error code makes sense: as kong is a proxy it's up to the upstream server to indicate the error.

Sounds also fine, perhaps we can use an annotation "It interprets an annotation containing the substring "error" as a transient failure."

However, we should probably come up with a way to find what errors are kong-internal (e.g. imagine the ldap plugin is unable to reach the ldap server; in which case it closes the request with a 500 error) and set the error tag for those.

👍

If kong has more information about the error (e.g. specific error code from kong) then we should add it, otherwise the error code is good enough as it is standard even if it does not add more value to the downstream span.

Agreed. Closing this one since Kong does produce the error tag in upstream failures as explained above, subject to the caveats also explained.