Skip to content

Add error-tracking monitor option to DatadogMonitor CRD. #2775#2778

Closed
AkselAllas wants to merge 4 commits intoDataDog:mainfrom
AkselAllas:add-error-tracking-monitor
Closed

Add error-tracking monitor option to DatadogMonitor CRD. #2775#2778
AkselAllas wants to merge 4 commits intoDataDog:mainfrom
AkselAllas:add-error-tracking-monitor

Conversation

@AkselAllas
Copy link
Copy Markdown
Contributor

@AkselAllas AkselAllas commented Mar 19, 2026

What does this PR do?

Close #2775
Since the go api already supports error-tracking via datadogV1.MONITORTYPE_ERROR_TRACKING_ALERT, then it's super easy to expose this via the CRD.

Motivation

Get error-tracking monitors working via k8s yml.
#2775

Additional Notes

Need help with labels.

Minimum Agent Versions

Are there minimum versions of the Datadog Agent and/or Cluster Agent required?

Probably.

Describe your test plan

My fork successfully created the monitor in my k8s cluster.
I overwrote the DatadogMonitor CRD with the following file (Taken from my PR fork):

datadoghq.com_datadogmonitors.yaml

And by using the following image & conf for the operator:

datadog-operator:
  image:
    repository: ghcr.io/akselallas/datadog-operator
    tag: 1.24.0-error-tracking-monitor-correct
  datadogCRDs: # disable monitor CRD to avoid conflicts with the overwritten CRD from the wrapper
    crds:
      datadogMonitors: false
  datadogMonitor:
    enabled: true

And this is the monitor yml diff:

  query: >-
    error-tracking("service:test-service
    env:staging").source("all").new().rollup("count").by("issue.id").last("1d")
    > 0
  type: error-tracking alert

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)

@AkselAllas AkselAllas requested a review from a team March 19, 2026 09:03
Copy link
Copy Markdown

@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: c7e25f1612

ℹ️ 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".

@AkselAllas AkselAllas force-pushed the add-error-tracking-monitor branch 5 times, most recently from 64f680b to 5fc510b Compare March 19, 2026 09:26
@AkselAllas
Copy link
Copy Markdown
Contributor Author

AkselAllas commented Mar 19, 2026

I overwrote the DatadogMonitor CRD with the following file (Taken from my PR fork):

datadoghq.com_datadogmonitors.yaml

And by using the following image & conf for the operator:

datadog-operator:
  image:
    repository: ghcr.io/akselallas/datadog-operator
    tag: 1.24.0-error-tracking-monitor-correct
  datadogCRDs: # disable monitor CRD to avoid conflicts with the overwritten CRD from the wrapper
    crds:
      datadogMonitors: false
  datadogMonitor:
    enabled: true

And this is the monitor yml diff:

  query: >-
    error-tracking("service:test-service
    env:staging").source("all").new().rollup("count").by("issue.id").last("1d")
    > 0
  type: error-tracking alert

@AkselAllas
Copy link
Copy Markdown
Contributor Author

@levan-m @tbavelier

I have this feature working in my k8s cluster, could we try to get this merged?

@AkselAllas
Copy link
Copy Markdown
Contributor Author

@mackjmr @khewonc

@AkselAllas AkselAllas force-pushed the add-error-tracking-monitor branch from 5fc510b to 1fecfa1 Compare March 24, 2026 15:33
@levan-m
Copy link
Copy Markdown
Collaborator

levan-m commented Mar 30, 2026

@AkselAllas thanks for your submission. We will plan this for 1.26 release milestone.

@levan-m levan-m added the enhancement New feature or request label Mar 30, 2026
@levan-m levan-m added this to the v1.26.0 milestone Mar 30, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.19%. Comparing base (44f4524) to head (6457f4d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2778      +/-   ##
==========================================
- Coverage   39.21%   39.19%   -0.03%     
==========================================
  Files         314      314              
  Lines       27303    27321      +18     
==========================================
  Hits        10708    10708              
- Misses      15807    15825      +18     
  Partials      788      788              
Flag Coverage Δ
unittests 39.19% <ø> (-0.03%) ⬇️

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

Files with missing lines Coverage Δ
internal/controller/datadogmonitor/controller.go 55.94% <ø> (ø)

... and 2 files with indirect coverage changes


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 44f4524...6457f4d. Read the comment docs.

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

@levan-m
Copy link
Copy Markdown
Collaborator

levan-m commented Mar 31, 2026

@AkselAllas created repo branch off of your PR in #2843 and will merge it, closing this.

@levan-m levan-m closed this Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: error-tracking alert

3 participants