module GraphQL::Tracing::MonitorTrace
This module is the basis for Ruby-level integration with third-party monitoring platforms. Platform-specific traces include this module and implement an adapter.
See ActiveSupportNotificationsTrace Integration via ActiveSupport::Notifications, an alternative approach.
Constants
- MODULE_TEMPLATE
Public Class Methods
Source
# File lib/graphql/tracing/monitor_trace.rb, line 136 def self.create_module(monitor_name) if !monitor_name.match?(/[a-z]+/) raise ArgumentError, "monitor name must be [a-z]+, not: #{monitor_name.inspect}" end trace_module = Module.new code = MODULE_TEMPLATE % { monitor: monitor_name, monitor_class: monitor_name.capitalize + "Monitor", } trace_module.module_eval(code, __FILE__, __LINE__ + 5) # rubocop:disable Development/NoEvalCop This is build-time with a validated string trace_module end