Skip to content

Commit

Permalink
Merge pull request #12125 from piyumaldk/master
Browse files Browse the repository at this point in the history
Handling null for tenant domain
  • Loading branch information
piyumaldk committed Aug 21, 2023
2 parents 5fde548 + e2bdff3 commit fcd7f20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public class APIMgtGatewayConstants {
public static final String CUSTOM_ANALYTICS_RESPONSE_PROPERTIES = "apim.analytics.response.properties";
public static final String CUSTOM_ANALYTICS_PROPERTY_SEPARATOR = ",";
public static final String API_UUID_PROPERTY = "API_UUID";
public static final String TENANT_DOMAIN = "tenant.info.domain";

/**
* Constants for swagger schema validator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,11 @@ public boolean handleResponseOutFlow(MessageContext messageContext) {
if (responseLatencySpan != null) {
GatewayUtils.setAPIRelatedTags(responseLatencySpan, messageContext);
API api = GatewayUtils.getAPI(messageContext);
String tenantDomain = (String) messageContext.getProperty(APIMgtGatewayConstants.TENANT_DOMAIN);
if (api != null) {
TelemetryUtil.updateOperation(responseLatencySpan,
api.getApiName().concat("--").concat(api.getApiVersion()).concat("--")
.concat(GatewayUtils.getTenantDomain()));
.concat(tenantDomain));
}
TelemetryUtil.finishSpan(responseLatencySpan);
}
Expand All @@ -157,10 +158,11 @@ public boolean handleResponseOutFlow(MessageContext messageContext) {
if (responseLatencySpan != null) {
GatewayUtils.setAPIRelatedTags(responseLatencySpan, messageContext);
API api = GatewayUtils.getAPI(messageContext);
String tenantDomain = (String) messageContext.getProperty(APIMgtGatewayConstants.TENANT_DOMAIN);
if (api != null) {
Util.updateOperation(responseLatencySpan,
api.getApiName().concat("--").concat(api.getApiVersion()).concat("--")
.concat(GatewayUtils.getTenantDomain()));
.concat(tenantDomain));
}
if (responseLatencySpan != null) {
Util.finishSpan(responseLatencySpan);
Expand Down

0 comments on commit fcd7f20

Please sign in to comment.