From 4d40472fd1d52dfb5b378de6ce9a029cbbe3d89a Mon Sep 17 00:00:00 2001 From: Abderrahim AZIME Date: Tue, 12 Sep 2023 11:12:16 +0200 Subject: [PATCH 1/2] Jormungandr: deployment az suffix added --- source/jormungandr/jormungandr/default_settings.py | 1 + source/jormungandr/jormungandr/new_relic.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/source/jormungandr/jormungandr/default_settings.py b/source/jormungandr/jormungandr/default_settings.py index 0740db5926..b2415db2c0 100644 --- a/source/jormungandr/jormungandr/default_settings.py +++ b/source/jormungandr/jormungandr/default_settings.py @@ -259,3 +259,4 @@ BEST_BOARDING_POSITIONS_DIR = os.getenv('JORMUNGANDR_BEST_BOARDING_POSITIONS_DIR', None) ORIGIN_DESTINATION_DIR = os.getenv('JORMUNGANDR_ORIGIN_DESTINATION_DIR', None) STOP_POINTS_ATTRACTIVITIES_DIR = os.getenv('JORMUNGANDR_STOP_POINTS_ATTRACTIVITIES_DIR', None) +DEPLOYMENT_AZ_SUFFIX = os.getenv('JORMUNGANDR_DEPLOYMENT_AZ_SUFFIX', "unknown") diff --git a/source/jormungandr/jormungandr/new_relic.py b/source/jormungandr/jormungandr/new_relic.py index 81f44af4eb..a9627727b1 100644 --- a/source/jormungandr/jormungandr/new_relic.py +++ b/source/jormungandr/jormungandr/new_relic.py @@ -35,6 +35,7 @@ import functools from typing import Text, Callable from contextlib import contextmanager +from jormungandr import app try: from newrelic import agent @@ -133,6 +134,7 @@ def wrapper(obj, service, *args, **kwargs): "call": call_name, "group": group_name, "status": "ok", + "az_suffix": app.config.get("DEPLOYMENT_AZ_SUFFIX", "unknown"), } start_time = timeit.default_timer() @@ -171,6 +173,7 @@ def record_streetnetwork_call(call_name, connector_name, mode, coverage_name): "mode": mode, "coverage": coverage_name, "status": "ok", + "az_suffix": app.config.get("DEPLOYMENT_AZ_SUFFIX", "unknown"), } start_time = timeit.default_timer() try: From 525f6d5b2ee1395a106d0e237e5f0146cdb8d03f Mon Sep 17 00:00:00 2001 From: Abderrahim AZIME Date: Tue, 12 Sep 2023 16:03:25 +0200 Subject: [PATCH 2/2] correction --- source/jormungandr/jormungandr/default_settings.py | 2 +- source/jormungandr/jormungandr/new_relic.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/jormungandr/jormungandr/default_settings.py b/source/jormungandr/jormungandr/default_settings.py index b2415db2c0..1176f55ba2 100644 --- a/source/jormungandr/jormungandr/default_settings.py +++ b/source/jormungandr/jormungandr/default_settings.py @@ -259,4 +259,4 @@ BEST_BOARDING_POSITIONS_DIR = os.getenv('JORMUNGANDR_BEST_BOARDING_POSITIONS_DIR', None) ORIGIN_DESTINATION_DIR = os.getenv('JORMUNGANDR_ORIGIN_DESTINATION_DIR', None) STOP_POINTS_ATTRACTIVITIES_DIR = os.getenv('JORMUNGANDR_STOP_POINTS_ATTRACTIVITIES_DIR', None) -DEPLOYMENT_AZ_SUFFIX = os.getenv('JORMUNGANDR_DEPLOYMENT_AZ_SUFFIX', "unknown") +DEPLOYMENT_AZ = os.getenv('JORMUNGANDR_DEPLOYMENT_AZ', "unknown") diff --git a/source/jormungandr/jormungandr/new_relic.py b/source/jormungandr/jormungandr/new_relic.py index a9627727b1..b401e26f7e 100644 --- a/source/jormungandr/jormungandr/new_relic.py +++ b/source/jormungandr/jormungandr/new_relic.py @@ -134,7 +134,7 @@ def wrapper(obj, service, *args, **kwargs): "call": call_name, "group": group_name, "status": "ok", - "az_suffix": app.config.get("DEPLOYMENT_AZ_SUFFIX", "unknown"), + "az": app.config.get("DEPLOYMENT_AZ", "unknown"), } start_time = timeit.default_timer() @@ -173,7 +173,7 @@ def record_streetnetwork_call(call_name, connector_name, mode, coverage_name): "mode": mode, "coverage": coverage_name, "status": "ok", - "az_suffix": app.config.get("DEPLOYMENT_AZ_SUFFIX", "unknown"), + "az": app.config.get("DEPLOYMENT_AZ", "unknown"), } start_time = timeit.default_timer() try: