No release in over 3 years
Low commit activity in last 3 years
There's a lot of open issues
A Ruby implementation of Apollo GraphQL Studio tracing
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

apollo-studio-tracing

CircleCI

This gem extends the GraphQL Ruby gem to add support for sending trace data to Apollo Studio. It is intended to be a full-featured replacement for the unmaintained apollo-tracing-ruby gem, and it is built HEAVILY from the work done within the Gusto apollo-federation-ruby gem as well an exploratory branch created here.

DISCLAIMER

This gem is still in a beta stage and may have some bugs or incompatibilities. See the Known Issues and Limitations below. If you run into any problems, please file an issue.

Installation

Add this line to your application's Gemfile:

gem 'apollo-studio-tracing'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install apollo-studio-tracing

Getting Started

  1. Add use ApolloStudioTracing to your schema class.

  2. Change your controller to add apollo_tracing_enabled: true to the execution context. Ensure that apollo_client_name and apollo_client_version are set as well, for proper client information in Studio:

    def execute
      # ...
      context = {
        apollo_client_name: request.headers["apollographql-client-name"],
        apollo_client_version: request.headers["apollographql-client-version"],
        apollo_tracing_enabled: Rails.env.production?,
      }
      # ...
    end

Updating the Apollo .proto definition

Install Google Protocol Buffers via Homebrew

$ brew install protobuf

Regenerate the Ruby protos with the included script:

$ bin/generate-proto.sh
Removing old client
Downloading latest Apollo Protobuf IDL
Generating Ruby client stubs

Known Issues and Limitations

  • Only works with class-based schemas, the legacy .define API will not be supported

Maintainers