Configure Advanced Grafana Settings

In order to configure filters for the Reports section of the web app using Grafana, there are three features:

Managing Filter Options

The Grafana filters have a default set of options, set in code on the web application:

{ display: "Last 5 minutes", value: "now-5m" },
{ display: "Last 15 minutes", value: "now-15m" },
{ display: "Last 30 minutes", value: "now-30m" },
{ display: "Last 1 hour", value: "now-1h" },
{ display: "Last 3 hours", value: "now-3h" },
{ display: "Last 6 hours", value: "now-6h" },
{ display: "Last 12 hours", value: "now-12h" },
{ display: "Last 24 hours", value: "now-24h" },
{ display: "Last 2 days", value: "now-2d" },
{ display: "Last 7 days", value: "now-7d" }

The filter options may be overridden per company by setting the options on the company field: portal_configuration.reports_options.time_filter_options to be an array of option objects.

{
  "portal_configuration":{
    "reports_options":{
      "time_filter_options": [
        { "display":"Last 5 minutes", "value":"now-5m" },
        { "display":"Last 15 minutes", "value":"now-15m" },
        { "display":"Last 30 minutes", "value":"now-30m" },
        { "display":"Last 1 hour", "value":"now-1h" },
        { "display":"Last 3 hours", "value":"now-3h" },
        { "display":"Last 6 hours", "value":"now-6h" },
        { "display":"Last 12 hours", "value":"now-12h" },
        { "display":"Last 24 hours", "value":"now-24h" },
        { "display":"Last 2 days", "value":"now-2d" },
        { "display":"Last 7 days", "value":"now-7d" }
      ]
    }
  }
}

Managing Company Default Filter

The default filter option is set to “Last 6 hours” in the web app. To override this for a company, change the company’s metadata.report_default_filter_value to be the desired value from the filter options, e.g. now-1h. You can set this in the web application by going to Onboard > Accounts > Select the account > Edit Metadata. Enter report_default_filter_value for the Key and your preferred setting for Value (for example: now-5m). Select Save Changes and then Save User.

1806

Managing User Default Filter

To override the default filter option for a user, change the user’s metadata.report_default_filter_value to be the desired value from the filter options, e.g. now-1h. The user’s configuration will always override the company’s.

You can set this in the web application by going to Users > Select the user > Edit Metadata. Enter report_default_filter_value for the Key and your preferred setting for Value (for example: now-5m). Select Save Changes and then Save User.

1806