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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

Datadog | The Monitor blog

Reduce CVE noise with OpenVEX assessments in Datadog How we made a SQL query optimization agent 59% more accurate using autoresearch and LLM Observability How to audit and clean up monitors effectively Diagnose slow PostgreSQL queries faster with explain plan correlation Explore Datadog metrics with Natural Language Queries Toto 2.0: Time series forecasting enters the scaling era Simplify micro-frontend observability with Datadog RUM Attribute AI costs across providers with Datadog Cloud Cost Management Diagnose and resolve database performance issues faster with Database Investigator Datadog for Government achieves FedRAMP® High certification Analyze cloud costs with flexible spreadsheets in Datadog Sheets Inside Datadog’s AI Research Lab: Meet two PhD candidates behind Toto Connect triage and investigation in a single workflow with Datadog Cloud SIEM This Month in Datadog - April 2026 Monitor and optimize Supabase query performance with Datadog Database Monitoring Add dynamically updating context to logs with Reference Tables and Observability Pipelines Introducing ARFBench: A time series question-answering benchmark based on real incidents The product signal latency gap slowing your growth Test network paths with TCP, UDP, and ICMP in Datadog Turn developer feedback into operational insight with Datadog Forms and Sheets How to investigate cloud credential compromise with Bits AI Security Analyst Evaluate, optimize, and secure your Google Cloud AI stack with Datadog Bringing observability data hosting to the UK on AWS Identify and fix code issues faster with Datadog’s Azure DevOps Source Code integration Steganography at scale: Embedding share URLs in Datadog widget screenshots Every team should be A/B testing Centralize observability management with Datadog Governance Console Spotting CI/CD misconfigurations before the bots do: Securing GitHub Actions with Datadog IaC Security Route OTel data from AI apps to ClickHouse and Datadog using Observability Pipelines Manage service tracing across hosts with Single Step Instrumentation rules Offline evaluation for AI agents: Best practices Detect runtime threats in Python Lambda functions with Datadog AAP 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 How we built a real-world evaluation platform for autonomous SRE agents at scale 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 When upserts don't update but still write: Debugging Postgres performance at scale 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 Monitor Aruba Central in Datadog How we centralize and remediate risks with Datadog Case Management Accelerate incident response with Datadog and ServiceNow Monitor your application and network load balancer logs Understanding Karpenter architecture for Kubernetes autoscaling Tools for collecting metrics and logs from Karpenter Monitor Karpenter with Datadog What your product data is actually saying Key metrics for monitoring Karpenter Securing Datadog's platform in the AI age: The role of observability data Closing the verification loop: Observability-driven harnesses for building with agents When an AI agent came knocking: Catching malicious contributions in Datadog’s open source repos Closing the verification loop, Part 2: Fully autonomous optimization Four ways engineering teams use the Datadog MCP Server to power AI agents Approaching your observability migration with the right mindset Meet the new Bits AI SRE: Deeper reasoning, twice as fast Designing MCP tools for agents: Lessons from building Datadog's MCP server Key learnings from the 2026 State of DevSecOps study Use plain English to query your multi-cloud infrastructure in Resource Catalog Simplifying troubleshooting across the user journey with Datadog Synthetic Monitoring Protect your OCI resources with Datadog Cloud Security This Month in Datadog - February 2026 Fine-tune Toto for turbocharged forecasts Amazon EC2 security: How misconfigured and public AMIs expand your cloud attack surface Enable end-to-end visibility into your Java apps with a single command Measure and improve mobile app startup performance with Datadog RUM Evaluating our AI Guard application to improve quality and control cost Identify untested code across every level of your codebase Make use of guardrail metrics and stop babysitting your releases Monitor Versa Networks SD-WAN performance in Datadog How we reduced the size of our Agent Go binaries by up to 77% Improve performance and reliability with APM Recommendations Remediate transitive vulnerabilities faster with Datadog Software Composition Analysis Generate audit-ready vulnerability and compliance reports with Datadog Sheets Monitor Fortinet FortiManager performance in Datadog Improve test coverage across codebases with Datadog Code Coverage
Discover powerful insights with nested metric queries
2025-05-27 · via Datadog | The Monitor blog
Kathy Lin

Kathy Lin

To gain adequate visibility into your distributed applications, you need to observe those applications at different levels of granularity. This means that you need to be able to query collected telemetry data both at the level of the whole application and at the level of selected components. Thanks to the power of Datadog tagging, you can already do this by aggregating your metrics within any scope of your choosing. For example, you can calculate the maximum value for any metric across your entire infrastructure to gain a bird’s-eye view, or you can determine that maximum within an individual part, such as a specific host or availability zone.

In some situations, however, you might want to combine the query results from multiple hosts in a subsequent query. For example, if you want to vertically scale your hosts (VMs or cloud instances), it’s helpful to know the p95 across all hosts’ maximum values for CPU usage. This query requires first calculating the maximum CPU usage value of each host and then comparing those hosts’ maximum values to each other to calculate the 95th percentile.

To help you reveal this type of information, Datadog now offers nested metric queries, which offer enhanced flexibility and control when you perform complex queries on large datasets. Nested queries allow you to use the results of one query as input to a subsequent one. With this new flexibility, you can now perform queries on query results—which is useful for provisioning and in other key scenarios—without having to manually export the data for refiltering or reaggregation.

In this blog post, we’ll explore how nested queries help you:

Uncover flexible insights with multilayer aggregation

Nested queries offer the flexibility to reaggregate query results for many individual resources and apply as many time and space aggregation layers as you need to summarize data and uncover the insights you’re searching for.

Without nested queries, every metric query has just one mandatory layer of time aggregation and one optional layer of space aggregation. This allows you to perform queries such as “For the metrics teams, what was the average memory used per container (space aggregation) every hour (time aggregation) for the last week ?” This starting query results in many distinct time series, as shown below:

A base query revealing the average memory used per hour over time for every container associated with the metrics team.
Many time series on a single graph.
A base query revealing the average memory used per hour over time for every container associated with the metrics team.

With nested queries, you can append additional aggregations in time and space to the base query. So now, you can reaggregate the query above and calculate the maximum value across all containers, for example, by appending max (everything) to the end, as shown here:

Result of a nested query that aggregates the values from the previous query and finds the max value across all containers over time.
A single time series showing the result of a nested query.
Result of a nested query that aggregates the values from the previous query and finds the max value across all containers over time.

This capability is useful because modern infrastructure changes constantly, leading to frequent churn in values for various tags, like podname, that are attached to short-lived components. In many cases, you won’t want to drill down into a particular host or container but instead want to aggregate behavior across groups of components, such as pods, hosts, or containers.

Load balancing Kafka topics

The multilayer space aggregation available in nested queries has helped enhance Datadog’s own streaming capabilities through better load balancing. At Datadog, we rely on Kafka for real-time data streaming. Balancing our Kafka topics is crucial to ensure the optimal performance, reliability, and scalability of our products. To prevent partition skew and uneven load distribution, we use Datadog ourselves to monitor partition distribution, identify imbalanced topics, and rebalance them if some brokers are overloaded.

To show how we use multilayer space aggregation for load balancing, we can start by graphing the sum of the sizes of each Kafka cluster, topic, and partition log in Datadog via a query. This results in many different timeseries, as shown in the screenshot below. The imbalanced topics are challenging to pinpoint.

A graph showing many different timeseries.

Now with the capability of multilayer space aggregation in nested queries, however, we’re able to better identify the imbalanced topics simply by adding an additional layer of space aggregation across clusterand topic tags. Now we can identify the clusterand topic pairs where the size difference is largest between the biggest and smallest partitions.

A graph showing a small number of timeseries that expose the largest size differences between partitions.

Resource capacity planning

Multilayer space aggregation can also be valuable for assessing resource utilization—that is, for identifying underutilized (oversized) resources as well as for capacity planning for future resource needs. For example, to reserve the correct amount of compute resources for the future, you need to analyze the current resource usage of containers over time.

To illustrate how you can improve visibility into resource utilization, we can build a nested query to perform multilayer time aggregation with the new metric system.cpu.system.total, released in Datadog Agent version 7.62. In this example, our goal is to accurately forecast CPU utilization based on the past three months to capacity-plan for the future. The new metric helps by allowing you to view the average, maximum, or even p95 CPU usage across cores (instead of across hosts or nodes) to reveal absolute measurements of CPU usage over time.

When you use this new metric in nested queries targeting Kubernetes clusters, for instance, you can review Kubernetes CPU usage that is first aggregated over short time intervals for precision, and then summarized over longer periods, to help accurately predict upcoming resource demand. To do this, you can begin by calculating the max metric value every 10 minutes for each node in a cluster to get a fine-grained view. As part of this query, you can sum all these nodes’ maxes by cluster for all clusters dedicated to the workload in question. (In the screenshot below, the workload is designated by the prefix “parent.”) Then, you can aggregate again in time to a human-readable granularity of two hours. This allows you to capture data over the entire past three months without sacrificing the minute-granular accuracy of the original query.

A query and corresponding results that summarize detailed data.

Confidently allocate resources with percentiles on count, rate, and gauge metrics

While distribution metrics provide server-side-aggregated, globally accurate percentiles calculated from your metric’s raw values, you may also be interested in percentiles on the aggregated queries on count, rate, or gauge type metrics.

Nested queries let you determine percentiles from aggregated non-distribution metrics. For example, in a containerized environment, understanding the p95 of all containers of a given workload can indicate whether you’re properly provisioning the right amount of resources. You can easily obtain that 95th percentile now with a nested query like the one illustrated below:

A query that reveals the 95th percentile for memory usage among a selected group of pods.

This technique can also be useful for network engineers who use Datadog’s Network Device Monitoring product. In this use case, you can use nested queries to gain insights into your daily SNMP device bandwidth utilization over time. For example, to view the average, p95, and even p98 of your max daily SNMP bandwidth utilization over the past year, you could use a nested query like the one shown below:

A query revealing p95 and p98 values for bandwidth utilization among SNMP devices over time.

Analyzing long-term data at the same level of granularity at which that data was originally submitted can provide valuable insights for executive business reporting, quota tracking, and resource allocation. Without nested queries, as your query’s time window grows, the default rollup interval also grows—causing your query results to become less fine-grained. Now with nested queries, you can retain the higher resolution even over long timeframes.

For example, let’s suppose you are interested in monitoring the memory consumption of your pods on a minute-by-minute basis over time. In this case, you might want to know the maximum RAM a certain group of pods uses over any minute this week vs. last month. To find this out, you can use the following nested query:

A dashboard widget revealing accurate maximum memory usage for kubernetes over time.

Start using nested metrics queries today

Datadog’s nested queries provide you with the flexibility to craft powerful, multi-step queries without needing to manually export and calculate values. You can use its capabilities to perform multilayer aggregation or create long-term, high-resolution query results on any metric or business KPI that you value—at the level of granularity that is optimal for your needs.

If you don’t already have a Datadog account, you can sign up for a 14-day free trial to get started.