chore(yabeda): add graphql metrics

This commit is contained in:
Paul Chavard 2024-04-04 16:17:04 +02:00
parent 696c8458d7
commit 3dbb2266d2
3 changed files with 6 additions and 0 deletions

View file

@ -103,6 +103,7 @@ gem 'view_component'
gem 'vite_rails' gem 'vite_rails'
gem 'warden' gem 'warden'
gem 'webrick', require: false gem 'webrick', require: false
gem 'yabeda-graphql'
gem 'yabeda-prometheus' gem 'yabeda-prometheus'
gem 'yabeda-sidekiq' gem 'yabeda-sidekiq'
gem 'zipline' gem 'zipline'

View file

@ -838,6 +838,9 @@ GEM
anyway_config (>= 1.0, < 3) anyway_config (>= 1.0, < 3)
concurrent-ruby concurrent-ruby
dry-initializer dry-initializer
yabeda-graphql (0.2.3)
graphql (>= 1.9, < 3)
yabeda (~> 0.2)
yabeda-prometheus (0.9.1) yabeda-prometheus (0.9.1)
prometheus-client (>= 3.0, < 5.0) prometheus-client (>= 3.0, < 5.0)
rack rack
@ -997,6 +1000,7 @@ DEPENDENCIES
web-console web-console
webmock webmock
webrick webrick
yabeda-graphql
yabeda-prometheus yabeda-prometheus
yabeda-sidekiq yabeda-sidekiq
zipline zipline

View file

@ -147,6 +147,7 @@ class API::V2::Schema < GraphQL::Schema
use Timeout, max_seconds: 30 use Timeout, max_seconds: 30
use GraphQL::Batch use GraphQL::Batch
use GraphQL::Backtrace use GraphQL::Backtrace
use Yabeda::GraphQL
if Rails.env.development? if Rails.env.development?
class LogQueryDepth < GraphQL::Analysis::AST::QueryDepth class LogQueryDepth < GraphQL::Analysis::AST::QueryDepth