Skip to content

[DatadogSLO] Add sli_specification support for count SLOs #2764

Description

@jumpe1

Pre-submission Checklist

  • I have searched existing issues and this is not a duplicate
  • This is a Datadog Operator issue (CRDs, reconciliation, etc.), not a Datadog Agent or Datadog service problem (dashboards, monitors, etc.)

What happened:
The current DatadogSLO CRD only supports the legacy query field with numerator / denominator for metric-based SLOs. However, the Datadog API has introduced sli_specification as the successor to the query field, which enables formula-based SLO definitions using good_events_formula / total_events_formula with multiple named queries.
The Create an SLO object API documentation states that the query field "is superseded by sli_specification but is retained for backwards compatibility."
Because the CRD lacks sli_specification support, users cannot define metric SLOs that use formula expressions (e.g., query1 - default_zero(query2)) or combine multiple named queries — capabilities that the Datadog API and other IaC tools (such as the Terraform provider) already support.

What I expected:
The DatadogSLO CRD should support sli_specification.count to allow formula-based metric SLO definitions. Specifically:

  • A sliSpecification.count field with goodEventsFormula, totalEventsFormula, and queries
  • Validation to ensure query and sliSpecification are mutually exclusive
  • The existing query field should remain supported for backwards compatibility

Additional Context

  • Datadog API reference: https://docs.datadoghq.com/api/latest/service-level-objectives/#create-an-slo-object
  • Scope: This request covers only sli_specification.count (formula-based metric SLOs). Support for sli_specification.time_slice (type: time_slice) would be a separate effort.
  • Terraform provider: Already supports sli_specification for both count and time_slice types, which can serve as a reference implementation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions