Smart Diff
Traffic Capture
Smart Diff captures and analyzes HTTP traffic between services to detect breaking changes. It compares requests and responses between baseline and sandbox environments using AI models trained on historical traffic patterns.
We extend the starlet http
module to accept two
optional flags for each request: capture
(type bool) and reqName
(type
string).
For example:
resp = http.get("...", capture=True, name="getLocations")
When capture
is true, the library will inject headers based on environment
variables to interface with our system of traffic capture. In this case, one
can name the request with reqName
.
Am example Smart Test is shown below:
res = http.get(
url="https://my-api:8081/locations", # supports internal URLs (http://name.namespace.svc)
capture=True,
name="getLocations"
)
print(res.status_code)
print(res.body())
When capture=True
:
- Headers are injected for traffic capture
- Requests execute against both baseline and sandbox
- Responses are analyzed for structural differences
- Results are stored and accessible via dashboard
Analysis Output
Smart Diff generates a relevancy-based comparison highlighting:
- Schema changes
- Field additions/removals
- Type modifications
- High-impact differences
More details are available in the concept documentation.