-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[TSVB] Runs the migration correctly for the drop last bucket #121734
[TSVB] Runs the migration correctly for the drop last bucket #121734
Conversation
@flash1293 as I describe on the PR, I can partially fix it. The migration can run safely for the global option but not for the series option (when the override data view is set to true) I think that this should be fixed on the beats side. https://github.com/elastic/beats/search?p=2&q=override_index_pattern There are only 4 visualizations as far as I can see on the repo that need to be updated. Wdyt? |
Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally with Metricbeat dashboard and importing SOs.
params: { | ||
...visState.params, | ||
drop_last_bucket: visState.params.drop_last_bucket ?? 1, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think that if you invert the result is the same:
params: { | |
...visState.params, | |
drop_last_bucket: visState.params.drop_last_bucket ?? 1, | |
}, | |
params: { | |
drop_last_bucket: 1, | |
...visState.params | |
}, |
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Metrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
…#121734) * [TSVB] Runs the migration correctly for the drop last bucket * [TSVB] Run the migration for drop_last_bucket Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
💔 Backport failed
Successful backport PRs will be merged automatically after passing CI. To backport manually run: |
…#121734) * [TSVB] Runs the migration correctly for the drop last bucket * [TSVB] Run the migration for drop_last_bucket Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # src/plugins/visualizations/server/embeddable/visualize_embeddable_factory.ts # src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.test.ts # src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts
#121939) * [TSVB] Runs the migration correctly for the drop last bucket * [TSVB] Run the migration for drop_last_bucket Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
1 similar comment
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
…121734) (#121940) * [TSVB] Runs the migration correctly for the drop last bucket (#121734) * [TSVB] Runs the migration correctly for the drop last bucket * [TSVB] Run the migration for drop_last_bucket Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # src/plugins/visualizations/server/embeddable/visualize_embeddable_factory.ts # src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.test.ts # src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts * Commit test * Fix test Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
Fixes #121684
The problem
On 7.14 we changed the default behavior of the
Drop last bucket
setting from Yes to No. We also created another PR that adds a migration script (for < 7.14.0 SOs) #110782. What this migration does:drop_last_bucket
setting is set. If no, it adds the property with 1 (Drop last bucket ? Yes)series_drop_last_bucket
to 1This works fine for all charts / dashboards that migrate from a version prior to 7.14.0 (and for the metricbeats new installations)
In 7.15, beats changed their visualizations SOs (for example here https://github.com/elastic/beats/blob/master/metricbeat/module/system/_meta/kibana/7/visualization/83e12df0-1b91-11e7-bec4-a5e9ec5cab8b-ecs.json) and the new migration version became v7.14.0. This means that the above migration doesn't run for the newly created metricbeats dashboards (7.15++)
The fix
I created another migration (7.17). This is not the same migration that runs for 7.14.0 because we can't use it unfortunately if the override index pattern setting is used. This migration checks if the global
drop_last_bucket
setting is set. If no, it adds the property with 1 (Drop last bucket ? Yes)This is safe as the
drop_last_bucket
is saved with the SO regardless the value from 7.14++. This means:Unfortunately this is not safe for the visualizations that are using the override index pattern setting and have been created for 7.14 +. The reason is that the if the default value of
series_drop_last_bucket
(default is No), this is not saved in the SO. What it means if I run the migration:The above cases can't be solved by us unfortunately. I think that they should be changed on the beats side. As far as I can see they are 4 beats charts that use the 'override_index_pattern : 1' property https://github.com/elastic/beats/search?p=1&q=override_index_pattern. I think that we should update them with adding
series_drop_last_bucket : 1
In order this to never happen again, this PR except from adding the migration, also adds the default values for the
override_index_pattern
andseries_drop_last_bucket
for a newly created TSVB chart. With this change, the default values will always be stored in the SO.How to test
drop_last_bucket
setting should be set to Yesv8.1 newly installed metricbeat dashboard
and the dashboard

Checklist