-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
Include staging in the environment naming rules from HostEnvironment #1046
Conversation
While I'm obviously proposing this, I'm actually not entirely happy with the inconsistency with the environment name handling. To be honest, I don't think there should be any manipulation of the hosting environment name even if it is to match the other Sentry SDKs. As a .NET developer, you might know specifically the environment names are "Production", "Development" etc but that alone wouldn't seem weird in Sentry as "production" and "development" - it just looks like you've called I'd be tempted to just have |
I'm happy to merge this change though it's a rather breaking change (not in API but in the data in Sentry though) and ideally we'd only ship this in the next major. While I do agree it sucks to have this Using the .NET SDK outside ASP.NET Core reports Reverting this is probably not something we want to do. @mitsuhiko could comment on the subject as he had strong opinions about having this lowercase. |
Could you please add a changelog entry:
|
Done.
Yeah, I definitely can understand that. I didn't actually notice in the v3 change logs that it did change the case so I was wondering what I did wrong as to why there were two different environment names in my instance - particularly that development and production changed but staging didn't. It was only when I was going to file an issue about it did I find the reference in the issues & change log - then I decided to open this PR instead.
Yeah, that would also suck. What I'm thinking is actually going further for consistency by replacing this entire section: With this: options.Environment = _hostingEnvironment.EnvironmentName.ToLower(); While my PR here makes the 3 "default" environments all be lower case, it would be more consistent to have all environment names from the hosting environment be lower case. |
The staging environment is also built into the framework and thus should be treated the same way as both production and development environments. Other custom environments can still be treated as-is.
5467406
to
93f47b9
Compare
Continues on from where #551 / #554 left off with the environment naming. Like "Production" and "Development", the environment "Staging" is built into the framework. For consistency, I think it is important that all 3 of these built-in names perform the same way.
Additionally, I've switched to use the extension methods to check the environment names. Logically they would perform the same action but it is the "standard" way of checking the environments.