|
| 1 | +defmodule Sentry.Config do |
| 2 | + @default_included_environments [:dev, :test, :prod] |
| 3 | + @default_environment_name Mix.env |
| 4 | + @default_max_hackney_connections 50 |
| 5 | + @default_hackney_timeout 5000 |
| 6 | + @default_exclude_patterns [~r"/_build/", ~r"/deps/", ~r"/priv/"] |
| 7 | + @default_path_pattern "**/*.ex" |
| 8 | + @default_context_lines 3 |
| 9 | + @default_sample_rate 1.0 |
| 10 | + |
| 11 | + def validate_config! do |
| 12 | + end |
| 13 | + |
| 14 | + def included_environments do |
| 15 | + Application.get_env(:sentry, :included_environments, @default_included_environments) |
| 16 | + end |
| 17 | + |
| 18 | + def environment_name do |
| 19 | + Application.get_env(:sentry, :environment_name, @default_environment_name) |
| 20 | + end |
| 21 | + |
| 22 | + def max_hackney_connections do |
| 23 | + Application.get_env(:sentry, :hackney_pool_max_connections, @default_max_hackney_connections) |
| 24 | + end |
| 25 | + |
| 26 | + def hackney_timeout do |
| 27 | + Application.get_env(:sentry, :hackney_pool_timeout, @default_hackney_timeout) |
| 28 | + end |
| 29 | + |
| 30 | + def tags do |
| 31 | + Application.get_env(:sentry, :tags, %{}) |
| 32 | + end |
| 33 | + |
| 34 | + def release do |
| 35 | + Application.get_env(:sentry, :release) |
| 36 | + end |
| 37 | + |
| 38 | + def server_name do |
| 39 | + Application.get_env(:sentry, :server_name) |
| 40 | + end |
| 41 | + |
| 42 | + def filter do |
| 43 | + Application.get_env(:sentry, :filter, Sentry.DefaultEventFilter) |
| 44 | + end |
| 45 | + |
| 46 | + def client do |
| 47 | + Application.get_env(:sentry, :client, Sentry.Client) |
| 48 | + end |
| 49 | + |
| 50 | + def use_error_logger do |
| 51 | + Application.get_env(:sentry, :use_error_logger, false) |
| 52 | + end |
| 53 | + |
| 54 | + def root_path do |
| 55 | + Application.fetch_env!(:sentry, :root_source_code_path) |
| 56 | + end |
| 57 | + |
| 58 | + def path_pattern do |
| 59 | + Application.get_env(:sentry, :source_code_path_pattern, @default_path_pattern) |
| 60 | + end |
| 61 | + |
| 62 | + def exclude_patterns do |
| 63 | + Application.get_env(:sentry, :source_code_exclude_patterns, @default_exclude_patterns) |
| 64 | + end |
| 65 | + |
| 66 | + def context_lines do |
| 67 | + Application.get_env(:sentry, :context_lines, @default_context_lines) |
| 68 | + end |
| 69 | + |
| 70 | + def in_app_module_whitelist do |
| 71 | + Application.get_env(:sentry, :in_app_module_whitelist, []) |
| 72 | + end |
| 73 | + |
| 74 | + def sample_rate do |
| 75 | + Application.get_env(:sentry, :sample_rate, @default_sample_rate) |
| 76 | + end |
| 77 | + |
| 78 | + def hackney_opts do |
| 79 | + Application.get_env(:sentry, :hackney_opts, []) |
| 80 | + end |
| 81 | + |
| 82 | + def before_send_event do |
| 83 | + Application.get_env(:sentry, :before_send_event) |
| 84 | + end |
| 85 | + |
| 86 | + def after_send_event do |
| 87 | + Application.get_env(:sentry, :after_send_event) |
| 88 | + end |
| 89 | +end |
0 commit comments