Skip to content

Commit

Permalink
Merge pull request #3584 from Thushani-Jayasekera/ws-analytics
Browse files Browse the repository at this point in the history
[Choreo] [ws analytics] Fix publishing 101 success requests
  • Loading branch information
renuka-fernando authored Sep 15, 2024
2 parents c95a8a7 + 8cb9100 commit 7d25499
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
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

0 comments on commit 7d25499

Please sign in to comment.