Skip to content

Commit 7d5968d

Browse files
APM-2884 modify _status response payload
1 parent f80f557 commit 7d5968d

3 files changed

Lines changed: 6 additions & 22 deletions

File tree

proxies/live/apiproxy/policies/AssignMessage.HandleSplunkHec.xml

Lines changed: 0 additions & 16 deletions
This file was deleted.

proxies/live/apiproxy/proxies/default.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</Request>
3232
<Response>
3333
<Step>
34-
<Name>AssignMessage.HandleSplunkHec</Name>
34+
<Name>javascript.SetStatusResponse</Name>
3535
</Step>
3636
</Response>
3737
<Condition>((proxy.pathsuffix MatchesPath "/status") and (request.verb = "GET")) or ((proxy.pathsuffix MatchesPath "/_status") and ((request.verb = "GET") or (request.verb = "HEAD")))
@@ -62,7 +62,7 @@
6262
<FaultRules>
6363
<FaultRule name="SplunkError">
6464
<Step>
65-
<Name>AssignMessage.HandleSplunkHec</Name>
65+
<Name>javascript.SetStatusResponse</Name>
6666
</Step>
6767
<Condition>(((proxy.pathsuffix MatchesPath "/status") and (request.verb = "GET")) or ((proxy.pathsuffix MatchesPath "/_status") and ((request.verb = "GET") or (request.verb = "HEAD")))) and (splunkCalloutResponse isNot null)
6868
</Condition>

proxies/live/apiproxy/resources/jsc/HealthCheck.SetResponse.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const apiproxy_revision = context.getVariable('apiproxy.revision');
22

3-
const healthcheck_status_code = context.getVariable('healthcheckResponse.status.code');
4-
const healthcheck_request_url = context.getVariable('healthcheckRequest.url');
5-
const healthcheck_failed = context.getVariable("servicecallout.ServiceCallout.CallHealthcheckEndpoint.failed");
3+
const healthcheck_status_code = context.getVariable('splunkCalloutResponse.status.code');
4+
const healthcheck_request_url = context.getVariable('splunkCalloutRequest.url');
5+
const healthcheck_failed = context.getVariable("servicecallout.ServiceCallout.LogToSplunk.failed");
66

77
function json_tryparse(raw) {
88
try {
@@ -13,7 +13,7 @@ function json_tryparse(raw) {
1313
}
1414
}
1515

16-
const healthcheck_content = json_tryparse(context.getVariable('healthcheckResponse.content'));
16+
const healthcheck_content = json_tryparse(context.getVariable('splunkCalloutResponse.content'));
1717
const healthcheck_status = (healthcheck_status_code/100 === 2) ? "pass" : "fail";
1818
const timeout = (healthcheck_status_code === null && healthcheck_failed) ? "true" : "false";
1919

0 commit comments

Comments
 (0)