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

推荐订阅源

Project Zero
Project Zero
B
Blog RSS Feed
爱范儿
爱范儿
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
D
Docker
B
Blog
大猫的无限游戏
大猫的无限游戏
V
Vulnerabilities – Threatpost
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
Schneier on Security
Spread Privacy
Spread Privacy
NISL@THU
NISL@THU
博客园 - 【当耐特】
IT之家
IT之家
云风的 BLOG
云风的 BLOG
L
Lohrmann on Cybersecurity
V
V2EX
Latest news
Latest news
S
Secure Thoughts
C
Check Point Blog
N
Netflix TechBlog - Medium
N
News | PayPal Newsroom
C
Cybersecurity and Infrastructure Security Agency CISA
The Register - Security
The Register - Security
The Cloudflare Blog
博客园_首页
博客园 - 三生石上(FineUI控件)
L
LINUX DO - 最新话题
W
WeLiveSecurity
G
GRAHAM CLULEY
量子位
T
The Exploit Database - CXSecurity.com
Security Latest
Security Latest
C
Cisco Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
GbyAI
GbyAI
A
Arctic Wolf
Attack and Defense Labs
Attack and Defense Labs
博客园 - 叶小钗
SecWiki News
SecWiki News
Vercel News
Vercel News
Engineering at Meta
Engineering at Meta
S
Security @ Cisco Blogs
小众软件
小众软件
N
News and Events Feed by Topic
WordPress大学
WordPress大学

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 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 Securing customer logins with breach intelligence 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
Scaling Kubernetes workloads on custom metrics
Danny Driscoll, Kennon Kwok · 2026-03-18 · via Datadog | The Monitor blog

The 2025 State of Containers and Serverless report found that 64% of organizations use the Kubernetes Horizontal Pod Autoscaler (HPA) to manage Kubernetes workload capacity. But only 20% of those deployments scale on custom metrics. The other four-fifths of organizations rely on resource metrics—CPU and memory utilized by their pods—to trigger autoscaling activity.

Resource metrics provide a low-friction way of configuring autoscaling, but they’re not always the most effective scaling signals. Many workloads are constrained by queue backlog, concurrency limits, or tail latency rather than raw CPU consumption. For these services, resource metrics don’t reflect demand accurately enough, and scaling on them can mean scaling too late.

In this post, we’ll identify workload patterns that scale more effectively based on Kubernetes custom metrics instead of resource metrics, and look at how teams currently implement custom metric scaling. We’ll also show you how Datadog Kubernetes Autoscaling (DKA) lets you trigger scaling based on application metrics to help ensure high performance, manage cloud costs, and simplify cluster management.

When standard CPU and memory resource metrics fall short

CPU and memory utilization are lagging indicators of upstream demand, making them an ineffective proxy for the work a service does. Although resource metrics measure consumption in real time, that reflects work that has already entered the system, not the volume of demand as it arrives.

For example, a workload constrained by connection limits or queue depth can report low CPU utilization even while its thread pool is exhausted and requests are queuing behind it. By the time the CPU metric climbs and triggers HPA, the service’s performance may have already degraded and caused user-facing latency.

Work metrics such as queue depth, request rate, and tail latency are leading indicators that reflect a workload’s real-time activity rather than the resulting infrastructure consumption. Because work metrics reflect demand as it arrives, they can be valuable signals for triggering autoscaling to provision capacity before users experience degradation. They surface relevant changes more quickly than lagging indicators, which may not trigger until after the workload is already under strain.

Workload patterns for Kubernetes custom metric scaling

Several workload patterns share a common characteristic: Resource utilization is a poor proxy for the amount of work they actually do. In this section, we’ll look at specific patterns and explain why custom metrics produce better scaling outcomes in each case.

Event-driven workers

These workers process messages from a queue such as a Kafka topic, an SQS queue, or a Redis or RabbitMQ queue used as a Celery broker. Resource metrics are an ineffective scaling trigger in these cases because CPU utilization often stays low until the backlog is large enough to overwhelm the worker pool. Scaling on queue depth instead lets a horizontal autoscaler add workers in proportion to backlog before processing latency increases. While the ideal threshold depends on worker throughput, a scaling configuration based on queue depth can bypass the slowdowns and errors common with lagging resource metrics.

High-throughput APIs

APIs that rely on database queries, external service calls, or cache lookups can saturate on request concurrency before CPU metrics register the pressure. If a service has a known concurrency limit, scaling on request rate gives a horizontal autoscaler a direct measure of load rather than waiting for CPU to reflect it.

Latency-sensitive services

Services with defined service level objectives (SLOs) benefit from scaling on tail latency directly, regardless of resource utilization. Proactively scaling out when p99 latency approaches an SLO threshold is more effective than waiting for lagging CPU metrics to catch up with the actual load. Latency metrics are especially prone to transient spikes, so you should configure stabilization carefully to avoid unnecessary scale events.

Database connection limits

Here, the scaling constraint originates downstream rather than in the service itself. Each additional replica opens connections to a shared database, and most databases enforce a hard limit on total concurrent connections. Scaling on CPU or request rate alone can push the replica count past this limit, causing database errors that affect all running replicas. Scaling instead on connection pool utilization turns available database capacity into a throttle—when connections are exhausted, the autoscaler pauses. For example, you can track MySQL’s Threads_running metric or PostgreSQL’s numbackends metric to trigger scaling based on active connections to those databases. This approach can introduce latency or errors across the existing replicas, but it protects against database-wide failure.

Business-logic scaling

Certain workloads generate operational pressure that is better measured by business-specific activities than by standard infrastructure metrics. This pattern applies where load is best expressed in domain terms, whether that’s the number of active WebSocket connections, open checkout sessions, or connected devices. For example, a WebSocket server handling a large number of persistent connections carries load that CPU utilization may not reflect. Scaling on connection count ensures that the server gains the additional resources it needs to remain performant when activity increases.

Standard approaches to custom metric scaling

Connecting a custom metric to HPA requires bridging a metric source to the Kubernetes External Metrics API. Two approaches are in common use today.

The native HPA path exposes custom metrics to HPA through the Kubernetes Custom Metrics API by using a deployed adapter. The Prometheus adapter, deployed as a standard Kubernetes workload alongside the application stack, is one widely recognized example that uses this pattern. This approach is flexible but offers limited visibility into adapter health, and to debug effectively requires correlating HPA event logs with adapter logs and API server responses.

Kubernetes Event-Driven Autoscaling (KEDA) is a CNCF project that exposes external metric sources to HPA through the Kubernetes External Metrics API. Its library of prebuilt scalers—connectors for sources including Kafka, SQS, Redis, and Prometheus—replaces per-source adapter code with declarative configuration. This removes most of the custom adapter overhead and adds production-ready support for scaling to zero. (Note that native HPA’s equivalent mechanism remains in alpha and is disabled by default in many managed Kubernetes offerings.) The trade-off is a new control plane component with its own versioning life cycle, and diagnosing unexpected behavior requires tracing through both KEDA’s trigger layer and HPA’s scaling execution.

The native HPA path and KEDA both enable scaling via custom metrics, but they come with implementation challenges. Teams often need to carefully tune HPA behavior (stabilization windows and scaling policies) to avoid oscillation when metrics fluctuate. In addition, because custom metrics typically flow through external adapters and data pipelines, delays or outages can leave HPA without a reliable signal unless you build safeguards, such as alerting and fallback behavior that uses local resource metrics (for example, CPU). Finally, verifying scaling logic requires independent checks of HPA conditions, the adapter or scaler, and the metric source.

Scaling on custom metrics with Datadog Kubernetes Autoscaling

Datadog Kubernetes Autoscaling (DKA) consolidates metrics, observability, and autoscaling into a single platform that eliminates the need to coordinate separate tools. The Datadog Cluster Agent powers DKA by implementing the Kubernetes External Metrics API, which makes any collected metric available as a scaling signal. As a managed autoscaling layer, DKA provides scaling observability in the same platform where your teams already monitor their services and infrastructure.

DKA’s custom query scaling lets teams define scaling signals by using the same Datadog query language used for dashboards and monitors. Any metric that Datadog collects can drive autoscaling. For example, a worker pool can scale on rabbitmq.queue.messages or kafka.request.channel.queue.size, and a web tier can scale on nginx.net.request_per_s. A built-in query builder displays historical metric behavior against the target threshold, helping teams identify the right signal and tune its value before deploying.

DKA UI showing custom query scaling configuration and a savings recommendation from downsizing container memory.

Metrics like request rate and queue depth naturally fluctuate, and scaling against a single target value turns that fluctuation into unnecessary pod churn. DKA helps you scale on custom metrics safely by letting you explicitly tune how quickly workloads scale in and out. This helps you respond quickly to real demand while avoiding instability during normal metric variance.

DKA also protects availability if custom metrics are delayed or temporarily unavailable. When external signals can’t be evaluated reliably, DKA automatically falls back to local CPU-based scaling behavior. This can help ensure that your workloads continue to scale and remain responsive even during custom metric interruptions.

Scaling on the right signal

Resource metrics are the right signal for horizontally scaling CPU-bound workloads and memory-constrained services. But for event-driven workers, high-throughput APIs, latency-sensitive services, database-backed services, and business-logic workloads, the gap between resource utilization and actual demand is where performance falters and capacity is wasted on overprovisioning. Custom metrics can help by aligning your capacity with business logic rather than hardware side effects. You can build a responsive scaling strategy around custom metrics, but you should assess whether your current tooling makes the additional complexity practical to act on.

See the Datadog Kubernetes Autoscaling documentation for more information about using custom metrics to effectively scale your workloads. If you don’t already have an account, you can sign up for a 14-day free trial.