These 1 commits are when the Protocol Buffers files have changed:
Commit: | 57ecc5b | |
---|---|---|
Author: | Lenny Burdette | |
Committer: | Noa Elad |
feat: add support for federated tracing (#16) * feat: add support for federated tracing Federated GraphQL services should include timing and error information as a Base64-encoded protocol buffer message in the `"extensions.ftv1"` field. The gateway requests traces by adding a special header to the GraphQL request, and combines traces from all federated services into a single trace. This change includes a Tracer that uses the graphql-ruby [tracing API][t] to record field timings and info and store it on the execution context. It also includes methods on the `ApolloFederation::Tracing` module to pluck the info from the context, convert it to an encoded string, and attach it to the query result's extensions. I used the Apollo Server typescript code as reference: * https://github.com/apollographql/apollo-server/blob/master/packages/apollo-engine-reporting/src/federatedExtension.ts * https://github.com/apollographql/apollo-server/blob/master/packages/apollo-engine-reporting/src/treeBuilder.ts As well as an unfinished fork of apollo-tracing-ruby: * https://github.com/salsify/apollo-tracing-ruby/blob/feature/new-apollo-api/lib/apollo_tracing/tracer.rb * https://github.com/salsify/apollo-tracing-ruby/blob/feature/new-apollo-api/lib/apollo_tracing/trace_tree.rb Federated tracing documentation: https://www.apollographql.com/docs/apollo-server/federation/metrics/ Addresses #14 [t]:https://graphql-ruby.org/queries/tracing.html * chore: code review * `module_function` vs repetitive `self.` * fix a call to `result.to_h` in `.attach_trace_to_result` * FIXUP: add comments explaining the tracer execution order and add a test to cover lazy fields will squash later
The documentation is generated from this commit.