apollo-federation-ruby icon indicating copy to clipboard operation
apollo-federation-ruby copied to clipboard

Tracing improvements

Open lennyburdette opened this issue 6 years ago • 2 comments

Tracking some feedback from Apollo on the java implementation that's also relevant to this implementation.

  • [ ] Use Base64.strict_encode64

    This leaves out newlines in the middle which aren't particularly helpful when encoded in a JSON string, and causes Node to have to use a slightly slower decode implementation.

  • [x] Capture parse and validation errors and attach them to the root node

lennyburdette avatar Sep 25 '19 17:09 lennyburdette

Adding some color on the second list item:

When following the current Readme instructions and enabling tracing, there are a couple of cases that result in the following error being raised, such as an invalid or unparsable query. https://github.com/Gusto/apollo-federation-ruby/blob/57ecc5baff0d628e1b3f71161eb232fadbc05938/lib/apollo-federation/tracing.rb#L23 The error reads "... Add use ApollFederation::Tracing to your schema.", but this is not the root cause of the failure, rather it is the fact that trace[:start_time] isn't available because the query didn't execute fully. I'd ideally like to only raise that error if ApollFederation::Tracing isn't in the schema's tracers.

noaelad avatar Oct 04 '19 21:10 noaelad

@noaelad @lennyburdette would you mind adding your setup of distributed tracing to the example, since for me even if the query is running well without it, with it I either have an error you mentioned or no tracing payload.

prikha avatar Oct 23 '19 05:10 prikha