My company is looking to move their product to use Sentry, and I am in charge with figuring out all the moving pieces. Our front-end code spits out the sourcemaps and uploads them to Sentry using the sentry-cli. The big problem is that we don’t host a centralized application, but host many instances of it. This means our URL prefix is unknown at build and deploy time.
I have sourcemaps working correctly if I hard-code a known url-prefix like this:
npx sentry-cli releases files 1.0.0 upload-sourcemaps ./my-app --rewrite --url-prefix "~/dynamic-prefix/known-path"
And this works great and correctly shows the stack trace using the sourcemaps on a test site. But in production, that first part of the URL (what I have as dynamic-prefix) is a Tomcat context, and therefore not known until the app is hosted.
So my question is, is there any way to either wildcard part of the URL, or somehow get Sentry to recognize the sourcemaps when that first part of the URL is unknown?