router icon indicating copy to clipboard operation
router copied to clipboard

Re-consider the location of where APQ lives

Open Geal opened this issue 2 years ago • 1 comments

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

Geal avatar May 23 '22 08:05 Geal

And we should consider where the configuration for this could live!

abernix avatar Aug 12 '22 08:08 abernix

APQ now applies in the right place, and https://github.com/apollographql/router/pull/2327 added the metrics

Geal avatar Jan 13 '23 14:01 Geal