[Synthetics] Only update relevant space monitors where global params changes happens !! #241715
+580
−460
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #241433
Fixes #241432
Only update the monitors in which params changes have been made, this is done via a one time task which gets triggered when some changes to global params to happens.
When some modification to params happens, we get
spacesand pass that to the async taskparamsSpacesToSync, this is a no-recurring task, which only runs once. The task uses theparamsSpacesToSyncvalue from state and propagate global params values to monitors.Global params triggers from the existing recurring task have been removed.
When params are updated, we call following API, since we aren't providing schedule, this will create one time instance of the task. paramsSpacesToSync is spaceIds of the params.
Testing
Try adding/editing/deleting params in any space and it should task debug logs state, to enable logs
paramsSpacesToSyncvalue will get logged as debug log viathis.debugLog(current task state is ${JSON.stringify(taskInstance.state)});Also following log will indicate correctly logged spaces of monitors
Code changes
A new file deploy_private_location_monitors.ts has been added with
DeployPrivateLocationMonitorswhich will handle updating package policies in relevant spacesA new task file has been added with task Synthetics:Sync-Global-Params-Private-Locations