chore(sentry): Add environment config option#1890
Conversation
jjbayer
left a comment
There was a problem hiding this comment.
Two questions, but they are not blockers.
| pub enabled: bool, | ||
|
|
||
| /// Sets the environment for this service. | ||
| pub environment: Option<Cow<'static, str>>, |
There was a problem hiding this comment.
Why is this a Cow? Is there a use case where we generate SentryConfig with a static string?
There was a problem hiding this comment.
That's basically because sentry-rust has this type for environment in ClientOptions and I did not want to mess with it.
Do you think we should change to something else? What would you propose?
There was a problem hiding this comment.
OK, that makes sense, all good then. I would have expected a String here and wondered where the Cow came from. I guess with Cow you could even deserialize without owning, although we don't do that for configs AFAIK.
| in_app_include: vec!["relay"], | ||
| release: Some(RELEASE.into()), | ||
| attach_stacktrace: config.enable_backtraces, | ||
| environment: sentry.environment.clone(), |
There was a problem hiding this comment.
Probably more a question for the SDK, but what happens when both SENTRY_ENVIRONMENT and environment are set?
There was a problem hiding this comment.
This will behave like sentry-rust SDK behaves, and according to this part the env will be used when there is nothing set in the config options.
* master: doc(py): Add changelog entries (#1900) fix(build): Run check when PR is ready for review (#1899) chore(project_local): Allow to follow symlinks for projects configs (#1891) ref(project): Skip serializing default fields (#1887) chore(build): Run changelog check for draft PRs (#1897) chore(sentry): Add environment config option (#1890) feat(scrubbing): Scrub `span.data.http.query` with default scrubbers (#1889)
This adds the
environmentconfiguration option, which also earlier could be set with env variableSENTRY_ENVIRONMENTto make this a bit more explicit, which environment must be reported to Sentry.fixes #996
#skip-changelog