Increase sample rate for Sentry and introduce ENV variable

This commit is contained in:
Sebastian Serth
2023-02-09 19:32:03 +01:00
parent 379edbc12c
commit 750c59ca6a
2 changed files with 3 additions and 2 deletions

View File

@ -30,10 +30,10 @@ Sentry.init do |config|
when '/', '/ping' when '/', '/ping'
0.00 # ignore health check 0.00 # ignore health check
else else
0.01 ENV.fetch('SENTRY_TRACE_SAMPLE_RATE', 1.0).to_f
end end
else else
0.0 # ignore all other transactions ENV.fetch('SENTRY_TRACE_SAMPLE_RATE', 1.0).to_f # sample all other transactions
end end
end end
end end

View File

@ -9,6 +9,7 @@ The following environment variables are specifically support in CodeOcean and ar
| `SENTRY_DSN` | ` ` | Specifies the [Sentry error reporting](https://sentry.io) endpoint for the Rails server | | `SENTRY_DSN` | ` ` | Specifies the [Sentry error reporting](https://sentry.io) endpoint for the Rails server |
| `SENTRY_JAVASCRIPT_DSN` | ` ` | Specifies the [Sentry error reporting](https://sentry.io) endpoint for the frontend used by browsers | | `SENTRY_JAVASCRIPT_DSN` | ` ` | Specifies the [Sentry error reporting](https://sentry.io) endpoint for the frontend used by browsers |
| `SENTRY_CURRENT_ENV` | ` ` | Specifies the [Sentry](https://sentry.io) environment used for error reporting | | `SENTRY_CURRENT_ENV` | ` ` | Specifies the [Sentry](https://sentry.io) environment used for error reporting |
| `SENTRY_TRACE_SAMPLE_RATE` | `1.0` | Specifies the sampling rate for traces in [Sentry](https://sentry.io) |
| `RAILS_LOG_LEVEL` | `info` in production<br>`debug` in development | Specifies how many log messages to print. The available log levels are: `debug`, `info`, `warn`, `error`, `fatal`, and `unknown`. | | `RAILS_LOG_LEVEL` | `info` in production<br>`debug` in development | Specifies how many log messages to print. The available log levels are: `debug`, `info`, `warn`, `error`, `fatal`, and `unknown`. |
| `RAILS_LOG_TO_STDOUT` | `false` in `production` | Enables the server to print log output to the command line | | `RAILS_LOG_TO_STDOUT` | `false` in `production` | Enables the server to print log output to the command line |
| `RAILS_SERVE_STATIC_FILES` | `true` in `development` and `test`<br>`false` in `production` and `staging` | Specifies whether the Rails server should be able to handle requests for non-dynamic resources (e.g., assets) | | `RAILS_SERVE_STATIC_FILES` | `true` in `development` and `test`<br>`false` in `production` and `staging` | Specifies whether the Rails server should be able to handle requests for non-dynamic resources (e.g., assets) |