Skip to content

ActiveOperationLimiter does not work when I have enabled SentryTrace #4826

@cyruxwong

Description

@cyruxwong

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.7
graphql-pro version: 1.25.2
graphql-enterprise version: 1.3.1 / 1.3.3
rails (or other framework): 7.1.3

GraphQL schema

class ApplicationSchema < GraphQL::Schema
  query QueryType

  use GraphQL::Enterprise::ActiveOperationLimiter, redis:
  trace_with GraphQL::Tracing::SentryTrace
end

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:

Schema.instrument is deprecated, use `trace_with` instead: https://graphql-ruby.org/queries/tracing.html"
  (From `PublicSchema.instrument(query, #<GraphQL::Enterprise::ActiveOperationLimiter::Instrumenter:0x000000012ed3b768>)` at /Users/cyrux.wong/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/graphql-enterprise-1.3.1/lib/graphql/enterprise/active_operation_limiter.rb:51:in `initialize')

Additional context

The rate limiting will be enabled if I did any of the following:

  • Disable SentryTrace
  • Swap the lines of configuration in the schema, i.e. trace_with SentryTrace first and then use ActiveOperationLimiter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions