惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX
J
Java Code Geeks
月光博客
月光博客
博客园_首页
The GitHub Blog
The GitHub Blog
Vercel News
Vercel News
B
Blog RSS Feed
博客园 - 聂微东
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
Jina AI
Jina AI
S
SegmentFault 最新的问题
B
Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog
Google DeepMind News
Google DeepMind News
阮一峰的网络日志
阮一峰的网络日志
The Cloudflare Blog
量子位
Martin Fowler
Martin Fowler
博客园 - Franky
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗

Datadog | The Monitor blog

Introducing our open source AI-native SAST Instrument and monitor Boomi integration flows with OpenTelemetry and Datadog Not all index scans are equal: How we cut query latency by over 99% Platform engineering metrics: What to measure and what to ignore Integrate Recorded Future threat intelligence with Datadog Cloud SIEM CI/CD security: threat modeling using a MITRE-style threat matrix CI/CD security: How to secure your GitHub ecosystem Ingress NGINX is EOL: A practical guide for migrating to Kubernetes Gateway API Operating agentic AI with Amazon Bedrock AgentCore and Datadog LLM Observability: Lessons from NTT DATA Introducing the Datadog Code Security MCP Capture and analyze custom heatmaps in Session Replay Understand session replays faster with AI summaries and smart chapters Monitor ClickHouse query performance with Datadog Database Monitoring How we designed empathetic alert sounds for on-call engineers Search and act across Datadog to resolve issues faster with Bits Assistant Measure the business impact of every product change with Datadog Experiments Analyzing round trip query latency Configuring JavaScript caches for better performance Introducing Bits AI Dev Agent for Code Security Datadog achieves ISO 42001 certification for responsible AI Monitor Nutanix clusters, hosts, and VMs with Datadog Monitor Juniper Mist in Datadog A new Host Map for modern infrastructure Annotate traces to improve LLM quality with Datadog LLM Observability What’s new in Cloud SIEM: AI-powered investigations, enhanced threat intelligence, and scalable security operations Explore Kubernetes with native OpenTelemetry data Monitor Oracle Fusion Cloud Applications with Datadog Announcing the Datadog Terraform provider v4.0.0 Scaling Kubernetes workloads on custom metrics How to design cloud environments for AI-powered threat analysis
Speed up your dashboard workflow with dynamic template va...
Thomas Sobolik, Miranda Kapin · 2021-05-11 · via Datadog | The Monitor blog
Thomas Sobolik

Thomas Sobolik

Senior Technical Content Writer

Miranda Kapin

Miranda Kapin

Template variables enable you to use tags to filter your Datadog dashboards to the hosts, containers, or services you need for faster troubleshooting. However, there are some cases where it may be difficult to use a standard set of template variables to aggregate all of the data you need without creating a complicated, difficult to manage set of variables. For example, you may use tag values that are a subset of another tag. Or, you might be migrating between tagging conventions and need to visualize data from multiple tags.

We’re pleased to announce you can now use the $tempvar.value syntax when defining template variables for your dashboard widgets. This syntax lets you include a template variable’s value within the query when building a graph. This gives you more control over what tags your template variables point to, helping you use fewer template variables while ensuring you can visualize all of the data you need across any tags.

In this post we’ll look at how you can use this new dynamic syntax to define template variables that:

  • select multiple sets of tag values using a single key

  • unify data from different tagging conventions

  • simplify network traffic queries

Consolidate template variables by attributing values as a partial string

You can use the $tempvar.value syntax to reduce the number of template variables you use to filter your dashboards. Let’s say you have separate staging environments for different services in your infrastructure. You might tag them with something like env (e.g., env:staging-web-store) and service (e.g., service:web-store). Now, you can use the template variable value as a partial string to streamline your graph queries. Nesting the template variable into the query in this way lets you take advantage of your tagging convention to simplify your template variable set. In this case, you can use the service template variable to specify which staging environment you want to show metrics from.

Using the new syntax, you can form graph queries with a reduced set of template variables.

With the query shown above, specifying web-store as the service in your template variable view would result in the graph pulling the metric from the staging-web-store environment. Leaving the service variable unspecified will graph the metric for each environment definable by the staging-$service.value sequence.

The resulting graph of the above query.

Migrating tagging conventions

If your teams are migrating to a new tagging convention, it can be complicated to ensure that all the relevant metric data you need is included in your dashboard graphs. You can use the $tempvar.val syntax to create “OR” statements in your graph queries that include both. This way, you can ensure that your graphs will show the metrics you want. In the example below, the graph will pull values tagged with the environment key or the env key.

Using the new syntax, you can form graph queries that account for conflicts in your tagging convention(s).

The resulting graph will include every value from the environment we specify, regardless of their key.

Get more flexible network traffic queries

Datadog NPM allows you to query for dependencies between any source or destination. When graphing network performance metrics like volume and TCP retransmits in your dashboards, you can leverage your template variables to build more flexible queries. With the new syntax, you can specify the source and destination of a network connection using the same template variable via, for example, the syntax service:$service.value.

Using the new syntax, you can ensure that your template variables map well to Network Performance Monitoring graph queries.

Then, you can easily filter the resulting graph using the $service variable to see which services are throwing the most retransmits, leading to poor connectivity with their dependencies.

The resulting graph of the above query.

Harness your template variables

With the new dynamic template variable syntax for Datadog, you can easily create adaptive template variables, reducing the number you need to manage and helping ensure no gaps in the data your dashboards visualize. This feature is currently available for all Datadog customers—no additional configuration is required. To learn more about the feature, see our template variable documentation. Or if you’re brand new to Datadog, sign up for a free trial to get started.