From 2222da51fa09bb97a1c8cc5bdf88f3928b9e0cb7 Mon Sep 17 00:00:00 2001 From: Adimanv Date: Wed, 18 Sep 2024 14:02:09 +0530 Subject: [PATCH 1/3] Minro sentry update to the existing code --- pvnet_app/app.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pvnet_app/app.py b/pvnet_app/app.py index 9ae4844..ad38c11 100644 --- a/pvnet_app/app.py +++ b/pvnet_app/app.py @@ -28,7 +28,7 @@ from ocf_datapipes.batch import batch_to_tensor, copy_batch_to_device from pvnet.models.base_model import BaseModel as PVNetBaseModel import sentry_sdk - +import structlog import pvnet_app from pvnet_app.data.nwp import download_all_nwp_data, preprocess_nwp_data @@ -48,13 +48,16 @@ # sentry +sentry_sdk.set_tag("app_name", "pvnet_app") +sentry_sdk.set_tag("version", pvnet_app.__version__) + +log = structlog.stdlib.get_logger() + sentry_sdk.init( - dsn=os.getenv("SENTRY_DSN", ""), - environment=f'{os.getenv("ENVIRONMENT", "local")}', - traces_sample_rate=1.0, - profiles_sample_rate=1.0, + dsn=os.getenv("SENTRY_DSN"), + environment=os.getenv("ENVIRONMENT", "local"), + traces_sample_rate=1 ) -sentry_sdk.set_tag("app_name", "pvnet_app") # --------------------------------------------------------------------------- # GLOBAL SETTINGS From 302baa793f988b7c085af1f92c27361a7a688892 Mon Sep 17 00:00:00 2001 From: Adimanv Date: Thu, 19 Sep 2024 17:08:11 +0530 Subject: [PATCH 2/3] Updates changes --- pvnet_app/app.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pvnet_app/app.py b/pvnet_app/app.py index ad38c11..9d9165f 100644 --- a/pvnet_app/app.py +++ b/pvnet_app/app.py @@ -48,17 +48,15 @@ # sentry -sentry_sdk.set_tag("app_name", "pvnet_app") -sentry_sdk.set_tag("version", pvnet_app.__version__) - -log = structlog.stdlib.get_logger() - sentry_sdk.init( dsn=os.getenv("SENTRY_DSN"), environment=os.getenv("ENVIRONMENT", "local"), traces_sample_rate=1 ) +sentry_sdk.set_tag("app_name", "pvnet_app") +sentry_sdk.set_tag("version", pvnet_app.__version__) + # --------------------------------------------------------------------------- # GLOBAL SETTINGS From 2e36a8726c78b8f8c6f30adec337d55fff8e0ca6 Mon Sep 17 00:00:00 2001 From: Adimanv Date: Thu, 19 Sep 2024 18:13:22 +0530 Subject: [PATCH 3/3] removed extra import --- pvnet_app/app.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pvnet_app/app.py b/pvnet_app/app.py index 9d9165f..b9a4eac 100644 --- a/pvnet_app/app.py +++ b/pvnet_app/app.py @@ -28,7 +28,6 @@ from ocf_datapipes.batch import batch_to_tensor, copy_batch_to_device from pvnet.models.base_model import BaseModel as PVNetBaseModel import sentry_sdk -import structlog import pvnet_app from pvnet_app.data.nwp import download_all_nwp_data, preprocess_nwp_data