Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CECO-1860][DatadogGenericResource] Add monitor support #1635

Open
wants to merge 6 commits into
base: tbavelier/levan-m/generic-resoource-refactor
Choose a base branch
from

Conversation

tbavelier
Copy link
Member

@tbavelier tbavelier commented Jan 20, 2025

What does this PR do?

  • Adds support for monitor as a DatadogGenericResource

Motivation

  • Supporting all monitors covered by the API, e.g.:
    apiVersion: datadoghq.com/v1alpha1
    kind: DatadogGenericResource
    metadata:
      name: monitor
    spec:
        type: monitor
        jsonSpec: |-
          {
            "name": "Example Monitor",
            "type": "composite",
            "query": "60693519 && 135415923",
            "message": "some message Notify: @hipchat-channel",
            "tags": [
              "test:examplemonitor",
              "env:ci"
            ],
            "priority": 3
          }

Additional Notes

This is based on refactor introduced in #1634

Minimum Agent Versions

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

  • Agent: vX.Y.Z
  • Cluster Agent: vX.Y.Z

Describe your test plan

Same as #1534 but using the object in Motivation: test the whole lifecycle of the object: create, update, (optionally: update from UI (waiting for the forcesync)), delete

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

@tbavelier tbavelier added the enhancement New feature or request label Jan 20, 2025
@tbavelier tbavelier added this to the v1.13.0 milestone Jan 20, 2025
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 77 lines in your changes missing coverage. Please review.

Project coverage is 48.79%. Comparing base (049c0b0) to head (ace4a7a).

Files with missing lines Patch % Lines
...rnal/controller/datadoggenericresource/monitors.go 0.00% 63 Missing ⚠️
pkg/datadogclient/client.go 0.00% 7 Missing ⚠️
...al/controller/datadoggenericresource/controller.go 0.00% 5 Missing ⚠️
...nternal/controller/datadoggenericresource/utils.go 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                               Coverage Diff                                @@
##           tbavelier/levan-m/generic-resoource-refactor    #1635      +/-   ##
================================================================================
- Coverage                                         48.96%   48.79%   -0.17%     
================================================================================
  Files                                               217      218       +1     
  Lines                                             20880    20950      +70     
================================================================================
  Hits                                              10223    10223              
- Misses                                            10117    10187      +70     
  Partials                                            540      540              
Flag Coverage Δ
unittests 48.79% <0.00%> (-0.17%) ⬇️

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 89.83% <0.00%> (-3.16%) ⬇️
...al/controller/datadoggenericresource/controller.go 39.25% <0.00%> (+0.28%) ⬆️
pkg/datadogclient/client.go 0.00% <0.00%> (ø)
...rnal/controller/datadoggenericresource/monitors.go 0.00% <0.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 049c0b0...ace4a7a. Read the comment docs.

@tbavelier tbavelier marked this pull request as ready for review January 21, 2025 09:14
@tbavelier tbavelier requested a review from a team as a code owner January 21, 2025 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants