Topics

Access to time range from scripted dashboard

carlos_silva@...
 

Hi all, I understand that a scripted dashboard can have access to the time range by just referring to ARGS.from and ARGS.to with something like:

if (!_.isUndefined(ARGS.from)) {
arg_from = ARGS.from;
}

this only seems to have access to the from url parameter when the scripted dashboard is first loaded via the browser. I need to have access to the time range value as it is changed by the user via the time picker as I need to get the latest picked value transform it and change the dashboard json. So really two questions:

  1. How do scripted dashboards get access to the changed time picker value?
  2. How do I "refresh" the scripted dashboard so that the changed value is used? I understand I can use templating variables in the dashboard json like $interval but I need to transform that value before being used.

Thanks in advance.

Carlos Silva <carlos_silva@...>
 

Anyone?

From: <grafana@groups.io> on behalf of Carlos Silva <carlos_silva@...>
Reply-To: "grafana@groups.io" <grafana@groups.io>
Date: Wednesday, November 30, 2016 at 2:59 PM
To: "grafana@groups.io" <grafana@groups.io>
Subject: [grafana] Access to time range from scripted dashboard

Hi all, I understand that a scripted dashboard can have access to the time range by just referring to ARGS.from and ARGS.to with something like:

if (!_.isUndefined(ARGS.from)) {
arg_from = ARGS.from;
}

this only seems to have access to the from url parameter when the scripted dashboard is first loaded via the browser. I need to have access to the time range value as it is changed by the user via the time picker as I need to get the latest picked value transform it and change the dashboard json. So really two questions:

  1. How do scripted dashboards get access to the changed time picker value?
  2. How do I "refresh" the scripted dashboard so that the changed value is used? I understand I can use templating variables in the dashboard json like $interval but I need to transform that value before being used.

Thanks in advance.

_._,_._,_


Carlos Silva <carlos_silva@...>
 

Bump!

From: <grafana@groups.io> on behalf of Carlos Silva <carlos_silva@...>
Reply-To: "grafana@groups.io" <grafana@groups.io>
Date: Thursday, December 8, 2016 at 10:54 AM
To: "grafana@groups.io" <grafana@groups.io>
Subject: Re: [grafana] Access to time range from scripted dashboard

Anyone?

From: <grafana@groups.io> on behalf of Carlos Silva <carlos_silva@...>
Reply-To: "grafana@groups.io" <grafana@groups.io>
Date: Wednesday, November 30, 2016 at 2:59 PM
To: "grafana@groups.io" <grafana@groups.io>
Subject: [grafana] Access to time range from scripted dashboard

Hi all, I understand that a scripted dashboard can have access to the time range by just referring to ARGS.from and ARGS.to with something like:

if (!_.isUndefined(ARGS.from)) {
arg_from = ARGS.from;
}

this only seems to have access to the from url parameter when the scripted dashboard is first loaded via the browser. I need to have access to the time range value as it is changed by the user via the time picker as I need to get the latest picked value transform it and change the dashboard json. So really two questions:

  1. How do scripted dashboards get access to the changed time picker value?
  2. How do I "refresh" the scripted dashboard so that the changed value is used? I understand I can use templating variables in the dashboard json like $interval but I need to transform that value before being used.

Thanks in advance.