Skip to content

Clarify AND logic for multiple source filters in Custom Allocation Rules#37195

Merged
AustinLeaming merged 5 commits into
masterfrom
austin.leaming/ccm-allocation-rules-and-logic
Jun 3, 2026
Merged

Clarify AND logic for multiple source filters in Custom Allocation Rules#37195
AustinLeaming merged 5 commits into
masterfrom
austin.leaming/ccm-allocation-rules-and-logic

Conversation

@AustinLeaming

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a note to the Custom Allocation Rules documentation clarifying that when multiple source filters (costs_to_allocate) are specified, they are combined with AND logic. A cost line must match all filter conditions to be selected for allocation.

Why is this important?

This behavior is not documented anywhere — not in the public docs, API reference, or Terraform provider docs. A Tier 1 customer (CLOUDS-8179) raised this question, and we confirmed the AND behavior by reviewing:

  • Backend source code (dd-analytics/DailyProportionalAggregator.scala) — uses .forall() (Scala AND)
  • Anthropic OOTB seed data (k8s-resources) — three separate rules with AND'd filters
  • Internal Terraform configs (dd-source) — real rules with multiple costs_to_allocate blocks
  • Protobuf definition (dd-source) — repeated ArbitraryAllocationFilter costs_to_allocate

Preview

The note appears in Step 1 - Define the source, right after the example, and reads:

Note: When you define multiple source filters, they are combined with AND logic. A cost line must match all filter conditions to be selected for allocation.

Ref

  • CLOUDS-8179

When a Custom Allocation Rule has multiple source filters in
costs_to_allocate, they are combined with AND logic. This was
not documented, causing confusion for customers using the API
or Terraform provider.

Ref: CLOUDS-8179
@AustinLeaming AustinLeaming requested review from a team as code owners June 2, 2026 19:54
@datadog-prod-us1-4

This comment has been minimized.

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Preview links (active after the build_preview check completes)

Modified Files

@rtrieu rtrieu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

minor suggestion to use active voice and remove redundancy

Comment thread content/en/cloud_cost_management/allocation/custom_allocation_rules.md Outdated
AustinLeaming and others added 2 commits June 2, 2026 15:33
…rules.md

Co-authored-by: Rosa Trieu <107086888+rtrieu@users.noreply.github.com>
Per eng feedback (Safi Patel), clarify that while multiple source
filters are AND'd together, the in/not in conditions within a
single filter use OR logic (matching any of the listed values).

Ref: CLOUDS-8179

@safipatel safipatel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good from an accuracy standpoint

@AustinLeaming AustinLeaming requested a review from rtrieu June 3, 2026 18:13
@AustinLeaming AustinLeaming merged commit 638a856 into master Jun 3, 2026
16 checks passed
@AustinLeaming AustinLeaming deleted the austin.leaming/ccm-allocation-rules-and-logic branch June 3, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants