Use Associated Template Variables to Refine Your Dashboards | Datadog

Use associated template variables to refine your dashboards

Author David M. Lentz
Author Miranda Kapin

Published: 2月 17, 2021

Datadog dashboards provide a foundation for monitoring and troubleshooting your infrastructure and applications, and template variables allow you to focus your dashboards on a particular subset of hosts, containers, or services based on tags or facets.

We’re pleased to announce template variable associated values, which can help you speed up your troubleshooting by dynamically presenting the most relevant values for your template variables. Associated values enable you to isolate the most useful data, and they are now available with no additional setup.

The built-in Azure dashboard shows the region template variable with an associated values list.

Find the most useful template variable values

Associated values make it easy to filter your data and focus your exploration by placing the most relevant values within easy reach. As you select a value for each template variable, Datadog automatically finds the associated values for the dashboard’s other template variables and places them at the top of the list.

The dashboard shown below includes two template variables—$namespace and $deployment. The deployment’s associated values list contains only values that are relevant for the selected namespace and which you are therefore most likely to select. Below that, the other values list contains the rest of the template variable’s available values. You can select any item in either list or begin typing to dynamically filter both lists.

A Kubernetes dashboard shows two template variables: namespace has a selected value, and deployment shows a list of associated values.

Use multiple template variables to focus your dashboard

With each template variable you define, the list of associated values becomes more focused for the remaining template variables. This makes it easy to move from a broad context—which can be a good investigative starting point—to a more granular view of a key subset of your hosts and services.

In the Kubernetes dashboard below, the $cluster template variable establishes a broad context by filtering out all data not relevant to istio-demo-prod. The other template variables frame a progressively narrower focus. We’ve selected values for the $deployment and $service template variables, and $node shows associated values relevant to that context. In other words, the associated nodes are the ones in the cluster named istio-demo-prod that are part of the selected deployment (productpage-v1) and are running the selected service (productpage).

A Kubernetes dashboard shows a list of associated values for the node template variable, which is filtered based on values provided for the cluster, deployment, and service template variables.

Apply tags to add context to your data

Template variables make use of the tags and facets on your infrastructure and services. Datadog applies some of these tags automatically based on metadata from your cloud provider and container orchestrator. Additionally, you can apply custom tags to create dimensions that allow you to explore your data in ways that make the most sense for your business.

For example, if you’ve applied a team tag to your hosts to indicate ownership, you can use a template variable to easily zero in on each team’s hosts. In the screenshot below, the list of values presented at the top of thehost template variable only includes hosts that belong to the selected team, making it less likely that you’ll dial in a combination that doesn’t show relevant data.

A template variable shows a list of hosts that belong to the Datadog team, as well as other values (hosts not tagged with team:datadog).

To learn about creating a tagging strategy that allows you to quickly filter your dashboard based on your own tags, see our best practices for tagging your infrastructure and applications.

Focus your template variables with associated values

Template variable associated values do not require any configuration, so you can start using them right away to swiftly zoom in on dashboard data from more than 700 technologies. And when you capture your dashboard contexts as saved views, you can easily share them for troubleshooting across teams.

See the documentation to learn more about template variables and associated values. If you’re not yet using Datadog, you can start with a .