Fix #5452 - Send usage with PUT (#6174)

* Send usage with PUT

* Wrap get details

* Wrap get details
This commit is contained in:
Pere Miquel Brull 2022-07-19 07:42:58 +02:00 committed by GitHub
parent 2e3b062e44
commit 9ad34f51a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 3 deletions

View File

@ -40,7 +40,7 @@ class OMetaDashboardMixin:
:param dashboard: Table Entity to update
:param dashboard_usage_request: Usage data to add
"""
resp = self.client.post(
resp = self.client.put(
f"/usage/dashboard/{dashboard.id.__root__}",
data=dashboard_usage_request.json(),
)

View File

@ -123,7 +123,7 @@ class OMetaTableMixin:
:param table: Table Entity to update
:param table_usage_request: Usage data to add
"""
resp = self.client.post(
resp = self.client.put(
f"/usage/table/{table.id.__root__}", data=table_usage_request.json()
)
logger.debug("published table usage %s", resp)

View File

@ -11,6 +11,7 @@
"""
Base class for ingesting dashboard services
"""
import traceback
from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Any, Iterable, List, Optional
@ -273,7 +274,16 @@ class DashboardServiceSource(TopologyRunnerMixin, Source, ABC):
def get_dashboard(self) -> Any:
for dashboard in self.get_dashboards_list():
dashboard_details = self.get_dashboard_details(dashboard)
try:
dashboard_details = self.get_dashboard_details(dashboard)
except Exception as err:
logger.error(
f"Cannot extract dashboard details from {dashboard} - {err}"
)
logger.debug(traceback.format_exc())
continue
if filter_by_dashboard(
self.source_config.dashboardFilterPattern,
self.get_dashboard_name(dashboard_details),