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

Consider 4xx and 5xx as failures #295

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void onEndRequest(ServletRequest req, ServletResponse res) {

ApplicationInsightsHttpResponseWrapper response = ((ApplicationInsightsHttpResponseWrapper)res);
if (response != null) {
telemetry.setSuccess(response.getStatus() >= 200 && response.getStatus() < 300);
telemetry.setSuccess(response.getStatus() < 400);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution.
I see the .NET SDK also treat 401 as success

Please keep the same behavior so the SDKs are aligned. Thanks.

telemetry.setResponseCode(Integer.toString(response.getStatus()));
} else {
InternalLogger.INSTANCE.error("Failed to get response status for request ID: %s", telemetry.getId());
Expand Down