Skip to content

add(datadog_cluster_agent): add autoscaling metrics#22984

Open
clamoriniere wants to merge 1 commit intomasterfrom
clamoriniere/cluster-agent-new-autoscaling-metrics
Open

add(datadog_cluster_agent): add autoscaling metrics#22984
clamoriniere wants to merge 1 commit intomasterfrom
clamoriniere/cluster-agent-new-autoscaling-metrics

Conversation

@clamoriniere
Copy link
Contributor

What does this PR do?

Added new metrics related to autoscaling conditions and constraints for the DatadogPodAutoscaler. those metrics were introduced in the cluster-agent by DataDog/datadog-agent#47138

Motivation

keep documentation up-to-date

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add the qa/skip-qa label if the PR doesn't need to be tested during QA.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

Added new metrics related to autoscaling conditions and constraints for the DatadogPodAutoscaler. 
those metrics were introduced in the cluster-agent by DataDog/datadog-agent#47138
@github-actions
Copy link
Contributor

⚠️ Recommendation: Add qa/skip-qa label

This PR does not modify any files shipped with the agent.

To help streamline the release process, please consider adding the qa/skip-qa label if these changes do not require QA testing.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3ec397de36

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +31 to +32
datadog.cluster_agent.autoscaling.workload.horizontal_scaling.constraints.max_replicas,gauge,,,,Maximum number of replicas configured in the DatadogPodAutoscaler horizontal scaling constraints,0,datadog_cluster_agent,autoscaling horizontal scaling constraints max replicas,,
datadog.cluster_agent.autoscaling.workload.horizontal_scaling.constraints.min_replicas,gauge,,,,Minimum number of replicas configured in the DatadogPodAutoscaler horizontal scaling constraints,0,datadog_cluster_agent,autoscaling horizontal scaling constraints min replicas,,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove unsupported autoscaling metrics from metadata

The default Cluster Agent scrape config only emits metrics that appear in DEFAULT_METRICS (datadog_cluster_agent/datadog_checks/datadog_cluster_agent/check.py:26-44,100-105), but rows like horizontal_scaling.constraints.max_replicas/min_replicas here—and the other new received_recommendations_version, status.*, and vertical_scaling.constraints.* entries in this block—have no mapping there. After this change, the published metric catalog will claim these autoscaling metrics are supported even though the integration never submits them unless users add custom mappings by hand.

Useful? React with 👍 / 👎.

Copy link
Contributor Author

@clamoriniere clamoriniere Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm find with the fact the metrics are documented event if they aren't always available depending of the user configuration and environment

datadog.cluster_agent.autoscaling.workload.horizontal_scaling_received_replicas,gauge,,,,Number of replicas recommended by the main horizontal scaling source,0,datadog_cluster_agent,autoscaling horizontal scaling received replicas,,
datadog.cluster_agent.autoscaling.workload.local.horizontal_scaling_recommended_replicas,gauge,,,,Number of replicas recommended by the local in-cluster fallback recommender,0,datadog_cluster_agent,autoscaling local horizontal scaling recommended replicas,,
datadog.cluster_agent.autoscaling.workload.local.horizontal_utilization_pct,gauge,,,,CPU utilization percentage computed by the local fallback recommender for horizontal scaling,0,datadog_cluster_agent,autoscaling local horizontal utilization pct,,
datadog.cluster_agent.autoscaling.workload.local_fallback_enabled,gauge,,,,1 if the local in-cluster fallback recommender is currently active for horizontal scaling 0 otherwise,-1,datadog_cluster_agent,autoscaling local fallback enabled,,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Rename this metric to the emitted local fallback name

Users will look up datadog.cluster_agent.autoscaling.workload.local_fallback_enabled from the metric catalog, but the check actually emits datadog.cluster_agent.autoscaling.workload.local.fallback_enabled (datadog_cluster_agent/datadog_checks/datadog_cluster_agent/check.py:42-44), and the bundled dashboard queries that dotted name (datadog_cluster_agent/assets/dashboards/datadog_cluster_agent_overview.json:2222). As written, this metadata entry documents a metric name that does not exist.

Useful? React with 👍 / 👎.

@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.03%. Comparing base (41a1796) to head (3ec397d).

Additional details and impacted files
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant