lib/ldclient-rb/config.rb in launchdarkly-server-sdk-8.5.0 vs lib/ldclient-rb/config.rb in launchdarkly-server-sdk-8.6.0
- old
+ new
@@ -41,10 +41,11 @@
# @option opts [String] :wrapper_version See {#wrapper_version}.
# @option opts [#open] :socket_factory See {#socket_factory}.
# @option opts [BigSegmentsConfig] :big_segments See {#big_segments}.
# @option opts [Hash] :application See {#application}
# @option opts [String] :payload_filter_key See {#payload_filter_key}
+ # @option opts [Boolean] :omit_anonymous_contexts See {#omit_anonymous_contexts}
# @option hooks [Array<Interfaces::Hooks::Hook]
#
def initialize(opts = {})
@base_uri = (opts[:base_uri] || Config.default_base_uri).chomp("/")
@stream_uri = (opts[:stream_uri] || Config.default_stream_uri).chomp("/")
@@ -75,10 +76,11 @@
@socket_factory = opts[:socket_factory]
@big_segments = opts[:big_segments] || BigSegmentsConfig.new(store: nil)
@application = LaunchDarkly::Impl::Util.validate_application_info(opts[:application] || {}, @logger)
@payload_filter_key = opts[:payload_filter_key]
@hooks = (opts[:hooks] || []).keep_if { |hook| hook.is_a? Interfaces::Hooks::Hook }
+ @omit_anonymous_contexts = opts.has_key?(:omit_anonymous_contexts) && opts[:omit_anonymous_contexts]
@data_source_update_sink = nil
end
#
# Returns the component that allows a data source to push data into the SDK.
@@ -382,9 +384,18 @@
# LaunchDarkly provides integration packages, and most applications will not
# need to implement their own hooks. Refer to the `launchdarkly-server-sdk-otel` gem
# for instrumentation.
#
attr_reader :hooks
+
+ #
+ # Sets whether anonymous contexts should be omitted from index and identify events.
+ #
+ # The default value is false. Anonymous contexts will be included in index and identify events.
+ # @return [Boolean]
+ #
+ attr_reader :omit_anonymous_contexts
+
#
# The default LaunchDarkly client configuration. This configuration sets
# reasonable defaults for most users.
# @return [Config] The default LaunchDarkly configuration.