Skip to content

[Synthetics] Added task to sync global parameters when they are added, edited or deleted#216015

Merged
cesco-f merged 15 commits intoelastic:mainfrom
cesco-f:sync-params
May 22, 2025
Merged

[Synthetics] Added task to sync global parameters when they are added, edited or deleted#216015
cesco-f merged 15 commits intoelastic:mainfrom
cesco-f:sync-params

Conversation

@cesco-f
Copy link
Contributor

@cesco-f cesco-f commented Mar 26, 2025

This will improve PR #216197.

A new task is created using the task manager every time a global parameter is created, edited or deleted.

When params is updated/remove/added it will sync task soon, and task also continue to run every 10 minutes.

Execution

In the task we check if params have been changed since last run or param total have changes since last run, in that case we sync private locations data with package polices

Testing

Add few browser synthetics monitors in a test private location

Add/Update or delete a param , make sure relevant agent policy is updated with params. Go to fleet agent policy, view agent policy yaml and notice params field for a browser monitor in yaml.

@cesco-f cesco-f added backport:version Backport to applied version labels v9.1.0 v9.0.1 v8.19.0 release_note:skip Skip the PR/issue when compiling release notes labels Mar 26, 2025
@cesco-f cesco-f marked this pull request as ready for review March 26, 2025 14:08
@cesco-f cesco-f requested a review from a team as a code owner March 26, 2025 14:08
@botelastic botelastic bot added the Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. label Mar 26, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod bot requested a review from a team as a code owner March 26, 2025 14:55
@cesco-f cesco-f marked this pull request as draft March 27, 2025 15:34
@cesco-f cesco-f removed the v9.0.1 label Mar 31, 2025
@cesco-f cesco-f marked this pull request as ready for review April 17, 2025 06:49
@cesco-f cesco-f force-pushed the sync-params branch 4 times, most recently from 3c5b42b to e3e6ce4 Compare April 24, 2025 07:25
@cesco-f cesco-f force-pushed the sync-params branch 2 times, most recently from 3d870cb to 7a1813e Compare April 28, 2025 06:58
Copy link
Contributor

@kdelemme kdelemme left a comment

Choose a reason for hiding this comment

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

I have a question about the need for scheduled interval vs ad-hoc scheduling of the task, but otherwise LGTM.
Just one comment about the lastStartedAt state set in case of error

Copy link
Contributor

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

No blockers, but left some comments that would probably be useful to address.

Just so I understand, there will only ever be one task created, which will - based on other activity - be run with runSoon(). And otherwise will be on a 10m interval.

@cesco-f cesco-f force-pushed the sync-params branch 2 times, most recently from 74bff86 to 18da351 Compare May 5, 2025 10:32
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
synthetics 967.3KB 967.3KB -63.0B

History

Copy link
Contributor

@shahzad31 shahzad31 left a comment

Choose a reason for hiding this comment

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

LGTM !!

@cesco-f cesco-f merged commit 0a838e4 into elastic:main May 22, 2025
7 checks passed
@cesco-f cesco-f deleted the sync-params branch May 22, 2025 08:44
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15182080803

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.19:
- [Synthetics] Refactor: Create monitor configs repository !! (#202325)

Manual backport

To create the backport manually run:

node scripts/backport --pr 216015

Questions ?

Please refer to the Backport tool documentation

cesco-f added a commit to cesco-f/kibana that referenced this pull request May 22, 2025
…, edited or deleted (elastic#216015)

This will improve PR elastic#216197.

A new task is created using the task manager every time a global
parameter is created, edited or deleted.

When params is updated/remove/added it will sync task soon, and task
also continue to run every 10 minutes.

### Execution

In the task we check if params have been changed since last run or param
total have changes since last run, in that case we sync private
locations data with package polices

## Testing

Add few browser synthetics monitors in a test private location

Add/Update or delete a param , make sure relevant agent policy is
updated with params. Go to fleet agent policy, view agent policy yaml
and notice params field for a browser monitor in yaml.

---------

Co-authored-by: Shahzad <shahzad31comp@gmail.com>
(cherry picked from commit 0a838e4)

# Conflicts:
#	x-pack/solutions/observability/plugins/synthetics/server/routes/settings/sync_global_params.ts
#	x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/sync_global_params.ts
#	x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/synthetics_monitor/synthetics_monitor_client.ts
@cesco-f
Copy link
Contributor Author

cesco-f commented May 22, 2025

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

cesco-f added a commit to cesco-f/kibana that referenced this pull request May 22, 2025
…, edited or deleted (elastic#216015)

This will improve PR elastic#216197.

A new task is created using the task manager every time a global
parameter is created, edited or deleted.

When params is updated/remove/added it will sync task soon, and task
also continue to run every 10 minutes.

In the task we check if params have been changed since last run or param
total have changes since last run, in that case we sync private
locations data with package polices

Add few browser synthetics monitors in a test private location

Add/Update or delete a param , make sure relevant agent policy is
updated with params. Go to fleet agent policy, view agent policy yaml
and notice params field for a browser monitor in yaml.

---------

Co-authored-by: Shahzad <shahzad31comp@gmail.com>
(cherry picked from commit 0a838e4)
cesco-f added a commit to cesco-f/kibana that referenced this pull request May 22, 2025
…, edited or deleted (elastic#216015)

This will improve PR elastic#216197.

A new task is created using the task manager every time a global
parameter is created, edited or deleted.

When params is updated/remove/added it will sync task soon, and task
also continue to run every 10 minutes.

In the task we check if params have been changed since last run or param
total have changes since last run, in that case we sync private
locations data with package polices

Add few browser synthetics monitors in a test private location

Add/Update or delete a param , make sure relevant agent policy is
updated with params. Go to fleet agent policy, view agent policy yaml
and notice params field for a browser monitor in yaml.

---------

Co-authored-by: Shahzad <shahzad31comp@gmail.com>
(cherry picked from commit 0a838e4)
cesco-f added a commit to cesco-f/kibana that referenced this pull request May 22, 2025
…, edited or deleted (elastic#216015)

This will improve PR elastic#216197.

A new task is created using the task manager every time a global
parameter is created, edited or deleted.

When params is updated/remove/added it will sync task soon, and task
also continue to run every 10 minutes.

In the task we check if params have been changed since last run or param
total have changes since last run, in that case we sync private
locations data with package polices

Add few browser synthetics monitors in a test private location

Add/Update or delete a param , make sure relevant agent policy is
updated with params. Go to fleet agent policy, view agent policy yaml
and notice params field for a browser monitor in yaml.

---------

Co-authored-by: Shahzad <shahzad31comp@gmail.com>
(cherry picked from commit 0a838e4)
cesco-f added a commit that referenced this pull request May 23, 2025
…e added, edited or deleted (#216015) (#221243)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Synthetics] Added task to sync global parameters when they are
added, edited or deleted
(#216015)](#216015)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Francesco
Fagnani","email":"fagnani.francesco@gmail.com"},"sourceCommit":{"committedDate":"2025-05-22T08:43:57Z","message":"[Synthetics]
Added task to sync global parameters when they are added, edited or
deleted (#216015)\n\nThis will improve PR #216197.\n\nA new task is
created using the task manager every time a global\nparameter is
created, edited or deleted.\n\nWhen params is updated/remove/added it
will sync task soon, and task\nalso continue to run every 10
minutes.\n\n\n### Execution\n\nIn the task we check if params have been
changed since last run or param\ntotal have changes since last run, in
that case we sync private\nlocations data with package polices\n\n##
Testing\n\nAdd few browser synthetics monitors in a test private
location\n\nAdd/Update or delete a param , make sure relevant agent
policy is\nupdated with params. Go to fleet agent policy, view agent
policy yaml\nand notice params field for a browser monitor in
yaml.\n\n---------\n\nCo-authored-by: Shahzad
<shahzad31comp@gmail.com>","sha":"0a838e43883e83a42defc4f5840829c10223f820","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:obs-ux-management","backport:version","v9.1.0","v8.19.0"],"title":"[Synthetics]
Added task to sync global parameters when they are added, edited or
deleted","number":216015,"url":"https://github.com/elastic/kibana/pull/216015","mergeCommit":{"message":"[Synthetics]
Added task to sync global parameters when they are added, edited or
deleted (#216015)\n\nThis will improve PR #216197.\n\nA new task is
created using the task manager every time a global\nparameter is
created, edited or deleted.\n\nWhen params is updated/remove/added it
will sync task soon, and task\nalso continue to run every 10
minutes.\n\n\n### Execution\n\nIn the task we check if params have been
changed since last run or param\ntotal have changes since last run, in
that case we sync private\nlocations data with package polices\n\n##
Testing\n\nAdd few browser synthetics monitors in a test private
location\n\nAdd/Update or delete a param , make sure relevant agent
policy is\nupdated with params. Go to fleet agent policy, view agent
policy yaml\nand notice params field for a browser monitor in
yaml.\n\n---------\n\nCo-authored-by: Shahzad
<shahzad31comp@gmail.com>","sha":"0a838e43883e83a42defc4f5840829c10223f820"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/216015","number":216015,"mergeCommit":{"message":"[Synthetics]
Added task to sync global parameters when they are added, edited or
deleted (#216015)\n\nThis will improve PR #216197.\n\nA new task is
created using the task manager every time a global\nparameter is
created, edited or deleted.\n\nWhen params is updated/remove/added it
will sync task soon, and task\nalso continue to run every 10
minutes.\n\n\n### Execution\n\nIn the task we check if params have been
changed since last run or param\ntotal have changes since last run, in
that case we sync private\nlocations data with package polices\n\n##
Testing\n\nAdd few browser synthetics monitors in a test private
location\n\nAdd/Update or delete a param , make sure relevant agent
policy is\nupdated with params. Go to fleet agent policy, view agent
policy yaml\nand notice params field for a browser monitor in
yaml.\n\n---------\n\nCo-authored-by: Shahzad
<shahzad31comp@gmail.com>","sha":"0a838e43883e83a42defc4f5840829c10223f820"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Shahzad <shahzad31comp@gmail.com>
akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
…, edited or deleted (elastic#216015)

This will improve PR elastic#216197.

A new task is created using the task manager every time a global
parameter is created, edited or deleted.

When params is updated/remove/added it will sync task soon, and task
also continue to run every 10 minutes.


### Execution

In the task we check if params have been changed since last run or param
total have changes since last run, in that case we sync private
locations data with package polices

## Testing

Add few browser synthetics monitors in a test private location

Add/Update or delete a param , make sure relevant agent policy is
updated with params. Go to fleet agent policy, view agent policy yaml
and notice params field for a browser monitor in yaml.

---------

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

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants