Skip to content

Commit

Permalink
Refs #NAV-3691 - Update missing otlp call.
Browse files Browse the repository at this point in the history
  • Loading branch information
Netmisa committed Jan 24, 2025
1 parent efacff9 commit fd38163
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion source/jormungandr/jormungandr/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
]


def format_error(code, message):
def format_error(code: str, message: str) -> Dict:
error = {"error": {"id": code, "message": message}, "message": message}
return error

Expand Down
10 changes: 5 additions & 5 deletions source/jormungandr/jormungandr/otlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ def __call__(cls, *args, **kwds):


class Otlp(metaclass=OtlpMeta):
__service_name = "jormungandr"
__platform = "unknown"
__account = "unknown"
__labels = {}
__service_name: str = "jormungandr"
__platform: str = "unknown"
__account: str = "unknown"
__labels: Dict = {}

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

labels = self.__get_labels().copy()
labels.update("event_type", event_type)
labels["event_type"] = event_type
if "navitia_request_id" in labels:
labels.pop("navitia_request_id")
if "duration" in labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ def record_call(self, status, **kwargs):
params = {'bss_system_id': six.text_type(self.network), 'status': status}
params.update(kwargs)
new_relic.record_custom_event('bss_status', params)
otlp_instance.record_custom_event('bss_status', params)
otlp_instance.send_event_metrics('bss_status', params)
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ def record_call(self, status, **kwargs):
params = {'parking_system_id': self.provider_name, 'dataset': self.dataset, 'status': status}
params.update(kwargs)
new_relic.record_custom_event('parking_status', params)
otlp_instance.record_custom_event('parking_status', params)
otlp_instance.send_event_metrics('parking_status', params)

0 comments on commit fd38163

Please sign in to comment.