-
Notifications
You must be signed in to change notification settings - Fork 20
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Using both:
grafana-wtf explore datasources and grafana-wtf explore dashboards in our environment causes this to happen:
Traceback (most recent call last):
File "/home/admin/.local/bin/grafana-wtf", line 8, in <module>
sys.exit(run())
File "/home/admin/.local/lib/python3.10/site-packages/grafana_wtf/commands.py", line 322, in run
results = engine.explore_dashboards(with_data_details=options.data_details, queries_only=options.queries_only)
File "/home/admin/.local/lib/python3.10/site-packages/grafana_wtf/core.py", line 482, in explore_dashboards
ix = Indexer(engine=self)
File "/home/admin/.local/lib/python3.10/site-packages/grafana_wtf/core.py", line 613, in __init__
self.index()
File "/home/admin/.local/lib/python3.10/site-packages/grafana_wtf/core.py", line 617, in index
self.index_dashboards()
File "/home/admin/.local/lib/python3.10/site-packages/grafana_wtf/core.py", line 680, in index_dashboards
item = DatasourceItem.from_payload(item)
File "/home/admin/.local/lib/python3.10/site-packages/grafana_wtf/model.py", line 177, in from_payload
return cls(**payload)
TypeError: DatasourceItem.__init__() got an unexpected keyword argument 'default'
Grafana version 10.2.3
Our instance of Grafana has in the thousands of dashboards, so its unfortunately not feasible for me to find the specific one causing this issue, in order to post the JSON structure. This must have been a somewhat recent dashboard addition that caused this, as ~2 weeks ago this was working fine with no grafana-wtf version change.
As a quick fix on my end I was able to update the DatasourceItem class here:
grafana-wtf/grafana_wtf/model.py
Lines 161 to 170 in da92328
| class DatasourceItem: | |
| """ | |
| Represent a datasource reference within a panel, annotation, or templating (variable). | |
| """ | |
| uid: Optional[str] = None | |
| name: Optional[str] = None | |
| type: Optional[str] = None | |
| url: Optional[str] = None | |
with an extra argument:
default: Optional[str] = None
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working