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

推荐订阅源

I
Intezer
Google DeepMind News
Google DeepMind News
有赞技术团队
有赞技术团队
博客园 - Franky
Jina AI
Jina AI
博客园_首页
大猫的无限游戏
大猫的无限游戏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Engineering at Meta
Engineering at Meta
B
Blog
A
About on SuperTechFans
J
Java Code Geeks
WordPress大学
WordPress大学
GbyAI
GbyAI
N
News | PayPal Newsroom
C
Cybersecurity and Infrastructure Security Agency CISA
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
T
The Exploit Database - CXSecurity.com
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
N
Netflix TechBlog - Medium
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
P
Palo Alto Networks Blog
U
Unit 42
Vercel News
Vercel News
Microsoft Azure Blog
Microsoft Azure Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Know Your Adversary
Know Your Adversary
博客园 - 三生石上(FineUI控件)
AWS News Blog
AWS News Blog
Latest news
Latest news
V
V2EX
Y
Y Combinator Blog
Scott Helme
Scott Helme
博客园 - 叶小钗
美团技术团队
A
Arctic Wolf
S
Secure Thoughts
H
Help Net Security
L
LangChain Blog
博客园 - 司徒正美
V2EX - 技术
V2EX - 技术
P
Proofpoint News Feed
M
MIT News - Artificial intelligence
I
InfoQ
Cyberwarzone
Cyberwarzone
S
SegmentFault 最新的问题
Hacker News - Newest:
Hacker News - Newest: "LLM"

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 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 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 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 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 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 Move fast, don’t break things: Consistent testing standards at scale Enrich logs with ServiceNow CMDB context before routing to any SIEM or logging tool Monitor Lustre with Datadog Make faster, better product decisions with Datadog Product Analytics Surface and remediate runtime posture issues with Workload Protection Findings Protect agentic AI applications with Datadog AI Guard How to optimize JavaScript code with CSS Trace Google Pub/Sub workloads in Cloud Run with Datadog Detect human names in logs with ML in Sensitive Data Scanner How we cut our NLQ agent debugging time from hours to minutes with LLM Observability Debug PostgreSQL query latency faster with EXPLAIN ANALYZE in Datadog Database Monitoring Datadog acquires Propolis Unify and correlate frontend and backend data with retention filters Scale compliance across global frameworks with Datadog Cloud Security Monitor Arista VeloCloud SD-WAN performance with Datadog Building reliable dashboard agents with Datadog LLM Observability Simplify log collection and aggregation for MSSPs with Datadog Observability Pipelines Mitigation for Node.js denial-of-service vulnerability affecting Datadog APM Automate flaky test fixes with the Bits AI Dev Agent and Test Optimization How we built an AI SRE agent that investigates like a team of engineers Datadog integrations 2025 recap: Observability for AI, security, and hybrid cloud Design effective executive dashboards with Datadog Implement dbt data quality checks with dbt-expectations Bring faster visibility into AWS Lambda functions with remote instrumentation Troubleshoot faster with the GitLab Source Code integration in Datadog How Cambia Health Solutions saved $30,000 monthly with Cloud Cost Management and the Datadog Resource Catalog Normalize any logs for Cloud SIEM with Datadog's OCSF processor Optimizing Datadog at scale: Cost-efficient observability at Zendesk Detect, diagnose, and resolve network issues easily with CNM Network Health Connect engineering errors to user impact in early-stage products Cilium configuration for Kubernetes operations at scale Designing feedback loops for progressive delivery Ship features faster and safer with Datadog Feature Flags Choosing the right OpenTelemetry Collector distribution Route your monitor alerts with Datadog monitor notification rules Automate Cloud SIEM investigations with Bits AI Security Analyst Cloud threat detection: How to identify risky activity across control and data planes Collecting Kafka performance metrics Monitoring Kafka with Datadog Monitoring Kafka performance metrics
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.