DataDog / datadog-operator

Kubernetes Operator for Datadog Resources
Apache License 2.0
301 stars 104 forks source link

Support to cumulative time windows in CRDs datadogmonitors.datadoghq.com #763

Open cmotta2016 opened 1 year ago

cmotta2016 commented 1 year ago

Output of the info page (if this is a bug)

(Paste the output of the info page here)

Describe what happened: We're attempting to create monitors with cumulative time windows but CRD doesn't support it.

Describe what you expected: The CRD must support the following .spec.options:

    schedulingOptions:
      evaluationWindow:
        dayStarts: "03:00"

Steps to reproduce the issue: Try to create the following Monitor:

apiVersion: datadoghq.com/v1alpha1
kind: DatadogMonitor
metadata:
  name: kubernetes-velero-partial-failed-backup-for-cluster-name
  labels:
    app: datadog-mixin
spec:
  name: "[kubernetes] Velero Partial Failed Backup for Cluster {{cluster_name.name}}"
  query: "sum(current_1d):sum:velero_backup_partial_failure.count{schedule:velero-backup-total-ns} by {cluster_name,kube_namespace,schedule}.as_count() >= 1"
  type: "query alert"
  message: "The last backup for scheduled backup {{schedule.name}} partially failed. "
  priority: 2
  options:
    includeTags: true
    newGroupDelay: 60
    thresholds:
      critical: "1"
    schedulingOptions:
      evaluationWindow:
        dayStarts: "03:00"
  tags:
    - "env:sandbox"
    - "integration:kubernetes"
    - "component:velero"

After created, run the following command and you can see that the schedulingOptions doesn't appear:

k get datadogmonitor kubernetes-velero-partial-failed-backup-for-cluster-cluster-name-name -o yaml  -n namespace

Additional environment details (Operating System, Cloud provider, etc): We're running the following components and versions:

I also have opened this issue in the helm-charts repository: https://github.com/DataDog/helm-charts/issues/1004

CharlyF commented 1 year ago

Hi!

Thanks for reaching out - I am adding this to our backlog. Will update the issue when we publish this.