Skip to content

Documentation for timing logs is missing instrumentation #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jsteiner opened this issue Apr 21, 2018 · 1 comment
Open

Documentation for timing logs is missing instrumentation #2

jsteiner opened this issue Apr 21, 2018 · 1 comment

Comments

@jsteiner
Copy link
Contributor

It seems like for local logging to work you need to also include an instrumenter in your schema. This isn't mentioned in the documentation.

I'm not using Scout, but I wrote a dummy tracer just to get this working:

class DummyTracer
  def self.instrument(_, _, &block)
    block.call
  end
end

YourSchema = GraphQL::Schema.define do
  instrument :field, CacheQL::FieldInstrumentation.new(DummyTracer)
end

Should something like that be included in this gem for logging without Scout?

@qrush
Copy link
Contributor

qrush commented Apr 22, 2018

OK, so this is really just for Scout right now. We could make it more generic. I'm using:

  instrument :field, CacheQL::FieldInstrumentation.new(ScoutApm::Tracer)

For just logging by itself, you need the around_action code in the readme, in your controller that serves GraphQL requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants