Skip to main content

Settings

Service Instances

Service instances are network addresses of instances of the service that needs to be tested. There are two acceptable formats these addresses can be specified in:

  1. Host Port - <host>:<port> e.g. localhost:9000. The host must be a valid host string and the port must be a valid integer.
  2. Base Url - <protocol>://<host>/<baseUri> e.g. https://lambda-api.sn126.com/api/1/org/diffy/env/example/servers/Primary/lambda. The entire string must resolve to a valid url. The URIs of requests received by Diffy will be re-written with the specified base url before being forwarded to a service instance. e.g. with the above base url /hello/world will be forwarded to https://lambda-api.sn126.com/api/1/org/diffy/env/example/servers/Primary/lambda/hello/world.

The values of the following settings must conform to either of the above formats.

candidate

This is the network address of the instance running the new code that needs to be tested.

master.primary

This is the network address of the old code to provide a baseline for correct behavior.

master.secondary

This is the network address of another instance of the old code to detect noise.

Ports

Diffy uses the following ports on localhost. All ports must be specified as valid integers:

proxy.port

This port is used to receive requests that will be forwarded to service instances. The default value of this port is 8880.

http.port

This port is used to serve the UI where we can see what regresssions have been caught by Diffy. The default value of this port is 8888.

Noise Cancellation

Diffy implement noise cancellation with a linear model with two parameters. The motivation for changing the default values would be to eliminate false negatives or false positives. To eliminate false negatives, we would reduce both thresholds. Conversely, to reduce false positives we would increase them. Both parameters are specified as percentages.

threshold.relative

This parameter considers the frequency of a response field being different between primary and candidate relative the frequency of it being different between primary and secondary. The default value is 20 (percent).

threshold.absolute

This parameter considers the frequency of field being different between primary and candidate relative to the total number of requests received by the endpoint. The default value is 0.03 (percent).

Others

serviceName

This is a label that shows up as the name of the service being tested in the UI. It is, specially, helpful in identifying which Diffy instance is testing which service in an environment hosting multiple Diffy instances.

excludeHttpHeadersComparison

Response headers may sometimes be ignored by the client application logic and may even contain metadata not being directly controlled by the service logic. In such case we may want to eliminate header comparison. We can do this by adding --excludeHttpHeadersComparison=true to our command line arguments.

allowHttpSideEffects

For safety reasons POST, PUT, PATCH, DELETE are ignored by default . Add --allowHttpSideEffects=true to your command line arguments to enable these verbs.

resource.mapping

By default the names of the resources in the UI are fetched from the Canonical-Resource header in each request. However this can be configured at boot with a static line, example:

-resource.mapping='/foo/:param;f,/b/*;b,/ab/*/g;g,/z/*/x/*/p;p' \

In the snippet above the configuration form is: <pattern>;<resource-name>[,<pattern>;<resource-name>]*

The first matching configuration will be used.

responseMode

The responseMode flag can have one of 4 values - 'none', 'primary', 'secondary', or 'candidate'. The value assigned to this flag will determine which of the responses (if any) for all request sent to diffy will be returned to the client. If the flag is not explicitly assigned it defaults to 'primary'.