I'm currently adding Application Insights' dependency tracking into an Apollo server, and I'd like to track the time it takes to call dependencies from within Apollo. Good news, there's a trace method that does exactly what I need! Bad news, it's private and only logs to console...
I'd like to simply be able to receive the trace context (url, duration, method) and log that information myself.
I'm happy to provide a PR if that makes sense.
- New boolean property
RESTDataSource.traceEnabled (by default, process && process.env && process.env.NODE_ENV === 'development')
- Change
RESTDataSource.trace to receive individual properties options.method || 'GET' and url
- New protected function
RESTDataSource.log, which by default logs to the console like it does now, but that can be overriden.
I'm currently adding Application Insights' dependency tracking into an Apollo server, and I'd like to track the time it takes to call dependencies from within Apollo. Good news, there's a
tracemethod that does exactly what I need! Bad news, it's private and only logs toconsole...I'd like to simply be able to receive the trace context (url, duration, method) and log that information myself.
I'm happy to provide a PR if that makes sense.
RESTDataSource.traceEnabled(by default,process && process.env && process.env.NODE_ENV === 'development')RESTDataSource.traceto receive individual propertiesoptions.method || 'GET'andurlRESTDataSource.log, which by default logs to the console like it does now, but that can be overriden.