Skip to content

[CONTP-1585] Add SLO support to DatadogGenericResource#3070

Merged
tbavelier merged 5 commits into
mainfrom
tbavelier/contp-1585-add-slo-to-ddgr
Jun 2, 2026
Merged

[CONTP-1585] Add SLO support to DatadogGenericResource#3070
tbavelier merged 5 commits into
mainfrom
tbavelier/contp-1585-add-slo-to-ddgr

Conversation

@tbavelier

@tbavelier tbavelier commented Jun 2, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Adds Service Level Objective (SLO) as a supported DatadogGenericResource type.

This includes:

  • the CRD enum update a generic-resource: 6daebcb
  • SLO handler with create/get/update/delete/state refresh support: 3ad8251
  • docs, and a sample manifest: 94fe5b2
  • small update to dev guide: 3f150bd

Motivation

https://datadoghq.atlassian.net/browse/CONTP-1585

Users can already manage SLOs through the dedicated DatadogSLO CRD, but DatadogGenericResource should also support SLOs so users can manage the API object directly from JSON and benefit from DDGR's generic reconciliation flow.

Additional Notes

SLO status refresh uses the SLO search endpoint with the SLO name from spec.jsonSpec, then filters results by the Datadog SLO ID stored in .status.id before surfacing overall_status[].state into .status.state.

Minimum Agent Versions

No minimum Agent or Cluster Agent version is required.

  • Agent: N/A
  • Cluster Agent: N/A

Describe your test plan

  • Deploy the Operator with DatadogGenericResource enabled.
  • Apply examples/datadoggenericresource/slo-sample.yaml.
  • Verify in the Datadog UI that the SLO is created.
  • Edit the DDGR manifest with k edit ddgr ddgr-slo-sample and change the warning threshold.
  • Verify in the Datadog UI that the warning threshold update is live.
  • Verify the DDGR status with k get ddgr.
    ╰─❯ k get ddgr
    NAME              ID                                 SYNC STATUS   STATE      LAST STATE SYNC        AGE
    ddgr-slo-sample   c77dd9bd5cca5336a1d21048bb2436c8   OK            breached   2026-06-02T11:51:51Z   18m
  • Delete the DDGR resource and verify the SLO is deleted.

Checklist

  • PR has at least one valid label: bug, enhancement, refactoring, documentation, tooling, and/or dependencies
  • PR has a milestone or the qa/skip-qa label
  • All commits are signed (see: signing commits)

@tbavelier tbavelier added this to the v1.28.0 milestone Jun 2, 2026
@tbavelier tbavelier added the enhancement New feature or request label Jun 2, 2026
@tbavelier
tbavelier marked this pull request as ready for review June 2, 2026 12:16
@tbavelier
tbavelier requested a review from a team June 2, 2026 12:16
@tbavelier
tbavelier requested review from a team as code owners June 2, 2026 12:16
@tbavelier tbavelier changed the title Add SLO support to DatadogGenericResource [CONTP-1585] Add SLO support to DatadogGenericResource Jun 2, 2026

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

Copy link
Copy Markdown

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: 3f150bd3ed

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread api/datadoghq/v1alpha1/datadoggenericresource_types.go
@codecov-commenter

codecov-commenter commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 43.13725% with 58 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.00%. Comparing base (c7d49fe) to head (e42da66).

Files with missing lines Patch % Lines
internal/controller/datadoggenericresource/slos.go 43.00% 55 Missing and 2 partials ⚠️
pkg/datadogclient/client.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##             main    #3070    +/-   ##
========================================
  Coverage   43.00%   43.00%            
========================================
  Files         339      340     +1     
  Lines       29228    29330   +102     
========================================
+ Hits        12570    12614    +44     
- Misses      15836    15892    +56     
- Partials      822      824     +2     
Flag Coverage Δ
unittests 43.00% <43.13%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...nternal/controller/datadoggenericresource/utils.go 100.00% <100.00%> (ø)
pkg/datadogclient/client.go 0.00% <0.00%> (ø)
internal/controller/datadoggenericresource/slos.go 43.00% <43.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c7d49fe...e42da66. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@datadog-datadog-prod-us1

Copy link
Copy Markdown

Code Coverage

Fix all issues with BitsAI

🛑 Gate Violations

🎯 1 Code Coverage issue detected

A Patch coverage percentage gate may be blocking this PR.

Patch coverage: 44.44% (threshold: 80.00%)

ℹ️ Info

🎯 Code Coverage (details)
Patch Coverage: 44.44%
Overall Coverage: 43.34% (+0.00%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: e42da66 | Docs | Datadog PR Page | Give us feedback!

@tbavelier
tbavelier merged commit b1ebe71 into main Jun 2, 2026
37 of 38 checks passed
@tbavelier
tbavelier deleted the tbavelier/contp-1585-add-slo-to-ddgr branch June 2, 2026 13:32
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.

3 participants