apache / skywalking

APM, Application Performance Monitoring System
https://skywalking.apache.org/
Apache License 2.0
23.87k stars 6.52k forks source link

Support ignore some server-side failed HTTP status code. #6906

Closed liqiangz closed 3 years ago

liqiangz commented 3 years ago

Please answer these questions before submitting your issue.

Requirement or improvement

Maybe We can support statuscheck.ignored_server-side_http_status_code in agent configuration.

wu-sheng commented 3 years ago

Now the http request regards all requests with http status code >= 400 as failed. But as a http server, we often use 403 as the status code of not logged in, and we don’t want to treat not being logged in as an error. In some other scenarios , we do not want the 404 or 405 status code to interfere with the statistics of the successful rate.

Why isn't not-authentication coded as 503?

wu-sheng commented 3 years ago

If you insist on your response code, use responseCode in the OAL to calculate the successful rate.

liqiangz commented 3 years ago

Now the http request regards all requests with http status code >= 400 as failed. But as a http server, we often use 403 as the status code of not logged in, and we don’t want to treat not being logged in as an error. In some other scenarios , we do not want the 404 or 405 status code to interfere with the statistics of the successful rate.

Why isn't not-authentication coded as 503?

There is a lot of old code here. We cannot modify these logics. We can only be compatible with these codes.

wu-sheng commented 3 years ago

Now the http request regards all requests with http status code >= 400 as failed. But as a http server, we often use 403 as the status code of not logged in, and we don’t want to treat not being logged in as an error. In some other scenarios , we do not want the 404 or 405 status code to interfere with the statistics of the successful rate.

Why isn't not-authentication coded as 503?

There is a lot of old code here. We cannot modify these logics. We can only be compatible with these codes.

Read https://github.com/apache/skywalking/issues/6906#issuecomment-833526364. But also, you should know, we never should add features base on others' mistakes. This is not a good way.

liqiangz commented 3 years ago

If you insist on your response code, use responseCode in the OAL to calculate the successful rate.

But now in the agent, the httpcode above 400 is regarded as a failure. There are some scenarios, such as 404 and other codes, which are not regarded as failures.

wu-sheng commented 3 years ago

If you insist on your response code, use responseCode in the OAL to calculate the successful rate.

But now in the agent, the httpcode above 400 is regarded as a failure. There are some scenarios, such as 404 and other codes, which are not regarded as failures.

So what? OAL is the one determining the metrics, which is your question.

liqiangz commented 3 years ago

If you insist on your response code, use responseCode in the OAL to calculate the successful rate.

But now in the agent, the httpcode above 400 is regarded as a failure. There are some scenarios, such as 404 and other codes, which are not regarded as failures.

So what? OAL is the one determining the metrics, which is your question.

Thanks for your reply. Using oal is a good idea, the disadvantage is that it will affect all agents. But it is enough for me now.

wu-sheng commented 3 years ago

If you insist on your response code, use responseCode in the OAL to calculate the successful rate.

But now in the agent, the httpcode above 400 is regarded as a failure. There are some scenarios, such as 404 and other codes, which are not regarded as failures.

So what? OAL is the one determining the metrics, which is your question.

Thanks for your reply. Using oal is a good idea, the disadvantage is that it will affect all agents. But it is enough for me now.

You could target specific services if you want. But after all, it is little performance impact, and keep in your private version only.