Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Jun 6, 2025

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


This is an automatic backport of pull request #41508 done by [Mergify](https://mergify.com).

* 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 <[email protected]>

* Update heartbeat/monitors/maintwin/maintwin.go

Co-authored-by: Emilio Alvarez Piñeiro <[email protected]>

* fomat

* change log

---------

Co-authored-by: Andrew Cholakian <[email protected]>
Co-authored-by: emilioalvap <[email protected]>
Co-authored-by: Emilio Alvarez Piñeiro <[email protected]>
(cherry picked from commit f6fb08d)

# Conflicts:
#	go.mod
#	go.sum
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Jun 6, 2025
@mergify mergify bot requested review from a team as code owners June 6, 2025 10:06
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Jun 6, 2025
@mergify
Copy link
Contributor Author

mergify bot commented Jun 6, 2025

Cherry-pick of f6fb08d has failed:

On branch mergify/bp/8.19/pr-41508
Your branch is up to date with 'origin/8.19'.

You are currently cherry-picking commit f6fb08ddf.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   CHANGELOG.next.asciidoc
	modified:   NOTICE.txt
	modified:   heartbeat/docs/monitors/monitor-common-options.asciidoc
	new file:   heartbeat/monitors/maintwin/maintwin.go
	new file:   heartbeat/monitors/maintwin/maintwin_test.go
	modified:   heartbeat/monitors/stdfields/stdfields.go
	modified:   heartbeat/monitors/task.go
	modified:   heartbeat/scheduler/scheduler.go
	modified:   heartbeat/scheduler/scheduler_test.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   go.mod
	both modified:   go.sum

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jun 6, 2025
@github-actions github-actions bot added enhancement Team:obs-ds-hosted-services Label for the Observability Hosted Services team labels Jun 6, 2025
@elasticmachine
Copy link
Contributor

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

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jun 6, 2025
@emilioalvap emilioalvap enabled auto-merge (squash) June 6, 2025 19:36
@mergify
Copy link
Contributor Author

mergify bot commented Jun 9, 2025

This pull request has not been merged yet. Could you please review and merge it @shahzad31? 🙏

@mergify
Copy link
Contributor Author

mergify bot commented Jun 16, 2025

This pull request has not been merged yet. Could you please review and merge it @shahzad31? 🙏

@mergify
Copy link
Contributor Author

mergify bot commented Jun 19, 2025

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 mergify/bp/8.19/pr-41508 upstream/mergify/bp/8.19/pr-41508
git merge upstream/8.19
git push upstream mergify/bp/8.19/pr-41508

@emilioalvap emilioalvap merged commit 21cdd5f into 8.19 Jun 19, 2025
201 checks passed
@emilioalvap emilioalvap deleted the mergify/bp/8.19/pr-41508 branch June 19, 2025 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport conflicts There is a conflict in the backported pull request enhancement Team:obs-ds-hosted-services Label for the Observability Hosted Services team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants