File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ in progress
8
8
9
9
- Use 60 minutes as default cache TTL
10
10
- Fix wrong ``jq `` commands in documentation. Thanks, @rahulnandan.
11
+ - Fix collecting data information from dashboards w/o ``targets `` slots
12
+ in panels
11
13
12
14
2023-10-03 0.16.0
13
15
=================
Original file line number Diff line number Diff line change 2
2
# (c) 2021 Andreas Motl <[email protected] >
3
3
# License: GNU Affero General Public License, Version 3
4
4
import dataclasses
5
+ import logging
5
6
from collections import OrderedDict
6
7
from typing import Dict , List , Optional
7
8
from urllib .parse import urljoin
8
9
9
10
from munch import Munch
10
11
12
+ logger = logging .getLogger (__name__ )
13
+
11
14
12
15
@dataclasses .dataclass
13
16
class GrafanaDataModel :
@@ -138,9 +141,10 @@ def collect_data_details(self):
138
141
targets = []
139
142
for panel in ds_panels :
140
143
panel_item = self ._format_panel_compact (panel )
141
- for target in panel .targets :
142
- target ["_panel" ] = panel_item
143
- targets .append (target )
144
+ if "targets" in panel :
145
+ for target in panel .targets :
146
+ target ["_panel" ] = panel_item
147
+ targets .append (target )
144
148
145
149
response = OrderedDict (targets = targets , annotations = ds_annotations , templating = ds_templating )
146
150
You can’t perform that action at this time.
0 commit comments