You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updates Sentry.Sources to support multiple source code root paths
Before the changes in this commit Sentry.Sources only looked for source
code files in one root path, the `:root_source_code_path`.
With the changes in this commit this module will now be able to look for
source code in multiple paths. The paths can be configured in the
`:root_source_code_paths` config key.
This change is specially important for umbrella applications [1], that
have their code nested in the `apps` path. If we don't specify the root
path for each individual application (which isn't possible without the
changes in this commit), and instead just use `File.cwd!()` as the root
path, the source code files of each umbrella app will be loaded with
`apps/<app name>` prefix in their name. This is a problem because these
names will never match the file names in the stacktrace, which means
that Sentry won't be able to attach source code context.
To avoid a configuration breaking change, the changes in this commit
still support the `:root_source_code_path` configuration key, but "soft
deprecate" it by removing it from documentation. This config key should
be fully deprecated in the next major Sentry release.
[1] https://elixir-lang.org/getting-started/mix-otp/dependencies-and-umbrella-projects.html
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -139,7 +139,7 @@ config :sentry,
139
139
environment_name:Mix.env(),
140
140
included_environments: [:prod],
141
141
enable_source_code_context:true,
142
-
root_source_code_path:File.cwd!()
142
+
root_source_code_paths: [File.cwd!()]
143
143
```
144
144
145
145
The `environment_name` and `included_environments` work together to determine
@@ -169,7 +169,7 @@ The full range of options is the following:
169
169
|`in_app_module_whitelist`| False |`[]`||
170
170
|`report_deps`| False | True | Will attempt to load Mix dependencies at compile time to report alongside events |
171
171
|`enable_source_code_context`| False | False ||
172
-
|`root_source_code_path`| Required if `enable_source_code_context` is enabled || Should generally be set to `File.cwd!()`|
172
+
|`root_source_code_paths`| Required if `enable_source_code_context` is enabled || Should usually be set to `[File.cwd!()]`. For umbrella applications you should list all your applications paths in this list (e.g. `["#{File.cwd!()}/apps/app_1", "#{File.cwd!()}/apps/app_2"]`. |
0 commit comments