NEW RELIC / DASHBOARDS ECOSYSTEM

Variables for data exploration

Variables enable you to create more interactive and dynamic dashboards. Instead of hard-coding values in your queries that you need to modify, you can use variables instead.

Empowering Dashboards users

Using variables helps users make decisions and solve problems faster.

Meeting industry standards

Variables are widely used, but New Relic doesn’t support variables. This lack of common features hinders our ability to attract new customers by making it challenging to migrate from other platforms.

Variables are an agnostic mechanism

Variables act as placeholders. During rendering, these placeholders are substituted with the correct or selected values. Most importantly, variables are an agnostic mechanism and their functionality can be defined by their application.

Everything variables can be used for

  • FILTERING. Variables are a substitution method, so if the user adds a variable to their where clause in their widget query, like select * from pageaction where country = {{country}}, and then selects the variable value from the dashboard UI dropdown, the chart will change the {{country}} for the specified variable. Variables controls are displayed as dropdown lists at the top of the dashboard, and it’s easy to change the data you see in your dashboard.

  • DYNAMIC QUERIES. Since variables can be placed anywhere in the query, you can use them for further things than filtering, like to change query parameters. For example, in a query like select * from{{attribute}} where country ={{country}} you can swap the attributes for selected values, updating the chart.

  • DYNAMIC CHART CREATION. The user could specify, on the chart UI, if they want the variable to do a substitution or a “multiplication” any time the dashboard renders. With this feature on, the user will see a chart per value of the variable.

  • RECURSIVE VARIABLES. The ability of the service to declare a variable within a variable. For example, in the query select * from pageaction where country = {{country}}, the {{country}} variable could also include another variable.

  • TEMPLATING. For users who use dashboards as code (Terraform, Quickstarts...), using templates to create dashboards it's not optimal because they have to hard-code the account ID for widgets and dashboard each time. Creating a variables service means they can control these account ID values without editing the template.

  • DYNAMIC DASHBOARD CREATION When creating a dashboard (via API or a specific service), the engine that creates dashboards reads the variables from the template, resolves them, and creates one or more dashboards based on those variables. This way, the user only maintains one single template for a specific dashboard, dynamically creating multiple instances with specific changes.

Dashboard with Variables Bar

Variables for curated filtering

We learned that variables enable you to create more interactive and dynamic dashboards. Instead of hard-coding hostname, entity name, or environment within queries, you can insert variables. Since variables are displayed as dropdown lists at the top of the dashboard, it's easy to automatically change the data being displayed in your dashboard and use them as navigational elements curated by a dashboard owner, allowing all kinds of consumers to easily navigate and filter the information.

If you have multiple identical data sources or servers, you can create one dashboard and use these variables to change what you are viewing, simplifying maintenance and upkeep.

Let's consider the creation of a variable named {{Country}}, which represents a list of countries. This variable can then be added to a query: SELECT * FROM pageaction WHERE country = {{country}}. By doing this, a dropdown menu will be generated, presenting the user with a list of countries to choose from. Upon selecting a country, the visualization will dynamically update.

Key Solution Elements

  • At least 2 types of Variables: 1) Query, values are fetched from a data source query & 2) List separated by commas.

  • Variable Management UI: We need to provide an interface for the user to manage the variables from the entity: create, edit, delete. At first, we assumed all variables would be global, and so their Management UI. But now, a variable could be totally entity-dependent, different from a global variable.

  • Variable UI controls. The dashboard editor defines which variables will be shown in a particular dashboard. To apply these variables, all users need a menu to select variables values integrated into the dashboard UI. This dropdown menu is a standard navigation system when variables are introduced in a dashboard, and is also generic enough. Editors must be able to add, edit & remove them.

How to add or remove variables from the UI Controls

We tested different approaches with users. Here, we’re showing the smart or automatic mode, based on the principle of that a variable won't work unless it's part of a widget's query. From the prototype testing with users, we learned that the variable control dropdowns were expected and easy to use. The placement was expected too. They were able to select the values intuitively and quickly, but finding the variable nerdlet was unexpected for users. Overall, the testing results were quite positive, including users reaching out several weeks later to ask when it could be implemented, and allowed us to improve our experience.

Here’s a version of the experience we tested

UX Flow for Variables feature

If I edit a widget's query and add a variable, the UI Controls will show up automatically. Removing variables from the queries will make them disappear from the controls, since they wouldn't be useful. It's snappy, requires fewer clicks, and has fewer dependencies (variables that can't be managed or that don't apply to any widget).

Image of a query with variables smart guessing
Query with a variable that doesn't exist yet
Variable creation dialog

Next steps

Besides filtering, there are other interesting applications of variables in the New Relic environment. The following initiative will use variables for templating. By automating actions based on these variables, we aim to streamline workflows and reduce manual effort, which helps improve operational efficiency, freeing up valuable time and resources for more critical tasks.