router
router copied to clipboard
Re-consider the location of where APQ lives
In #1117, we cannot report APQ cache misses, because the APQ layer executes before the plugins apply to the request: https://github.com/apollographql/router/blob/23c3974a122989ee115c41db956a69afd325e969/apollo-router-core/src/services/router_service.rs#L415-L420
In case of cache miss, APQ returns an error answer directly, so it does not go through the plugins, and so the telemetry plugin cannot handle it.
We must move the APQ layer to a plugin to solve this, possibly folding it into the traffic shaping plugin.
It is not blocking #1117 since we're not going to count the actual cache misses, and count registers instead, but it makes more sense in our architecture to have everything go through the plugins
And we should consider where the configuration for this could live!
APQ now applies in the right place, and https://github.com/apollographql/router/pull/2327 added the metrics