From 15d7142ae948278a0f216aca816b257025503012 Mon Sep 17 00:00:00 2001 From: Arkadii Yakovets Date: Wed, 11 Oct 2023 11:14:35 -0700 Subject: [PATCH] Use STAGE variable for Sentry environment tag --- api/data_refinery_api/settings.py | 4 ++-- common/data_refinery_common/settings.py | 4 ++-- foreman/data_refinery_foreman/settings.py | 4 ++-- workers/data_refinery_workers/settings.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/api/data_refinery_api/settings.py b/api/data_refinery_api/settings.py index d71527c52..8f6209177 100644 --- a/api/data_refinery_api/settings.py +++ b/api/data_refinery_api/settings.py @@ -199,7 +199,7 @@ } APP_NAME = "Refine.bio API" -ENVIRONMENT = get_env_variable_gracefully("ENVIRONMENT") +STAGE = get_env_variable_gracefully("STAGE") SYSTEM_VERSION = get_env_variable_gracefully("SYSTEM_VERSION") # Setting the RAVEN_CONFIG when SENTRY_DSN isn't set will cause the @@ -216,7 +216,7 @@ if SENTRY_DSN: RAVEN_CONFIG = { "dsn": SENTRY_DSN, - "environment": "-".join((ENVIRONMENT, *(APP_NAME.replace(".", "").lower().split()))), + "environment": "-".join((STAGE, *(APP_NAME.replace(".", "").lower().split()))), "release": SYSTEM_VERSION, # Only send 5% of errors for the API, since we aren't going to # be interested in any single one. diff --git a/common/data_refinery_common/settings.py b/common/data_refinery_common/settings.py index 119ce0eba..a2eb34461 100644 --- a/common/data_refinery_common/settings.py +++ b/common/data_refinery_common/settings.py @@ -147,7 +147,7 @@ } APP_NAME = "Refine.bio Common" -ENVIRONMENT = get_env_variable_gracefully("ENVIRONMENT") +STAGE = get_env_variable_gracefully("STAGE") SYSTEM_VERSION = get_env_variable_gracefully("SYSTEM_VERSION") # Setting the RAVEN_CONFIG when SENTRY_DSN isn't set will cause the @@ -164,7 +164,7 @@ if SENTRY_DSN: RAVEN_CONFIG = { "dsn": SENTRY_DSN, - "environment": "-".join((ENVIRONMENT, *(APP_NAME.replace(".", "").lower().split()))), + "environment": "-".join((STAGE, *(APP_NAME.replace(".", "").lower().split()))), "release": SYSTEM_VERSION, } else: diff --git a/foreman/data_refinery_foreman/settings.py b/foreman/data_refinery_foreman/settings.py index 296f8a3a7..e6bd34822 100644 --- a/foreman/data_refinery_foreman/settings.py +++ b/foreman/data_refinery_foreman/settings.py @@ -155,7 +155,7 @@ } APP_NAME = "Refine.bio Foreman" -ENVIRONMENT = get_env_variable_gracefully("ENVIRONMENT") +STAGE = get_env_variable_gracefully("STAGE") SYSTEM_VERSION = get_env_variable_gracefully("SYSTEM_VERSION") @@ -173,7 +173,7 @@ if SENTRY_DSN: RAVEN_CONFIG = { "dsn": SENTRY_DSN, - "environment": "-".join((ENVIRONMENT, *(APP_NAME.replace(".", "").lower().split()))), + "environment": "-".join((STAGE, *(APP_NAME.replace(".", "").lower().split()))), "release": SYSTEM_VERSION, } else: diff --git a/workers/data_refinery_workers/settings.py b/workers/data_refinery_workers/settings.py index 40c0adf9b..47f91b164 100644 --- a/workers/data_refinery_workers/settings.py +++ b/workers/data_refinery_workers/settings.py @@ -132,7 +132,7 @@ STATIC_URL = "/static/" APP_NAME = "Refine.bio Workers" -ENVIRONMENT = get_env_variable_gracefully("ENVIRONMENT") +STAGE = get_env_variable_gracefully("STAGE") SYSTEM_VERSION = get_env_variable_gracefully("SYSTEM_VERSION") # Setting the RAVEN_CONFIG when SENTRY_DSN isn't set will cause the @@ -149,7 +149,7 @@ if SENTRY_DSN: RAVEN_CONFIG = { "dsn": SENTRY_DSN, - "environment": "-".join((ENVIRONMENT, *(APP_NAME.replace(".", "").lower().split()))), + "environment": "-".join((STAGE, *(APP_NAME.replace(".", "").lower().split()))), "release": SYSTEM_VERSION, } else: