-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
ActiveOperationLimiter does not work when I have enabled SentryTrace #4826
Comments
Hi! Thanks for reporting this. These two should definitely work together, regardless of their order. I'll take a look at their implementation and see why they're getting mixed up. Thanks for sharing the work-arounds that worked for you. For the deprecation, you could try updating to graphql-enterprise v1.3.2 -- it includes a patch to use the new tracing API instead of the deprecated one (https://github.com/rmosolgo/graphql-ruby/blob/master/CHANGELOG-enterprise.md#132-15-jan-2024). Let me know if you still see that warning after updating. In the meantime, I'll take a look at this compatibility issue soon and follow up here! |
I have updated my local machine and the warning message is gone. But FYI I still encountered the original problem with graphql-enterprise gem v1.3.3. Anyway, thanks @rmosolgo 🙏 |
Hey @rmosolgo, I am getting the same issue with the Sentry trace and the GraphQL object cache. This code does not work: class ApplicationSchema < GraphQL::Schema
query QueryType
use(GraphQL::Enterprise::ObjectCache, memory: true)
trace_with GraphQL::Tracing::SentryTrace
end The code above calculates the cache hit correctly, but never writes to the cache, because it never calls the This code works as expected: class ApplicationSchema < GraphQL::Schema
query QueryType
trace_with GraphQL::Tracing::SentryTrace
use(GraphQL::Enterprise::ObjectCache, memory: true)
end indicating that the order of the statements matter. I am also using the v1.3.3 enterprise version. |
Hey, thanks again for reporting this. I just released graphql-ruby 2.2.8 which includes #4830. Please give it a try on that new version and let me know if you run into any more trouble! |
It is working fine now. thanks @rmosolgo |
Glad to hear it -- please let me know if you run into any more trouble! |
Describe the bug
Once I have enabled both rate limiting (ActiveOperationLimiter) and tracing (SentryTrace) at the same time, the ActiveOperationLimiter does not work.
Versions
graphql
version: 2.2.7graphql-pro
version: 1.25.2graphql-enterprise
version: 1.3.1 / 1.3.3rails
(or other framework): 7.1.3GraphQL schema
GraphQL query
Any query
Steps to reproduce
Just execute any query to the schema.
Expected behavior
The ActiveOperationLimiter should work as expected even though I have enabled SentryTrace.
Actual behavior
There is no exception, but the ActiveOperationLimiter stopped working.
I set the breakpoint in the debugger and confirmed the methods in ActiveOperationLimiter were not triggered.
BTW, there is an unexpected warning message when I started the Rails server:
Additional context
The rate limiting will be enabled if I did any of the following:
trace_with SentryTrace
first and thenuse ActiveOperationLimiter
The text was updated successfully, but these errors were encountered: