-
Notifications
You must be signed in to change notification settings - Fork 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
feat: log graphql requests #526
base: dev
Are you sure you want to change the base?
Conversation
require 'net/http' | ||
|
||
class SubmitAnalyticsEvent < ApplicationJob | ||
# TODO not entirely sure what goes here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^
{ | ||
searchTerms: names, | ||
}, | ||
{ 'dgidb-client-name': 'dgidb-frontend' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to double check that it works as expected, but it looks like (based on this example here) you can set an HTTP Header when your initialize the graphql client.
That might be better than stapling it into each query individually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@acoffman yeah, I was a little unsure of whether we wanted to set different headers for different queries and to filter out noisier or less informative ones. We should probably set a base one at client initialization and then maybe use an additional one for chosen queries if we go that route.
This PR grabs the query type and the declared variables and logs them.
A couple notes/TODO's