getsentry / sentry-javascript-bundler-plugins

JavaScript Bundler Plugins for Sentry
https://sentry.io
BSD 3-Clause "New" or "Revised" License
141 stars 36 forks source link

[Help]: Change project release details for uploaded sourcemaps #534

Closed jd-carroll closed 5 months ago

jd-carroll commented 6 months ago

We have 100+ lambda functions we are bring on to Sentry for monitoring and then eventually using metrics 🎊

I've just wrapped up the majority of the integration and I'm looking through the "releases" on Sentry, which look like:

image

Under Project Release Details there is a Package field which is empty. Is there a way to add a "package" name? (I didn't see an option under release for the esbuild plugin.)

My objective is to clearly show the lambda function name so that it is easy to know which lambda we are working with. Ideally, there would be a way to have the lambda function name (package name?) and the separately have a version (version?).

Additionally, is there a length limitation for the Version? If there is no way to provide a "Package" name, then I can cannibalize the package name to use the format: ${lambdaName}_${version}_${gitSha}

Lms24 commented 6 months ago

Hey @jd-carroll it took me a minute to find the respective documentation for this but you can set the package name by specifying it in the release.name option in a specific format (see docs here)

Additionally, is there a length limitation for the Version? If there is no way to provide a "Package" name, then I can cannibalize the package name to use the format: ${lambdaName}${version}${gitSha}

~I'm not sure about a length limit~ The release name cannot exceed 200 characters, as stated in docs. Generally, I'd recommend trying this format to get all three parts in but you might need to adjust depending on the length:

release: {
  name: '${lambdaName}@${version}+${gitSha}'
}

Note: The code above assumes that you set the release in the esbuild plugin and not in the SDK Sentry.init option or the SENTRY_RELEASE environment variable. You can use any of those but they'll overwrite each other if you set them in multiple places.

Let me know if this works for you!

jd-carroll commented 5 months ago

Thank you, I had missed that "cannot" section