Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add rough draft of configuration options documentation #373

Merged
merged 8 commits into from
Feb 9, 2016
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
275 changes: 275 additions & 0 deletions docs/configuration_options.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,275 @@
# Configuration Reference

<!-- Sub:[TOC] -->

## General Settings

### access_token

**Required**

Sets the access token used to send payloads to rollbar.

Items sent through a given access token arrive in that access token's project
and respect the rate limits set on that access token.

### async_handler

If `config.use_async = true` explicitly sets the function used to send
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The object passed to this option should respond to #call and receive the payload. Examples in lib/rollbar/delay/.

asynchronous payloads to Rollbar. Should be an object that responds to `call`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call => #call.

Not needed if using one of the built in async reporters:

* girl_friday
* sucker_punch
* Sidekiq
* Resque
* threading

### branch

**Default** "master"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at our code I cannot see a default master value for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default is master on the server side.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll toss it anyway.


Name of the checked-out source control branch.

### code_version

A string, up to 40 characters, describing the version of the application code.

Rollbar understands these formats:

* semantic version (i.e. "2.1.12")
* integer (i.e. "45")
* git SHA (i.e. "3da541559918a808c2402bba5012f6c60b27661c")

### custom_data_method

The method to call to gather custom data to send with each rollbar request.

```ruby
def custom_data
return {
:custom => {
:key1 => get_key_one,
:key2 => get_key_two
},
:server => {
:root => '/home/username/www/'
}
}
end
```

### default_logger

**Default** `Logger.new(STDERR)`

What logger to use for printing debugging and informational messages during
operation.

### disable_monkey_patch

**Default** `false`

Disables monkey patching all non-core monkey patches. If you do this you'll
need to manually `use` an appropriate Rollbar middleware.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think this it's well explained? It's true that use is the method used in rack based frameworks but may not be for other libaries/frameworks.

I'd just explain that we disable all the monkey patches and auto-reporting.


Especially useful if you're not using Rails or Sinatra.

### disable_core_monkey_patch

**Default** `false`

Disables our monkey patches in the ruby core. One mandatory monkey patch is left.
Be careful using this option as it may caused unexpected behavior in some situations.

## Delayed Job Monitoring

### delayed_job_enabled

**Default** `true`


Set to false if you have `Delayed` but do not wish to wrap Delayed jobs with a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the name of the library is "delayed_job". and I'd change "wrap Delayed jobs" with just "wrap jobs".

Rollbar notifier.

### report_dj_data

**Default** `true`

Set to `false` to skip automatic reporting of Delayed job data. This can be
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not really true.

If delayed_job_enabled is true we'll rescue the jobs exceptions and send the backtrace information.

When reporting a job exception, if report_dj_data is set to true, we'll send the job details information, not only the exception, backtrace, etc...

The job details information is the queue, the job class name, and different jobs options.

handy if you manually report to Rollbar, or you have another way of catching and
reporting those errors.

### dj_threshold

**Default** 0 (Report *any* errors)

The number of job failures before reporting the failure to Rollbar.

### failover_handlers

An array of backup handlers if the async handlers fail. Each should respond to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be "if the async handler fails" and change call with #call.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Will you teach me English? ;)

`call` and should receive a `payload`.

### filepath

For use with `write_to_file`. Indicates location of the rollbar log file being
tracked by [rollbar-agent](https://github.com/rollbar/rollbar-agent).

### framework

**Default** 'Plain'

Indicates which framework you're using. Common options include 'Rails',
'Sinatra', and 'Rack' to name a few.

### ignored_person_ids

**Default** `[]`

Ids of people whose reports you wish to ignore. Only works in conjunction with a
properly defined `person_method` or `person_id_method`.

### logger

The logger to use *instead of* the default logger. Especially useful in `scope`s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I shouldn't use scope there but just "scope" or "scenarios".

where you wish to send log messages elsewhere.

### payload_options

Extra data to send with the payload.

### person_method

Rails only: A string or symbol giving the name of the method on the controller.
Should return an object with an `id` method, and optionally `username` and
`email` methods.

If not using Rails:

Populate the Rack `person_data` key with a hash containing `:id`, and optionally
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Customers need to populate the key rollbar.person_data not person_data in the Rack environment. It's important emphasize the Rack environment.

`:username` and `:email`.

### person_id_method

Rails only: a string or symbol giving the name of the method on the controller
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not the method on the controller but the method in the user instance found after calling the person_method.

def rollbar_person_data
        user = send(Rollbar.configuration.person_method)
        # include id, username, email if non-empty
        if user
          {
            :id => (user.send(Rollbar.configuration.person_id_method) rescue nil),
            :username => (user.send(Rollbar.configuration.person_username_method) rescue nil),
            :email => (user.send(Rollbar.configuration.person_email_method) rescue nil)
          }
        else
          {}
        end
      rescue NoMethodError, NameError
        {}
      end

which returns the current user's id (a string). Ignored if `person_method`
present.

### person_username_method

Rails only: a string or symbol giving the name of the method on the controller
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

which returns the current user's username. Ignored if `person_id_method` not
present. Ignored if `person_method` present.

### person_email_method

Rails only: a string or symbol giving the name of the method on the controller
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

which returns the current user's email address. Ignored if `person_id_method`
not present. Ignored if `person_method` present.

### populate_empty_backtraces

If you report a `new` exception, but do not `raise` it, the backtraces in Rollbar
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd explain: if you report a manually initialized exception instead of a raised and rescued exception, the backtraces will be empty.

will be empty. Set `populate_empty_backtraces` to `true` to have Rollbar load
the traces before sending them.

### request_timeout

**Default** `3`

Set the request timeout for sending POST data to Rollbar.

### root

Set the server root, all stack frames outside that root are considered
'non-project' frames. Also used to setup Github linking.

### safely

**Default** `false`

When `true` evaluates `custom_data_method` returns `{}` if an error,
otherwise reports the error to Rollbar.

### scrub_fields

Fields to scrub out of the parsed request data. Will scrub from `GET`, `POST`,
url, and several other locations. Does not currently recurse into the full
payload.

### scrub_user

**Default** `true`

Set to false to skip scrubbing user out of the URL.

### scrub_password

Set to false to skip scrubbing password out of the URL.

### user_ip_obfuscator_secret

A string used hash IP addresses when obfuscating them.

### randomize_scrub_length

**Default** `true`

When true randomizes the number of asterisks used to display scrubbed fields.

### uncaught_exception_level

**Default** `error`

Use this field to select a different level for uncaught errors (like `critical`,
or `warning`).

### scrub_headers

**Default** `["Authentication"]`

The headers to scrub.

### sidekiq_threshold

**Default** `0`

The number of job re-tries before reporting an error to Rollbar via Sidekiq.
Ignored unless you've called `use_sidekiq`.

### verify_ssl_peer

**Default** `true`

By default we use `OpenSSL::SSL::VERIFY_PEER` for SSL. Although we don't
recommend changing it, you can disable peer verification in case you experience
SSL connection problems.

### use_async

**Default** `false`

When `true` indicates you wish to send data to Rollbar asynchronously. If
installed, uses `girl_friday`, otherwise defaults to `Threading`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you use the ` characters you should use existing methods, constants, etc...

In ruby Threading is not a constant and doesn't exist in the core library, use Thread instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, didn't know the name of ruby's Thread implementation, just sort of typed stuff in.


### use_eventmachine

**Default** `false`

When `true` indicates you wish to send data to Rollbar with `eventmachine`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EventMachine instead of eventmachine.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forget this, you are referring the gem. It's ok.

Won't work unless `eventmachine` is installed.

### web_base

**Default** `'https://rollbar.com'`

The root of the web app that serves your rollbar data. Unless you're an
enterprise customer this should never change.

### write_to_file

**Default** `false`

If `true` writes all errors to a log file which can be sent with
`rollbar-agent`.