add SPIFFWORKFLOW_BACKEND_SENTRY_ENV_IDENTIFIER config

This commit is contained in:
burnettk 2023-03-21 11:29:14 -04:00
parent 992648f087
commit a1f546ba16
2 changed files with 6 additions and 1 deletions

View File

@ -242,12 +242,16 @@ def configure_sentry(app: flask.app.Flask) -> None:
if sentry_traces_sample_rate is None:
raise Exception("SPIFFWORKFLOW_BACKEND_SENTRY_TRACES_SAMPLE_RATE is not set somehow")
sentry_env_identifier = app.config["ENV_IDENTIFIER"]
if app.config.get("SPIFFWORKFLOW_BACKEND_SENTRY_ENV_IDENTIFIER"):
sentry_env_identifier = app.config.get("SPIFFWORKFLOW_BACKEND_SENTRY_ENV_IDENTIFIER")
sentry_configs = {
"dsn": app.config.get("SPIFFWORKFLOW_BACKEND_SENTRY_DSN"),
"integrations": [
FlaskIntegration(),
],
"environment": app.config["ENV_IDENTIFIER"],
"environment": sentry_env_identifier,
# sample_rate is the errors sample rate. we usually set it to 1 (100%)
# so we get all errors in sentry.
"sample_rate": float(sentry_errors_sample_rate),

View File

@ -88,6 +88,7 @@ SPIFFWORKFLOW_BACKEND_SENTRY_ORGANIZATION_SLUG = environ.get(
"SPIFFWORKFLOW_BACKEND_SENTRY_ORGANIZATION_SLUG", default=None
)
SPIFFWORKFLOW_BACKEND_SENTRY_PROJECT_SLUG = environ.get("SPIFFWORKFLOW_BACKEND_SENTRY_PROJECT_SLUG", default=None)
SPIFFWORKFLOW_BACKEND_SENTRY_ENV_IDENTIFIER = environ.get("SPIFFWORKFLOW_BACKEND_SENTRY_ENV_IDENTIFIER", default=None)
SPIFFWORKFLOW_BACKEND_SENTRY_PROFILING_ENABLED = (
environ.get("SPIFFWORKFLOW_BACKEND_SENTRY_PROFILING_ENABLED", default="false") == "true"
)