The Bearer Agent allows you to update the configuration in your code using the following syntax after installing and requiring the
Bearer.init_config do |config|config.secret_key = "YOUR_BEARER_SECRET_KEY" # Required, string: Your Bearer private keyconfig.disabled = false # Optional, boolean: enable/disable Bearer globallyend
The following is a list of all available configuration options.
Your Bearer Secret Key (required)
When set, the Bearer agent is disabled
Sets the name of the environment to be used in the dashboard. See below for details.
Remove sensitive data before sending it to bearer.sh (defaults to
Regular expression used for key name values to strip (see defaults)
Regular expression used for value stripping (see defaults)
Sets the max recursive attempts the hook method will make. Learn more below. (defaults to 10)
For more on using the
strip_sensitive_regex configuration properties see Keep your Data Protected.
Bearer uses your application's environment variable or the configuration to determine the environments that exist for an application in the Bearer Dashboard. For Ruby, Bearer will look for any of the following environment variables to determine the name:
config.environment is set in your agent configuration, it will override any of the above ENV names. If no environment name can be detected through environment variables or the configuration, the environment will be set to
The Bearer Agent intercepts HTTP request by hooking into the HTTP clients your application uses. This is done by replacing the HTTP methods with instrumented versions that handle its internal logic, then call the original method. When combined with some gems that use a similar approach, you may experience a
BearerAgent::Interceptor::ConflictDetector::Error exception type. Hook mode helps alleviate and avoid this problem. You can read our full explaination into why this happens and the steps we've taken to resolve it over on our engineering blog, but for most users changing to the alternative mode (to
:alias from the default
:prepend ) should resolve any issues.
hook_conflict_detection_max_depth setting can help if you're experiencing too many recursive retries. This shouldn't be necessary for most users, but if you're experiencing too many stack traces when a conflict error is raised, changing this value should help resolve the problem.