Regex/glob support in prefixes configuration
Problem Statement
For our projects we use atomic/zero-downtime deployments, meaning the location of the code changes. E.g:
- /path/to/project/releases/16
- /path/to/project/releases/17
- /path/to/project/releases/18
Right now this would require us to update the prefixes config every time
Solution Brainstorm
What would really help here would be to allow regexes in the prefix config, allowing us to go from
[
'prefixes' => [
'/path/to/project/releases/16'/,
'/path/to/project/releases/17'/,
'/path/to/project/releases/18/',
]
]
to
[
'prefixes' => [
'/path/to/project/releases/[0-9]+/', // regex
'/path/to/project/releases/*/', // or Glob
]
]
(due to paths already starting and ending with /, implementing globs might be an easier solution)
Couldn't you fix this programmatically, by passing the current dir to Sentry when initializing it? Sentry-symfony does this by getting the project_dir parameter from the framework.
This should be able to be resolved at runtime, frameworks handle this by a project_dir helper or BASE_PATH constant or something similar. We'd rather not introduce advanced processing on this option that is uses quite a number of times during event processing.