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

Http 5xx errors status are categorized as "OK" instead of "Error" in APM tracing for Bottle plugin #927

Closed
luozhaoyu opened this issue May 8, 2019 · 1 comment

Comments

@luozhaoyu
Copy link

luozhaoyu commented May 8, 2019

Hi there,

Issue

I find the issue that APM metrics "trace.bottle.request.errors" is different from my internal counter about number of Http 5xx.
I assume Http 5xx would be all categorized as "errors", then I look at APM trace search and find I have 3785 traces are 5xx, but 2880 of them's status is "OK", 905 of them's status is "Error" (see screenshot)

Screen Shot 2019-05-08 at 12 26 12

My Guess

I doubt if the Bottle plugin is working properly, because I see Flask plugin is explicitly set span attribute like error errors.ERROR_TYPE: https://github.com/DataDog/dd-trace-py/blob/master/ddtrace/contrib/flask/middleware.py#L147-L151
So is Pylon: https://github.com/DataDog/dd-trace-py/blob/master/ddtrace/contrib/pylons/middleware.py#L63-L64

Bottle on the other hand, does not set the same set of span attributes: https://github.com/DataDog/dd-trace-py/blob/master/ddtrace/contrib/bottle/trace.py#L50-L56

I am using the latest dd-trace-py==0.24.0

I wonder if my doubt is correct, and seems we should have a unify place to set these attributes rather than requires each framework plugin to handle that individually

Refer

Similar discussion at dd-trace-js about what things should be considered as "error": DataDog/dd-trace-js#297
IMO, network errors and Http 5xx should be categorized as error

@Kyle-Verhoog
Copy link
Member

Hey @luozhaoyu!

Thanks for reporting this, we addressed this issue in #1083 and it got shipped in v0.30.0.

Let us know if you have any further issues 😄

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