diff --git a/lib/graphql-hive.rb b/lib/graphql-hive.rb index 51852b0..3e1c49f 100644 --- a/lib/graphql-hive.rb +++ b/lib/graphql-hive.rb @@ -39,7 +39,8 @@ class Hive < GraphQL::Tracing::PlatformTracing report_schema: true, buffer_size: 50, logger: nil, - collect_usage_sampling: 1.0 + collect_usage_sampling: 1.0, + start_by_default: true }.freeze self.platform_keys = { @@ -90,6 +91,14 @@ def initialize(options = {}) if opts[:report_schema] && @@schema send_report_schema(@@schema) end + if opts[:start_by_default] + @logger.warn("Deprecation warning: The default behavior of starting" \ + "the usage reporter thread will be changed in future versions. " \ + "Please set `start_by_default` to `false` and configure the " \ + "GraphQL::Hive to call `on_start` when your server boots. See " \ + "the README for more information.") + @usage_reporter.on_start + end end end