Skip to content

Commit

Permalink
Merge pull request #3452 from rashm1n/moesif-cc
Browse files Browse the repository at this point in the history
Adding necessary data populations for Moesif Integration
  • Loading branch information
rashm1n authored Oct 26, 2023
2 parents 9477ffd + 65e30c9 commit 830864d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public API getApi() {
tenantDomain == null ? APIConstants.SUPER_TENANT_DOMAIN_NAME : tenantDomain);
api.setOrganizationId(requestContext.getMatchedAPI().getOrganizationId());
api.setEnvironmentId(requestContext.getMatchedAPI().getEnvironmentId());
api.setApiContext(requestContext.getRequestPath());
return api;
}

Expand Down Expand Up @@ -204,9 +205,7 @@ public String getUserName() {

@Override
public String getUserAgentHeader() {
// User agent is not required for fault scenario
logger.error("Internal Error: User agent header is not required for fault events");
return null;
return requestContext.getHeaders().get("user-agent");
}

@Override
Expand All @@ -223,6 +222,7 @@ public Map<String, Object> getProperties() {
String deploymentType = requestContext.getMatchedAPI().getDeploymentType();
map.put(AnalyticsConstants.GATEWAY_URL, gwURL);
map.put(AnalyticsConstants.DEPLOYMENT_TYPE, deploymentType);
map.put(AnalyticsConstants.API_METHOD, requestContext.getRequestMethod());
return map;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class AnalyticsConstants {

public static final String GATEWAY_URL = "x-original-gw-url";
public static final String DEPLOYMENT_TYPE = "deployment-type";
public static final String API_METHOD = "apiMethod";

public static final int API_THROTTLE_OUT_ERROR_CODE = 900800;
public static final int HARD_LIMIT_EXCEEDED_ERROR_CODE = 900801;
Expand Down

0 comments on commit 830864d

Please sign in to comment.