Skip to content

Commit 3a0576b

Browse files
committed
Refs #NAV-3691 - Update missing otlp call.
1 parent 79bc703 commit 3a0576b

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

source/jormungandr/jormungandr/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
]
4747

4848

49-
def format_error(code, message):
49+
def format_error(code: str, message: str) -> Dict:
5050
error = {"error": {"id": code, "message": message}, "message": message}
5151
return error
5252

source/jormungandr/jormungandr/otlp.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ def __call__(cls, *args, **kwds):
5656

5757

5858
class Otlp(metaclass=OtlpMeta):
59-
__service_name = "jormungandr"
60-
__platform = "unknown"
61-
__account = "unknown"
62-
__labels = {}
59+
__service_name: str = "jormungandr"
60+
__platform: str = "unknown"
61+
__account: str = "unknown"
62+
__labels: Dict = {}
6363

6464
def __init__(self, platform: str, account: str) -> None:
6565
self.__log = logging.getLogger(__name__)
@@ -218,7 +218,7 @@ def send_event_metrics(self, event_type: str, labels: Dict = {}) -> None:
218218
return
219219

220220
labels = self.__get_labels().copy()
221-
labels.update("event_type", event_type)
221+
labels["event_type"] = event_type
222222
if "navitia_request_id" in labels:
223223
labels.pop("navitia_request_id")
224224
if "duration" in labels:

source/jormungandr/jormungandr/parking_space_availability/bss/common_bss_provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ def record_call(self, status, **kwargs):
6060
params = {'bss_system_id': six.text_type(self.network), 'status': status}
6161
params.update(kwargs)
6262
new_relic.record_custom_event('bss_status', params)
63-
otlp_instance.record_custom_event('bss_status', params)
63+
otlp_instance.send_event_metrics('bss_status', params)

source/jormungandr/jormungandr/parking_space_availability/car/common_car_park_provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,4 @@ def record_call(self, status, **kwargs):
121121
params = {'parking_system_id': self.provider_name, 'dataset': self.dataset, 'status': status}
122122
params.update(kwargs)
123123
new_relic.record_custom_event('parking_status', params)
124-
otlp_instance.record_custom_event('parking_status', params)
124+
otlp_instance.send_event_metrics('parking_status', params)

0 commit comments

Comments
 (0)