Apollo Link Tracer
Trace your apollo queries and mutations with apollo-link.
Relies on @convoy/tracer.
Getting started
npm install apollo-link-tracer --save
;; const apiReporter = flushHandler: async { // Report traces to API }; link: ApolloLink;
Applying apollo-link-tracer both before and after the retry link lets you separately measure each retry, but provides a single trace across all of them.
A Tracer object is added to the operation context, which can then be used to pass a trace id to the HTTP headers to support cross service tracing.
Advanced options
On a per GQL request basis you can alter how the trace is captured.
api;
Filtering Sensitive Variables
To avoid reporting the contents of sensitive variables, you can specify variable filters.
service: 'my-service' tracerConfig: reporter: apiReporter fullTraceSampleRate: 1 name: 'apollo-link-retry' variableFilters: 'password' /secret.*sauce/
Variable filters can be either string matches or regular expressions. Any variables whose names match these filters will have their values filtered out, e.g.
username: 'bob' password: 'hunter2' secret_hot_sauce: 'sri racha'
becomes
username: 'bob' password: '<filtered>' secret_hot_sauce: '<filtered>'