Skip to content

[Heartbeat] Adds maintenance windows !!#41508

Merged
shahzad31 merged 49 commits intoelastic:mainfrom
shahzad31:maintenance-windows
Feb 18, 2025
Merged

[Heartbeat] Adds maintenance windows !!#41508
shahzad31 merged 49 commits intoelastic:mainfrom
shahzad31:maintenance-windows

Conversation

@shahzad31
Copy link
Contributor

@shahzad31 shahzad31 commented Nov 4, 2024

Proposed commit message

Added maintenance windows in heartbeat in RFC 5545 format using rrule-go library, this makes it compatible with kibana alerting maintenance windows which are using the same format https://www.elastic.co/guide/en/kibana/current/maintenance-windows.html

This will allow us to simple pass values from alerting maintenance windows where those are applicable to synthetics monitors as heartbeat configs

example being

heartbeat.monitors:

- type: http
  id: my-monitor
  urls: ["http://localhost:9200"]
  maintenance_windows:
    - freq: daily
      dtstart: "2024-11-04T01:00:00.000Z"
      interval: 1
      byweekday: [MO, TU, WE, TH, FR]
      duration: 3600000

Limitations

  • Only Daily, weekly, Monthly and Yearly Frequencies are allowed.
  • If DTStart is older than 2 years, it will throw error.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

@shahzad31 shahzad31 requested review from a team as code owners November 4, 2024 14:54
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Nov 4, 2024
@mergify
Copy link
Contributor

mergify bot commented Nov 4, 2024

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @shahzad31? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
@mergify
Copy link
Contributor

mergify bot commented Nov 4, 2024

backport-8.x has been added to help with the transition to the new branch 8.x.
If you don't need it please use backport-skip label and remove the backport-8.x label.

@mergify mergify bot added the backport-8.x Automated backport to the 8.x branch with mergify label Nov 4, 2024
@pierrehilbert pierrehilbert added the Team:obs-ds-hosted-services Label for the Observability Hosted Services team label Nov 4, 2024
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Nov 4, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services)

Copy link
Member

@cmacknz cmacknz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving go.mod changes.

@mergify
Copy link
Contributor

mergify bot commented Nov 12, 2024

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b maintenance-windows upstream/maintenance-windows
git merge upstream/main
git push upstream maintenance-windows
Copy link
Contributor

@emilioalvap emilioalvap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with suggestions 🚀

shahzad31 and others added 5 commits February 17, 2025 09:40
Co-authored-by: Emilio Alvarez Piñeiro <95703246+emilioalvap@users.noreply.github.com>
Co-authored-by: Emilio Alvarez Piñeiro <95703246+emilioalvap@users.noreply.github.com>
@emilioalvap
Copy link
Contributor

/test

@shahzad31
Copy link
Contributor Author

/test

@shahzad31 shahzad31 merged commit f6fb08d into elastic:main Feb 18, 2025
144 checks passed
@shahzad31 shahzad31 deleted the maintenance-windows branch February 18, 2025 06:21
@shahzad31 shahzad31 removed the backport-8.x Automated backport to the 8.x branch with mergify label Feb 18, 2025
@shahzad31 shahzad31 added the backport-8.19 Automated backport to the 8.19 branch label Jun 6, 2025
mergify bot pushed a commit that referenced this pull request Jun 6, 2025
* Add maint windows

* Initial maint win MVP

* added maintenance windows

* destroy cluster

* format

* revert file

* revert file

* added lib

* revert

* space

* add license

* update

* update

* fix tests

* lint

* skip run once

* Fix linting

* Remove unused fields

* Make update

* add more test cases

* utc

* lint

* handle errors

* bit of refactor

* emilio suggestion

* More PR feedback

* lint

* add validation for map

* nil condition

* set count to default

* add validation for only daily

* add dt start validation

* revrt

* revrt

* revert

* revert

* format

* PR feedback

* add docs

* Update heartbeat/monitors/maintwin/maintwin.go

Co-authored-by: Emilio Alvarez Piñeiro <95703246+emilioalvap@users.noreply.github.com>

* Update heartbeat/monitors/maintwin/maintwin.go

Co-authored-by: Emilio Alvarez Piñeiro <95703246+emilioalvap@users.noreply.github.com>

* fomat

* change log

---------

Co-authored-by: Andrew Cholakian <andrewvc@elastic.co>
Co-authored-by: emilioalvap <emilio.alvarezpineiro@elastic.co>
Co-authored-by: Emilio Alvarez Piñeiro <95703246+emilioalvap@users.noreply.github.com>
(cherry picked from commit f6fb08d)

# Conflicts:
#	go.mod
#	go.sum
emilioalvap added a commit that referenced this pull request Jun 19, 2025
* [Heartbeat] Adds maintenance windows !! (#41508)

* Add maint windows

* Initial maint win MVP

* added maintenance windows

* destroy cluster

* format

* revert file

* revert file

* added lib

* revert

* space

* add license

* update

* update

* fix tests

* lint

* skip run once

* Fix linting

* Remove unused fields

* Make update

* add more test cases

* utc

* lint

* handle errors

* bit of refactor

* emilio suggestion

* More PR feedback

* lint

* add validation for map

* nil condition

* set count to default

* add validation for only daily

* add dt start validation

* revrt

* revrt

* revert

* revert

* format

* PR feedback

* add docs

* Update heartbeat/monitors/maintwin/maintwin.go

Co-authored-by: Emilio Alvarez Piñeiro <95703246+emilioalvap@users.noreply.github.com>

* Update heartbeat/monitors/maintwin/maintwin.go

Co-authored-by: Emilio Alvarez Piñeiro <95703246+emilioalvap@users.noreply.github.com>

* fomat

* change log

---------

Co-authored-by: Andrew Cholakian <andrewvc@elastic.co>
Co-authored-by: emilioalvap <emilio.alvarezpineiro@elastic.co>
Co-authored-by: Emilio Alvarez Piñeiro <95703246+emilioalvap@users.noreply.github.com>
(cherry picked from commit f6fb08d)

# Conflicts:
#	go.mod
#	go.sum

* Fix conflicts

---------

Co-authored-by: Shahzad <shahzad31comp@gmail.com>
Co-authored-by: emilioalvap <emilio.alvarezpineiro@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-8.19 Automated backport to the 8.19 branch enhancement Team:obs-ds-hosted-services Label for the Observability Hosted Services team

6 participants