Skip to content

Conversation

@shahzad31
Copy link
Contributor

@shahzad31 shahzad31 commented Nov 3, 2025

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 spaces and pass that to the async task paramsSpacesToSync, this is a no-recurring task, which only runs once. The task uses the paramsSpacesToSync value 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.


  await taskManager.ensureScheduled({
    id: `${TASK_TYPE}:${uuidv4()}`,
    params: {},
    taskType: TASK_TYPE,
    runAt: new Date(Date.now() + 3 * 1000),
    state: { paramsSpacesToSync },
  });

Testing

Try adding/editing/deleting params in any space and it should task debug logs state, to enable logs

logging.loggers:
  - name: plugins.synthetics
    level: debug
    appenders: [console]

paramsSpacesToSync value will get logged as debug log via

this.debugLog(current task state is ${JSON.stringify(taskInstance.state)});

Also following log will indicate correctly logged spaces of monitors

      this.debugLog(
        `Starting sync of private location monitors for spaces: ${Array.from(monitorSpaceIds).join(
          ', '
        )}`
      );

Code changes

A new file deploy_private_location_monitors.ts has been added with DeployPrivateLocationMonitors which will handle updating package policies in relevant spaces

A new task file has been added with task Synthetics:Sync-Global-Params-Private-Locations

@github-actions github-actions bot added the author:obs-ux-management PRs authored by the obs ux management team label Nov 3, 2025
@shahzad31 shahzad31 changed the title PR feedback [Synthetics] Only update relevant space monitors where global params changes happens !! Nov 4, 2025
@shahzad31 shahzad31 added release_note:skip Skip the PR/issue when compiling release notes backport:version Backport to applied version labels labels Nov 4, 2025
@shahzad31 shahzad31 marked this pull request as ready for review November 4, 2025 14:15
@shahzad31 shahzad31 requested review from a team as code owners November 4, 2025 14:15
@botelastic botelastic bot added the Team:obs-ux-management Observability Management User Experience Team label Nov 4, 2025
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:obs-ux-management PRs authored by the obs ux management team backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-management Observability Management User Experience Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Synthetics] Sync global parameter task - Space awareness [Synthetics] Create sync global parameter task

2 participants