apollo-feature-requests
apollo-feature-requests copied to clipboard
Allow individual requests to skip engine
We have a few noisy automated queries that hit our graphql server (e.g. E2E health checks). They end up filling up our engine metrics with a lot of useless data. We'd love to able to skip the whole reporting extension for a given request.
We have in the past resorted to skipping the engine middleware for these requests. Essentially something like this:
const engineMiddleware = () => {
const original = engine.expressMiddleware();
return (req, res, next) => {
if (req.headers.disableTelemetry === SECRET) {
next();
} else {
original(req, res, next);
}
};
};
With ApolloServer this has gotten a little more difficult.