Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Synthetics] Project monitors - prevent project monitors from being saved with Synthetics-UI incompatible schedules (consolidate) #142655

Closed
dominiqueclarke opened this issue Oct 4, 2022 · 10 comments
Labels
Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability

Comments

@dominiqueclarke
Copy link
Contributor

dominiqueclarke commented Oct 4, 2022

In Uptime Monitor Management UI, users could choose any schedule in minutes.

In the Synthetics UI, we only allow specific schedule values.

To ensure that project monitors remain compatible with Synthetics UI, we should add validation that prevents saving monitors with Synthetics-UI incompatible schedules.

The allowed schedules should be a standard set for both lightweight and browser monitors.

The Synthetics UI dropdown should be updated to reflect the new values.

Clarify in the release note, the standard and only accepted set of frequencies

@dominiqueclarke dominiqueclarke added the Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability label Oct 4, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

@paulb-elastic
Copy link
Contributor

@dominiqueclarke does "...add validation..." mean to the Kibana endpoint for Synthetics CLI push (I know we'll be adding more validation there too in elastic/synthetics#620), or does this mean in the Uptime UI (as you state, we already have a more restrictive form in Synthetics UI)?

@dominiqueclarke
Copy link
Contributor Author

We send errors back to the synthetics agent client for various things. I'd like to include this in the errors we send back.

It's best to handle the validation from both sides, in my opinion. The Kibana server will always have knowledge of what is and isn't supported in that version of Kibana, whereas the synthetics-agent could be operating on outdated information in an outdated version.

Also, based on elastic/synthetics#620, it appears that the types will be updated to for browser monitors to give users some guidance, but it's not clear to me if this will actually prevent pushes.

@vigneshshanmugam
Copy link
Member

vigneshshanmugam commented Oct 13, 2022

Also, based on elastic/synthetics#620, it appears that the types will be updated to for browser monitors to give users some guidance, but it's not clear to me if this will actually prevent pushes.

Added validation for both Browser and lightweight monitors. Users will not be able to push monitors to Kibana unless the schedule is changed to match with the allowed values.

@paulb-elastic
Copy link
Contributor

@dominiqueclarke with the decision to have a single, consolidated set of allowable schedules, and the validation added to the Synthetics Agent (here), I assume this is what we'll be implementing in the Kibana validation (i.e. not the ability for different schedules between lightweight and browser, which is in the current description)?

Also, can this issue include changing the drop down options in the Synthetics UI to match the new list of options, or would you rather a separate issue (e.g. the current browser monitor allows a 4 hour frequency to be set)?

@dominiqueclarke
Copy link
Contributor Author

I've updated the issue to reflect updating the dropdown.

@paulb-elastic
Copy link
Contributor

Added to the description:

Clarify in the release note, the standard and only accepted set of frequencies

@paulb-elastic paulb-elastic changed the title [Synthetics] Project monitors - prevent project monitors from being saved with Synthetics-UI incompatible schedules [Synthetics] Project monitors - prevent project monitors from being saved with Synthetics-UI incompatible schedules (consolidate) Mar 6, 2023
@dominiqueclarke dominiqueclarke self-assigned this Mar 23, 2023
@paulb-elastic
Copy link
Contributor

See #142653 (comment) for a standard set of frequencies

dominiqueclarke added a commit that referenced this issue Apr 5, 2023
…deprecated zip url fields (#154010)

## Summary

Relates to #142655
Resolves #142653

All monitor schedules in Uptime Monitor Management/Synthetics app apart
from the [supported
schedules](https://github.com/elastic/kibana/pull/154010/files#diff-6e5ef49468e646b5569e213b03876de143291ca3870a7092974793837f1ddc61R33)
have been deprecated.

The only allowed schedules are the below:

<img width="1241" alt="Screen Shot 2023-04-02 at 10 28 20 PM"
src="https://user-images.githubusercontent.com/11356435/229397972-fe2fcaa2-d3c7-450b-9b40-f8c71e6c7dcf.png">

Adds a migration to transform unsupportes schedules from Uptime Monitor
Management to supported Synthetics app schedules. Also adds validation
when an invalid schedule is used.

Also removes zip url fields from monitors. These fields were originally
included in the saved object spec anticipating a future zip url feature.
That feature has now been replaced by project monitors, removing the
need for zip url fields.

## Testing

⚠️ Note ⚠️ 
--

It's suggested that you use a fresh instance of ES to test this PR. This
can either be done by creating a brand new oblt cluster via oblt-cli, or
by running `yarn es snapshot`. If you run this PR on an existing
oblt-cluster, then switch back to main on that same cluster before this
PR is broken, you'll break the cluster.

Instructions
--
1. Check out 8.7.0
2. Create Uptime monitors with invalid schedules. Ideally, create one of
each monitor type. Some example invalid schedules are 4, 8, 11, and 16,
for example.
3. Create at least one of each type of project monitor by pushing
monitors via the synthetics agent
4. Check out this branch
5. Navigate to Synthetics or Uptime once Kibana is done loading. Observe
that each one of the invalid schedules was transformed into a supported
schedule.
6. (Testing that decryption is still working after migration). Navigate
to each one of the UI monitors' edit pages. Click save to resave each
monitor. Then, visit the edit page again. If you don't see any page
level errors, decryption is still working successfully
7. (Testing that decryption is still working after migration for project
monitors). Change the global schedule your project monitors and repush.
Check the global schedule of your project monitors one more time and
repush again. If both pushes are successful, decryption is still working
after the migration.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@dominiqueclarke
Copy link
Contributor Author

Closed by #154010

nreese pushed a commit to nreese/kibana that referenced this issue Apr 10, 2023
…deprecated zip url fields (elastic#154010)

## Summary

Relates to elastic#142655
Resolves elastic#142653

All monitor schedules in Uptime Monitor Management/Synthetics app apart
from the [supported
schedules](https://github.com/elastic/kibana/pull/154010/files#diff-6e5ef49468e646b5569e213b03876de143291ca3870a7092974793837f1ddc61R33)
have been deprecated.

The only allowed schedules are the below:

<img width="1241" alt="Screen Shot 2023-04-02 at 10 28 20 PM"
src="https://user-images.githubusercontent.com/11356435/229397972-fe2fcaa2-d3c7-450b-9b40-f8c71e6c7dcf.png">

Adds a migration to transform unsupportes schedules from Uptime Monitor
Management to supported Synthetics app schedules. Also adds validation
when an invalid schedule is used.

Also removes zip url fields from monitors. These fields were originally
included in the saved object spec anticipating a future zip url feature.
That feature has now been replaced by project monitors, removing the
need for zip url fields.

## Testing

⚠️ Note ⚠️ 
--

It's suggested that you use a fresh instance of ES to test this PR. This
can either be done by creating a brand new oblt cluster via oblt-cli, or
by running `yarn es snapshot`. If you run this PR on an existing
oblt-cluster, then switch back to main on that same cluster before this
PR is broken, you'll break the cluster.

Instructions
--
1. Check out 8.7.0
2. Create Uptime monitors with invalid schedules. Ideally, create one of
each monitor type. Some example invalid schedules are 4, 8, 11, and 16,
for example.
3. Create at least one of each type of project monitor by pushing
monitors via the synthetics agent
4. Check out this branch
5. Navigate to Synthetics or Uptime once Kibana is done loading. Observe
that each one of the invalid schedules was transformed into a supported
schedule.
6. (Testing that decryption is still working after migration). Navigate
to each one of the UI monitors' edit pages. Click save to resave each
monitor. Then, visit the edit page again. If you don't see any page
level errors, decryption is still working successfully
7. (Testing that decryption is still working after migration for project
monitors). Change the global schedule your project monitors and repush.
Check the global schedule of your project monitors one more time and
repush again. If both pushes are successful, decryption is still working
after the migration.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@dominiqueclarke dominiqueclarke removed their assignment Apr 26, 2023
@awahab07 awahab07 self-assigned this May 10, 2023
@awahab07
Copy link
Contributor

Post FF Testing

LGTM!

  • Created UI monitors on Kibana 8.7.0 with incompatible values in Uptime.
  • Pushed project monitors using Synthetics Agent v1.0.0-beta.37 with incompatible schedules.
  • Switched Kibana to main and migration successfully converted the schedules to the nearest compatible.
  • Tested editing the schedule and saving UI monitors and found no decryption errors.
  • Tested editing the schedule and pushing the project monitor again and found no decryption errors.
Before converstion After conversion
Screenshot 2023-05-10 at 21 25 51 Screenshot 2023-05-10 at 21 38 12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability
Projects
None yet
Development

No branches or pull requests

5 participants