A citizen GIS lookup API is slow, but overall API duration mixes city code with a third-party GIS vendor. How should the developer instrument latency for clearer ownership?
Select an answer to reveal the explanation.
Short Explanation
When the whole request timer is one blob, you can't tell if city code or the GIS vendor is the slowpoke. Time the vendor hop on its own—custom metric or X-Ray subsegment—and ownership gets obvious. Then you tune the right side of the fence.
Full Explanation
When a citizen GIS lookup API is slow but overall API duration mixes city code with a third-party GIS vendor, the developer should emit a custom CloudWatch metric or timed X-Ray subsegment that records GIS vendor call latency separately from overall API duration. Separating ownership of latency prevents chasing the wrong code path and clarifies whether the city must optimize locally or escalate to the vendor.
Increasing Lambda memory only assumes vendor wait time shrinks with more CPU, which is often false for network-bound external calls.
Replacing the vendor with hard-coded coordinates may unblock demos but does not instrument latency ownership and can be wrong for real GIS.
Alarming solely on API Gateway 4xx rates does not infer GIS latency for successful but slow lookups.
Exam caveat: Break out downstream dependency latency with custom metrics or subsegments when overall duration is ambiguous.
Operational check: Wrap the vendor call with timing, publish a GIS latency metric, chart it beside total API latency, and set an alarm that pages when vendor latency dominates the municipal GIS SLO. Keep the civic/municipal context in mind: citizen map lookups are highly visible; vendor-versus-city clarity speeds council-facing incident updates.