{"componentChunkName":"component---src-templates-platform-tsx","path":"/platforms/elixir/configuration/options/","result":{"data":{"file":{"id":"8786e962-9767-5875-8d87-e25d6b9669bf","relativePath":"elixir/configuration/options.mdx","sourceInstanceName":"platforms","childMarkdownRemark":null,"childMdx":{"body":"function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"title\": \"Basic Options\",\n  \"sidebar_order\": 0,\n  \"description\": \"Learn more about how to configure the SDK. These options are set when the SDK is first initialized, passed to the `init()` as an object.\",\n  \"redirect_from\": [\"/clients/elixir/config/\"]\n};\n\nvar makeShortcode = function makeShortcode(name) {\n  return function MDXDefaultShortcode(props) {\n    console.warn(\"Component \" + name + \" was not imported, exported, or provided by MDXProvider as global scope\");\n    return mdx(\"div\", props);\n  };\n};\n\nvar CodeTabs = makeShortcode(\"CodeTabs\");\nvar CodeBlock = makeShortcode(\"CodeBlock\");\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, [\"components\"]);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"Configuration is handled using the standard Elixir configuration.\"), mdx(\"p\", null, \"Simply add configuration to the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \":sentry\"), \" key in the file \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"config/prod.exs\"), \":\"), mdx(\"div\", {\n    \"className\": \"code-tabs-wrapper\"\n  }, mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"elixir\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"elixir\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-elixir\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-elixir\"\n  }), \"config \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token atom symbol\"\n  }), \":sentry\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \",\"), \"\\n  \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token attr-name\"\n  }), \"dsn:\"), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token string\"\n  }), \"\\\"___PUBLIC_DSN___\\\"\"))))))), mdx(\"h3\", {\n    \"id\": \"setup-with-plug-or-phoenix\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h3\"\n  }, {\n    \"href\": \"#setup-with-plug-or-phoenix\",\n    \"aria-label\": \"setup with plug or phoenix permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"Setup with Plug or Phoenix\"), mdx(\"p\", null, \"If using an environment with Plug or Phoenix, add the following to your Plug.Router or Phoenix.Router:\"), mdx(\"div\", {\n    \"className\": \"code-tabs-wrapper\"\n  }, mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"elixir\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"elixir\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-elixir\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-elixir\"\n  }), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token keyword\"\n  }), \"use\"), \" Plug\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \".\"), \"ErrorHandler\\n\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token keyword\"\n  }), \"use\"), \" Sentry\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \".\"), \"Plug\")))))), mdx(\"h3\", {\n    \"id\": \"capture-crashed-process-exceptions\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h3\"\n  }, {\n    \"href\": \"#capture-crashed-process-exceptions\",\n    \"aria-label\": \"capture crashed process exceptions permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"Capture Crashed Process Exceptions\"), mdx(\"p\", null, \"This library comes with an extension to capture all error messages that the Plug handler might not. This is based on \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"https://hexdocs.pm/logger/Logger.html#module-backends\"\n  }), \"Logger.Backend\"), \".\"), mdx(\"p\", null, \"To set this up, add the Sentry backend to your Logger configuration. Example:\"), mdx(\"div\", {\n    \"className\": \"code-tabs-wrapper\"\n  }, mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"elixir\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"elixir\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-elixir\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-elixir\"\n  }), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token comment\"\n  }), \"# config/config.exs\"), \"\\n\\nconfig \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token atom symbol\"\n  }), \":logger\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \",\"), \"\\n  \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token attr-name\"\n  }), \"backends:\"), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"[\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token atom symbol\"\n  }), \":console\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \",\"), \" Sentry\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \".\"), \"LoggerBackend\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"]\"))))))), mdx(\"p\", null, \"The backend can also be configured to capture Logger metadata, which is detailed \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"https://hexdocs.pm/sentry/Sentry.LoggerBackend.html\"\n  }), \"here\"), \".\"), mdx(\"h2\", {\n    \"id\": \"required-settings\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h2\"\n  }, {\n    \"href\": \"#required-settings\",\n    \"aria-label\": \"required settings permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"Required settings\"), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"environment_name\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"The name of the environment, this defaults to the \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \":dev\"), \" environment variable.\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"dsn\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"The DSN provided by Sentry.\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"root_source_code_path\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"This is only required if \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \"enable_source_code_context\"), \" is enabled. Should generally be set to \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \"File.cwd!\"), \".\"))), mdx(\"h2\", {\n    \"id\": \"optional-settings\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h2\"\n  }, {\n    \"href\": \"#optional-settings\",\n    \"aria-label\": \"optional settings permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"Optional settings\"), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"included_environments\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"The list of environments you want to send reports to sentry, this defaults to \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \"[:prod]\"), \".\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"tags\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"The default tags to send with each report.\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"release\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"The release to send to sentry with each report. This defaults to nothing.\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"server_name\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"The name of the server to send with each report. This defaults to nothing.\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"client\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"If you need different functionality for the HTTP client, you can define your own module that implements the \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \"Sentry.HTTPClient\"), \" \", mdx(\"a\", _extends({\n    parentName: \"dd\"\n  }, {\n    \"href\": \"https://elixir-lang.org/getting-started/typespecs-and-behaviours.html#behaviours\"\n  }), mdx(\"inlineCode\", {\n    parentName: \"a\"\n  }, \"behaviour\")), \" and set \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \"client\"), \" to that module. Defaults to \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \"Sentry.HackneyClient\"), \".\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"filter\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"Set this to a module that implements the \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \"Sentry.EventFilter\"), \" \", mdx(\"a\", _extends({\n    parentName: \"dd\"\n  }, {\n    \"href\": \"https://elixir-lang.org/getting-started/typespecs-and-behaviours.html#behaviours\"\n  }), mdx(\"inlineCode\", {\n    parentName: \"a\"\n  }, \"behaviour\")), \" if you would like to prevent certain exceptions from being sent. See below for further documentation. Defaults to excluding exceptions from \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \"Sentry.PlugCapture\"), \" that match route not found exceptions from Phoenix and Plug.\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"hackney_pool_max_connections\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"Number of connections for Sentry's hackney pool. This defaults to 50.\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"hackney_pool_timeout\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"Timeout for Sentry's hackney pool. This defaults to 5000 milliseconds.\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"hackney_opts\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"Sentry starts its own hackney pool named \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \":sentry_pool\"), \", and defaults to using it. Hackney's \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \"pool\"), \" configuration as well others like proxy or response timeout can be set through this configuration as it is passed directly to hackney when making a request.\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"before_send_event\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"This option allows performing operations on the event before it is sent by \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \"Sentry.Client\"), \". Accepts an anonymous function or a {module, function} tuple, and the event will be passed as the only argument. The function must return the modified event (or \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \"nil\"), \" or \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \"false\"), \" to prevent the event from being sent).\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"after_send_event\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"This option allows performing arbitrary operations after attempting to send an event. Accepts an anonymous function or a {module, function} tuple, and the event will be passed as the first argument, and the result of sending the event will be passed as the second argument.\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"sample_rate\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"The sampling factor to apply to events. A value of 0.0 will deny sending any events, and a value of 1.0 will send 100% of events.\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"in_app_module_whitelist\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"Expects a list of modules that is used to distinguish among stack trace frames that belong to your app and ones that are part of libraries or core Elixir. This is used to better display the significant part of stack traces. The logic is greedy, so if your app's root module is \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \"MyApp\"), \" and your setting is \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \"[MyApp]\"), \", that module as well as any submodules like \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \"MyApp.Submodule\"), \" would be considered part of your app. Defaults to \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \"[]\"), \".\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"report_deps\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"Will attempt to load Mix dependencies at runtime to report alongside events. Defaults to \", mdx(\"em\", {\n    parentName: \"dd\"\n  }, \"true\"), \".\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"enable_source_code_context\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"When true, Sentry will read and store source code files to report the source code that caused an exception.\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"context_lines\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"The number of lines of source code before and after the line that caused the exception to be included. Defaults to \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \"3\"), \".\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"source_code_exclude_patterns\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"A list of Regex expressions used to exclude file paths that should not be stored or referenced when reporting exceptions. Defaults to \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \"[~r\\\"/_build/\\\", ~r\\\"/deps/\\\", ~r\\\"/priv/\\\"]\"), \".\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"source_code_path_pattern\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"A glob that is expanded to select files from the \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \":root_source_code_path\"), \". Defaults to \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \"\\\"**/*.ex\\\"\"), \".\"))), mdx(\"p\", null, mdx(\"dl\", {\n    parentName: \"p\"\n  }, mdx(\"dt\", {\n    parentName: \"dl\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"dt\"\n  }, \"json_library\")), mdx(\"dd\", {\n    parentName: \"dl\"\n  }, \"The JSON library used to encode HTTP requests. Defaults to \", mdx(\"inlineCode\", {\n    parentName: \"dd\"\n  }, \"Jason\"), \".\"))), mdx(\"p\", null, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"log_level\"), \"\\n: This sets the log level used when Sentry fails to send an event due to an invalid event or API error. Defaults to \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \":warn\"), \".\"), mdx(\"h2\", {\n    \"id\": \"testing-your-configuration\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h2\"\n  }, {\n    \"href\": \"#testing-your-configuration\",\n    \"aria-label\": \"testing your configuration permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"Testing Your Configuration\"), mdx(\"p\", null, \"To ensure you've set up your configuration correctly, we recommend running the included mix task. It can be tested on different Mix environments and will tell you if it is not currently configured to send events in that environment:\"), mdx(\"div\", {\n    \"className\": \"code-tabs-wrapper\"\n  }, mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"bash\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"bash\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-bash\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token assign-left variable\"\n  }), \"MIX_ENV\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \"=\"), \"dev mix sentry.send_test_event\\nClient configuration:\\nserver: https://sentry.io/\\npublic_key: public\\nsecret_key: secret\\nincluded_environments: \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"[\"), \":prod, :staging\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"]\"), \"\\ncurrent environment_name: :dev\\n\\n:dev is not \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token keyword\"\n  }), \"in\"), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"[\"), \":prod, :staging\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"]\"), \" so no \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token builtin class-name\"\n  }), \"test\"), \" event will be sent\\n\\n\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token assign-left variable\"\n  }), \"MIX_ENV\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \"=\"), \"prod mix sentry.send_test_event\\nClient configuration:\\nserver: https://sentry.io/\\npublic_key: public\\nsecret_key: secret\\nincluded_environments: \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"[\"), \":prod\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"]\"), \"\\ncurrent environment_name: :prod\\n\\nSending \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token builtin class-name\"\n  }), \"test\"), \" event\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \"!\"))))))));\n}\n;\nMDXContent.isMDXComponent = true;","tableOfContents":{"items":[{"items":[{"url":"#setup-with-plug-or-phoenix","title":"Setup with Plug or Phoenix"},{"url":"#capture-crashed-process-exceptions","title":"Capture Crashed Process Exceptions"}]},{"url":"#required-settings","title":"Required settings"},{"url":"#optional-settings","title":"Optional settings"},{"url":"#testing-your-configuration","title":"Testing Your Configuration"}]},"internal":{"type":"Mdx"}}}},"pageContext":{"excerpt":"Configuration is handled using the standard Elixir configuration. Simply add configuration to the  :sentry  key in the file  config/prod.exs : Setup with Plug or Phoenix If using an environment with Plug or Phoenix, add the following to your Plug.Router or Phoenix.Router: Capture Crashed Process Exceptions This library comes with an extension to capture all error messages that the Plug handler might not. This is based on  Logger.Backend . To set this up, add the Sentry backend to your Logger configuration. Example: The backend can also be configured to capture Logger metadata, which is detailed  here . Required settings environment_name : The name of the environment, this defaults to the  :dev  environment variable. dsn : The DSN provided by Sentry. root_source_code_path : This is only required if  enable_source_code_context  is enabled. Should generally be set to  File.cwd! . Optional settings included_environments : The list of environments you want to send reports to sentry, this defaults to  [:prod] . tags : The default tags to send with each report. release : The release to send to sentry with each report. This defaults to nothing. server_name : The name of the server to send with each report. This defaults to nothing. client : If you need different functionality for the HTTP client, you can define your own module that implements the  Sentry.HTTPClient   behaviour  and set  client  to that module. Defaults to  Sentry.HackneyClient . filter : Set this to a module that implements the  Sentry.EventFilter   behaviour  if you would like to prevent certain exceptions from being sent. See below for further documentation. Defaults to excluding exceptions from  Sentry.PlugCapture  that match route not found exceptions from Phoenix and Plug. hackney_pool_max_connections : Number of connections for Sentry's hackney pool. This defaults to 50. hackney_pool_timeout : Timeout for Sentry's hackney pool. This defaults to 5000 milliseconds. hackney_opts : Sentry starts its own hackney pool named  :sentry_pool , and defaults to using it. Hackney's  pool  configuration as well others like proxy or response timeout can be set through this configuration as it is passed directly to hackney when making a request. before_send_event : This option allows performing operations on the event before it is sent by  Sentry.Client . Accepts an anonymous function or a {module, function} tuple, and the event will be passed as the only argument. The function must return the modified event (or  nil  or  false  to prevent the event from being sent). after_send_event : This option allows performing arbitrary operations after attempting to send an event. Accepts an anonymous function or a {module, function} tuple, and the event will be passed as the first argument, and the result of sending the event will be passed as the second argument. sample_rate : The sampling factor to apply to events. A value of 0.0 will deny sending any events, and a value of 1.0 will send 100% of events. in_app_module_whitelist : Expects a list of modules that is used to distinguish among stack trace frames that belong to your app and ones that are part of libraries or core Elixir. This is used to better display the significant part of stack traces. The logic is greedy, so if your app's root module is  MyApp  and your setting is  [MyApp] , that module as well as any submodules like  MyApp.Submodule  would be considered part of your app. Defaults to  [] . report_deps : Will attempt to load Mix dependencies at runtime to report alongside events. Defaults to  true . enable_source_code_context : When true, Sentry will read and store source code files to report the source code that caused an exception. context_lines : The number of lines of source code before and after the line that caused the exception to be included. Defaults to  3 . source_code_exclude_patterns : A list of Regex expressions used to exclude file paths that should not be stored or referenced when reporting exceptions. Defaults to  [~r\"/_build/\", ~r\"/deps/\", ~r\"/priv/\"] . source_code_path_pattern : A glob that is expanded to select files from the  :root_source_code_path . Defaults to  \"**/*.ex\" . json_library : The JSON library used to encode HTTP requests. Defaults to  Jason . log_level \n: This sets the log level used when Sentry fails to send an event due to an invalid event or API error. Defaults to  :warn . Testing Your Configuration To ensure you've set up your configuration correctly, we recommend running the included mix task. It can be tested on different Mix environments and will tell you if it is not currently configured to send events in that environment:","title":"Basic Options","description":"Learn more about how to configure the SDK. These options are set when the SDK is first initialized, passed to the `init()` as an object.","redirect_from":["/clients/elixir/config/"],"platform":{"name":"elixir","title":"Elixir"},"id":"8786e962-9767-5875-8d87-e25d6b9669bf"}},"staticQueryHashes":["1218203755","1222113826","1222113826","1766336459","2158593473","2404336828","2472290386","2764967025","3818502851","4015007367","4192517163","4264099332","518019976"]}