Skip to content

Commit 648e957

Browse files
peekjef72amotl
authored andcommitted
dsquery: fix instant query mode
1 parent aeeb3c6 commit 648e957

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

grafana_client/knowledge.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,9 @@ def query_factory(datasource, model: Optional[dict]) -> Union[Dict, str]:
303303
if 'time_to' not in model:
304304
model['time_to'] = int( now.timestamp() )
305305

306+
if 'instant' in query and query['instant']:
307+
model['time_from'] = model['time_to']
308+
306309
payload = {
307310
"queries": [query],
308311
"from": str(model['time_from']*1000),

0 commit comments

Comments
 (0)