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

[Choreo] [ws analytics] Fix publishing 101 success requests #3584

Merged
merged 1 commit into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
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 @@ -59,6 +59,11 @@ public EventCategory getEventCategory() {
logEntry.getResponse().getResponseCodeDetails())) {
logger.debug("Is success event");
return EventCategory.SUCCESS;
} else if (logEntry.getResponse() != null && AnalyticsConstants.WEBSOCKET_101_STATUS.equals(
String.valueOf(logEntry.getResponse().getResponseCode().getValue()))) {
// TODO: (thushani) Need to handle the websocket success event with ChoreoAnalyticsForWSProvider.
logger.debug("Is success websocket event");
return EventCategory.SUCCESS;
} else if (logEntry.getResponse() != null
&& logEntry.getResponse().getResponseCode() != null
&& logEntry.getResponse().getResponseCode().getValue() != 200
Expand Down Expand Up @@ -87,7 +92,10 @@ public boolean isAuthenticated() {

@Override
public FaultCategory getFaultType() {
if (isTargetFaultRequest()) {
if (AnalyticsConstants.UPSTREAM_OVERFLOW_RESPONSE_DETAIL.
equals(logEntry.getResponse().getResponseCodeDetails())) {
return FaultCategory.THROTTLED;
} else if (isTargetFaultRequest()) {
return FaultCategory.TARGET_CONNECTIVITY;
} else {
return FaultCategory.OTHER;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public class AnalyticsConstants {
public static final String EXT_AUTH_ERROR_RESPONSE_DETAIL = "ext_authz_error";
public static final String ROUTE_NOT_FOUND_RESPONSE_DETAIL = "route_not_found";
public static final String GATEWAY_LABEL = "ENVOY";
public static final String WEBSOCKET_101_STATUS = "101";
public static final String UPSTREAM_OVERFLOW_RESPONSE_DETAIL = "upstream_reset_before_response_started{overflow}";

public static final String TOKEN_ENDPOINT_PATH = "/testkey";
public static final String HEALTH_ENDPOINT_PATH = "/health";
Expand Down
Loading