-
-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request: please don't change case of environment #999
Comments
I think that might be because Sentry treats |
The change was added in the last major release and is documented in the migration docs: https://docs.sentry.io/platforms/dotnet/migration/#environment-casing That said, sorry for the inconvenience. This was discussed internally and since all Sentry SDKs send We could add an opt-out for this behavior to the |
Sure thing. I'm not precious about the PR, so feel free to throw it away if you reconsider the suggestion above. I think probably a better option that would have avoided all of this would be to have the environment names be case insensitive when showing in the UI or selecting/specifying in the SDKs. Is it really a valid use to want to have separate Production and production environments? In addition, you could lowercase the supplied Environment and use it as an ID, then add an option in the UI to specify whatever name someone wants to give it. That might be going a bit overboard. |
It's available on the latest preview: https://github.com/getsentry/sentry-dotnet/releases/tag/3.6.0-alpha.2 |
In the .NET SDK, Sentry will change the case of the environment if the IHostingEnvironment.EnviromentName matches either "Production" or "Development". Any other environment names will not be changed.
sentry-dotnet/src/Sentry.AspNetCore/SentryAspNetCoreOptionsSetup.cs
Lines 39 to 56 in a9304a0
I find this pretty strange, unexpected behaviour. I am migrating from .NET Framework to .NET Core and in so doing, want to stop explicitly specifying the environment and rely on the value specified in IHostingEnvironment. If I do this, due to this case change, I will then have the following environments listed in Sentry:
I can hide the unused environments though this could cause problems viewing older issues. It's also a bit frustrating that the casing on my environments is no longer consistent (considering the Test environment). I admit these are minor inconveniences and I can just explicitly specify the environment to avoid this, but they are frustrations all the same. I can't think of a good reason why this undocumented behaviour exists and think generally it's best to display environments as they have been specified by the developer/framework.
The comment says that Sentry prefers lowercase environment names (though I haven't seen this echoed in the documentation). Is there any reason for this preference?
The text was updated successfully, but these errors were encountered: