apollo-feature-requests icon indicating copy to clipboard operation
apollo-feature-requests copied to clipboard

Allow individual requests to skip engine

Open pkriete opened this issue 7 years ago • 0 comments

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.

pkriete avatar Sep 14 '18 21:09 pkriete