File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
metadata-ingestion/src/datahub/ingestion/source/grafana Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 88- Dashboard JSON structure: https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/view-dashboard-json-model/
99"""
1010
11+ import logging
1112from typing import Any , Dict , List , Optional
1213
1314from pydantic import BaseModel , ConfigDict , Field
1415
1516from datahub .emitter .mcp_builder import ContainerKey
1617
18+ logger = logging .getLogger (__name__ )
1719# Grafana-specific type definitions for better type safety
1820GrafanaQueryTarget = Dict [
1921 str , Any
@@ -89,7 +91,13 @@ def extract_panels(panels_data: List[Dict[str, Any]]) -> List[Panel]:
8991 def parse_obj (cls , data : Dict [str , Any ]) -> "Dashboard" :
9092 """Custom parsing to handle nested panel extraction."""
9193 dashboard_data = data .get ("dashboard" , {})
92- panels = cls .extract_panels (dashboard_data .get ("panels" , []))
94+ _panel_data = dashboard_data .get ("panels" , [])
95+ try :
96+ panels = cls .extract_panels (_panel_data )
97+ except Exception as e :
98+ logger .warning (
99+ f"Error extracting panels from dashboard for dashboard panels { _panel_data } : { e } "
100+ )
93101
94102 # Extract meta.folderId from nested structure
95103 meta = dashboard_data .get ("meta" , {})
You can’t perform that action at this time.
0 commit comments