Ignore select backend errors in dashboard report

Not applicable

Our dashboard shows a high number of errors because the response from one of our back targets is frequently a 400. In our case this is not an error. Is there a simple way to indicate to Apigee that this response should not be considered an error on the dashboard graph?

I imagine it would be a policy in the response flow but I'm not quite sure what or what term to search for to find an answer!

Solved Solved
1 3 119
1 ACCEPTED SOLUTION

YES, you can do that.

Actually it's not a policy but it's a setting on the HTTP Target.

In the TargetEndpoint, you can do something like this:

  <HTTPTargetConnection>
    <SSLInfo>
        <Enabled>true</Enabled>
        <IgnoreValidationErrors>true</IgnoreValidationErrors>
    </SSLInfo>
    <Properties>
        <Property name='success.codes'>2XX,400</Property>
    </Properties>
    <URL>https://example.com/getSearchResults</URL>
  </HTTPTargetConnection>

This says that any 200-range code as well as 400, will not be considered an error. If you do not specify success.codes, the HTTPTargetConnection treats 1XX, 2XX, 3XX as success.

If you configure the target to treat 400 as success, you still have a chance later in the response flow to raise a fault. So you could design the logic to look at the payload and conditionally raise a fault if the 400 is not the typical 400, and if it is a bonafide error.

The above would still treat 404 as an error. You can use 4xx to accept all 400-range codes as success, if you like. Or you can specify individual codes, like "2XX,400,404" .

See also, the documentation on success.codes.

View solution in original post

3 REPLIES 3

YES, you can do that.

Actually it's not a policy but it's a setting on the HTTP Target.

In the TargetEndpoint, you can do something like this:

  <HTTPTargetConnection>
    <SSLInfo>
        <Enabled>true</Enabled>
        <IgnoreValidationErrors>true</IgnoreValidationErrors>
    </SSLInfo>
    <Properties>
        <Property name='success.codes'>2XX,400</Property>
    </Properties>
    <URL>https://example.com/getSearchResults</URL>
  </HTTPTargetConnection>

This says that any 200-range code as well as 400, will not be considered an error. If you do not specify success.codes, the HTTPTargetConnection treats 1XX, 2XX, 3XX as success.

If you configure the target to treat 400 as success, you still have a chance later in the response flow to raise a fault. So you could design the logic to look at the payload and conditionally raise a fault if the 400 is not the typical 400, and if it is a bonafide error.

The above would still treat 404 as an error. You can use 4xx to accept all 400-range codes as success, if you like. Or you can specify individual codes, like "2XX,400,404" .

See also, the documentation on success.codes.

Thanks Dino, just what I was looking for. Sometimes knowing where to start looking is the biggest challenge!

I feel ya. I was once new to the Apigee Edge platform and I remember not knowing where to turn. !!! But the docs have improved greatly since then, and we have community.... More resources!