Class: Sentiero::Configuration
- Inherits:
-
Object
- Object
- Sentiero::Configuration
- Defined in:
- lib/sentiero/configuration.rb
Constant Summary collapse
- ENFORCED_PRIVACY =
{ maskInputOptions: {password: true} }.freeze
- DEFAULT_SESSION_IDLE_TIMEOUT =
Replay sessions follow a user journey, so the idle boundary is generous (a lunch break shouldn't split a journey); max age is the hard cap that keeps the identifier from living forever on never-idle tabs.
6 * 60 * 60
- DEFAULT_SESSION_MAX_AGE =
7 * 24 * 60 * 60
Instance Attribute Summary collapse
-
#allow_insecure_dashboard ⇒ Object
Returns the value of attribute allow_insecure_dashboard.
-
#analytics_max_scan_sessions ⇒ Object
Returns the value of attribute analytics_max_scan_sessions.
-
#anonymize_ip ⇒ Object
Returns the value of attribute anonymize_ip.
-
#audit_log ⇒ Object
Returns the value of attribute audit_log.
-
#auth_callback ⇒ Object
Returns the value of attribute auth_callback.
-
#basic_auth ⇒ Object
Returns the value of attribute basic_auth.
-
#block_selector ⇒ Object
Returns the value of attribute block_selector.
-
#capture_clicks ⇒ Object
Returns the value of attribute capture_clicks.
-
#capture_errors ⇒ Object
Returns the value of attribute capture_errors.
-
#capture_metadata ⇒ Object
Returns the value of attribute capture_metadata.
-
#capture_web_vitals ⇒ Object
Returns the value of attribute capture_web_vitals.
-
#checkout_every_n_ms ⇒ Object
Returns the value of attribute checkout_every_n_ms.
-
#cors_origins ⇒ Object
Returns the value of attribute cors_origins.
-
#cross_tab_sessions ⇒ Object
Returns the value of attribute cross_tab_sessions.
-
#flush_event_threshold ⇒ Object
Returns the value of attribute flush_event_threshold.
-
#flush_interval_ms ⇒ Object
Returns the value of attribute flush_interval_ms.
-
#ignore_selector ⇒ Object
Returns the value of attribute ignore_selector.
-
#ingest_keys ⇒ Object
Returns the value of attribute ingest_keys.
-
#inline_stylesheet ⇒ Object
Returns the value of attribute inline_stylesheet.
-
#mask_all_inputs ⇒ Object
Returns the value of attribute mask_all_inputs.
-
#mask_input_options ⇒ Object
Returns the value of attribute mask_input_options.
-
#mask_text_selector ⇒ Object
Returns the value of attribute mask_text_selector.
-
#max_events_per_page ⇒ Object
Returns the value of attribute max_events_per_page.
-
#max_events_per_request ⇒ Object
Returns the value of attribute max_events_per_request.
-
#max_events_per_session ⇒ Object
Returns the value of attribute max_events_per_session.
-
#max_problems ⇒ Object
Returns the value of attribute max_problems.
-
#max_server_events ⇒ Object
Returns the value of attribute max_server_events.
-
#max_sessions ⇒ Object
Returns the value of attribute max_sessions.
-
#opt_out_cookie_name ⇒ Object
Returns the value of attribute opt_out_cookie_name.
-
#recorder_options ⇒ Object
Returns the value of attribute recorder_options.
-
#redaction ⇒ Object
Returns the value of attribute redaction.
-
#respect_gpc ⇒ Object
Returns the value of attribute respect_gpc.
-
#retention_period ⇒ Object
Returns the value of attribute retention_period.
-
#sampling ⇒ Object
Returns the value of attribute sampling.
-
#session_idle_timeout ⇒ Object
session_idle_timeout / session_max_age have validating writers below (a bad value here is serialized straight into client-side session-rotation logic), so they're declared separately from the plain attr_accessor list.
-
#session_max_age ⇒ Object
session_idle_timeout / session_max_age have validating writers below (a bad value here is serialized straight into client-side session-rotation logic), so they're declared separately from the plain attr_accessor list.
-
#shareable_replays ⇒ Object
Returns the value of attribute shareable_replays.
-
#store ⇒ Object
Returns the value of attribute store.
-
#track_custom_events ⇒ Object
Returns the value of attribute track_custom_events.
-
#track_forms ⇒ Object
Returns the value of attribute track_forms.
-
#track_navigation ⇒ Object
Returns the value of attribute track_navigation.
-
#user_opt_out ⇒ Object
Returns the value of attribute user_opt_out.
Instance Method Summary collapse
- #effective_recorder_options ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #rails ⇒ Object
-
#reporter ⇒ Object
Reach the Rails / Reporter config from the one core object, e.g.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/sentiero/configuration.rb', line 111 def initialize @store = nil @cors_origins = [] @auth_callback = nil @flush_interval_ms = 10_000 @flush_event_threshold = 50 @max_events_per_page = 1_000 @max_problems = 5_000 @max_server_events = 50_000 @ingest_keys = {} @cross_tab_sessions = true @capture_metadata = false @capture_errors = false @track_navigation = false @track_custom_events = false @capture_clicks = false @track_forms = false @mask_all_inputs = true @mask_input_options = {} @block_selector = "[data-rr-block]" @mask_text_selector = "[data-rr-mask]" @ignore_selector = "[data-rr-ignore]" @sampling = {scroll: 150, input: "last"} @inline_stylesheet = nil @checkout_every_n_ms = nil @recorder_options = {} @capture_web_vitals = false @analytics_max_scan_sessions = 5000 @user_opt_out = false @opt_out_cookie_name = "sentiero_optout" @respect_gpc = true @retention_period = nil @session_idle_timeout = DEFAULT_SESSION_IDLE_TIMEOUT @session_max_age = DEFAULT_SESSION_MAX_AGE @redaction = Sentiero::Redaction::Config.new @anonymize_ip = true @audit_log = nil # Opt-in: a share file is a full session dump leaving the operator's # infrastructure, so export/import routes 404 until explicitly enabled. @shareable_replays = false @basic_auth = nil # The dashboard exposes recordings/analytics, so with neither basic_auth nor # auth_callback set it fails closed (403). Set true to opt into serving it # unauthenticated (e.g. behind a trusted proxy or in local dev). @allow_insecure_dashboard = false end |
Instance Attribute Details
#allow_insecure_dashboard ⇒ Object
Returns the value of attribute allow_insecure_dashboard.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def allow_insecure_dashboard @allow_insecure_dashboard end |
#analytics_max_scan_sessions ⇒ Object
Returns the value of attribute analytics_max_scan_sessions.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def analytics_max_scan_sessions @analytics_max_scan_sessions end |
#anonymize_ip ⇒ Object
Returns the value of attribute anonymize_ip.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def anonymize_ip @anonymize_ip end |
#audit_log ⇒ Object
Returns the value of attribute audit_log.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def audit_log @audit_log end |
#auth_callback ⇒ Object
Returns the value of attribute auth_callback.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def auth_callback @auth_callback end |
#basic_auth ⇒ Object
Returns the value of attribute basic_auth.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def basic_auth @basic_auth end |
#block_selector ⇒ Object
Returns the value of attribute block_selector.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def block_selector @block_selector end |
#capture_clicks ⇒ Object
Returns the value of attribute capture_clicks.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def capture_clicks @capture_clicks end |
#capture_errors ⇒ Object
Returns the value of attribute capture_errors.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def capture_errors @capture_errors end |
#capture_metadata ⇒ Object
Returns the value of attribute capture_metadata.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def @capture_metadata end |
#capture_web_vitals ⇒ Object
Returns the value of attribute capture_web_vitals.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def capture_web_vitals @capture_web_vitals end |
#checkout_every_n_ms ⇒ Object
Returns the value of attribute checkout_every_n_ms.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def checkout_every_n_ms @checkout_every_n_ms end |
#cors_origins ⇒ Object
Returns the value of attribute cors_origins.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def cors_origins @cors_origins end |
#cross_tab_sessions ⇒ Object
Returns the value of attribute cross_tab_sessions.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def cross_tab_sessions @cross_tab_sessions end |
#flush_event_threshold ⇒ Object
Returns the value of attribute flush_event_threshold.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def flush_event_threshold @flush_event_threshold end |
#flush_interval_ms ⇒ Object
Returns the value of attribute flush_interval_ms.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def flush_interval_ms @flush_interval_ms end |
#ignore_selector ⇒ Object
Returns the value of attribute ignore_selector.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def ignore_selector @ignore_selector end |
#ingest_keys ⇒ Object
Returns the value of attribute ingest_keys.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def ingest_keys @ingest_keys end |
#inline_stylesheet ⇒ Object
Returns the value of attribute inline_stylesheet.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def inline_stylesheet @inline_stylesheet end |
#mask_all_inputs ⇒ Object
Returns the value of attribute mask_all_inputs.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def mask_all_inputs @mask_all_inputs end |
#mask_input_options ⇒ Object
Returns the value of attribute mask_input_options.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def @mask_input_options end |
#mask_text_selector ⇒ Object
Returns the value of attribute mask_text_selector.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def mask_text_selector @mask_text_selector end |
#max_events_per_page ⇒ Object
Returns the value of attribute max_events_per_page.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def max_events_per_page @max_events_per_page end |
#max_events_per_request ⇒ Object
Returns the value of attribute max_events_per_request.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def max_events_per_request @max_events_per_request end |
#max_events_per_session ⇒ Object
Returns the value of attribute max_events_per_session.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def max_events_per_session @max_events_per_session end |
#max_problems ⇒ Object
Returns the value of attribute max_problems.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def max_problems @max_problems end |
#max_server_events ⇒ Object
Returns the value of attribute max_server_events.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def max_server_events @max_server_events end |
#max_sessions ⇒ Object
Returns the value of attribute max_sessions.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def max_sessions @max_sessions end |
#opt_out_cookie_name ⇒ Object
Returns the value of attribute opt_out_cookie_name.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def @opt_out_cookie_name end |
#recorder_options ⇒ Object
Returns the value of attribute recorder_options.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def @recorder_options end |
#redaction ⇒ Object
Returns the value of attribute redaction.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def redaction @redaction end |
#respect_gpc ⇒ Object
Returns the value of attribute respect_gpc.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def respect_gpc @respect_gpc end |
#retention_period ⇒ Object
Returns the value of attribute retention_period.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def retention_period @retention_period end |
#sampling ⇒ Object
Returns the value of attribute sampling.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def sampling @sampling end |
#session_idle_timeout ⇒ Object
session_idle_timeout / session_max_age have validating writers below (a bad value here is serialized straight into client-side session-rotation logic), so they're declared separately from the plain attr_accessor list.
55 56 57 |
# File 'lib/sentiero/configuration.rb', line 55 def session_idle_timeout @session_idle_timeout end |
#session_max_age ⇒ Object
session_idle_timeout / session_max_age have validating writers below (a bad value here is serialized straight into client-side session-rotation logic), so they're declared separately from the plain attr_accessor list.
55 56 57 |
# File 'lib/sentiero/configuration.rb', line 55 def session_max_age @session_max_age end |
#shareable_replays ⇒ Object
Returns the value of attribute shareable_replays.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def shareable_replays @shareable_replays end |
#store ⇒ Object
Returns the value of attribute store.
5 6 7 |
# File 'lib/sentiero/configuration.rb', line 5 def store @store end |
#track_custom_events ⇒ Object
Returns the value of attribute track_custom_events.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def track_custom_events @track_custom_events end |
#track_forms ⇒ Object
Returns the value of attribute track_forms.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def track_forms @track_forms end |
#track_navigation ⇒ Object
Returns the value of attribute track_navigation.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def @track_navigation end |
#user_opt_out ⇒ Object
Returns the value of attribute user_opt_out.
7 8 9 |
# File 'lib/sentiero/configuration.rb', line 7 def user_opt_out @user_opt_out end |
Instance Method Details
#effective_recorder_options ⇒ Object
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
# File 'lib/sentiero/configuration.rb', line 160 def first_class = { maskAllInputs: mask_all_inputs, maskInputOptions: , blockSelector: block_selector, maskTextSelector: mask_text_selector, ignoreSelector: ignore_selector, sampling: sampling } first_class[:inlineStylesheet] = inline_stylesheet unless inline_stylesheet.nil? first_class[:checkoutEveryNms] = checkout_every_n_ms unless checkout_every_n_ms.nil? .merge(first_class) .merge(ENFORCED_PRIVACY) { |_key, existing, enforced| if enforced.is_a?(Hash) (existing.is_a?(Hash) ? existing : {}).merge(enforced) else enforced end } end |
#rails ⇒ Object
84 85 86 87 |
# File 'lib/sentiero/configuration.rb', line 84 def rails require_subsystem!("Sentiero::Rails", "the sentiero-rails gem") Rails.configuration end |
#reporter ⇒ Object
Reach the Rails / Reporter config from the one core object, e.g. Sentiero.configure { |c| c.reporter.endpoint = "..." }. They remain separate instances so the reporter stays usable as a standalone client.
79 80 81 82 |
# File 'lib/sentiero/configuration.rb', line 79 def reporter require_subsystem!("Sentiero::Reporter", 'require "sentiero/reporter"') Reporter.configuration end |