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

[System] Migrate dashboards to "by value" #5023

Merged
merged 18 commits into from
Jan 19, 2023

Conversation

mrodm
Copy link
Contributor

@mrodm mrodm commented Jan 17, 2023

What does this PR do?

Migrate the visualizations used in the dashboards that are by reference to be by value.

Just the visualizations that are used in one dashboard are migrated. Those visualizations that are shared between two or more dashboard are left as they are.

There were 13 dashboards using visualization by reference and now there are 12.
There is also a decrease in the number of visualizations since they are now in the dashboards by value. From 103 to 45 visualizations.

Process followed to migrate the dashboards:

  • bootstrap the minimum required kibana version of the Elastic stack using elastic-package. According to the manifest: 8.1.0 (link)
    elastic-package stack up -v -d --version 8.1.0
    
  • look for the required visualizations to migrate, and press the "Unlink from library" button:
    unlink_library_button
  • export the dashboards using elastic-package command:
    elastic-package export dashboards

NOTE: not able to test the dashboards with data. This migration has been carried out using a local Elastic stack by means of elastic-package

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

Related issues

Screenshots

@mrodm mrodm added the enhancement New feature or request label Jan 17, 2023
@mrodm mrodm self-assigned this Jan 17, 2023
@elasticmachine
Copy link

elasticmachine commented Jan 17, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-01-19T13:27:22.596+0000

  • Duration: 16 min 50 sec

Test stats 🧪

Test Results
Failed 0
Passed 188
Skipped 0
Total 188

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@elasticmachine
Copy link

elasticmachine commented Jan 17, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (3/3) 💚
Files 100.0% (4/4) 💚
Classes 100.0% (4/4) 💚
Methods 60.759% (48/79) 👎 -34.112
Lines 98.793% (2702/2735) 👎 -1.207
Conditionals 100.0% (0/0) 💚

Comment on lines +1 to +2
dynamic_fields:
"@timestamp": "^[0-9]{4}(-[0-9]{2}){2}T[0-9]{2}(:[0-9]{2}){2}\\.[0-9]{3}"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As suggested in #4950, added this dynamic field to fix tests due to timestamps:

--- want
+++ got
@@ -1,7 +1,7 @@
 {
     "expected": [
         {
-            "@timestamp": "2022-05-21T21:54:44.000Z",
+            "@timestamp": "2023-05-21T21:54:44.000Z",
             "ecs": {
                 "version": "8.0.0"
             },

@mrodm mrodm force-pushed the migrate_system_dashboards_by_value branch from b147231 to 936d41c Compare January 17, 2023 18:00
Comment on lines 67 to -66
"migrationVersion": {
"visualization": "7.10.0"
"visualization": "8.0.0"
},
"namespaces": [
"default"
],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't know why this namespaces field is removed.
These dashboards have been exported using elastic-package export dashboards command.

@mrodm mrodm requested a review from a team January 17, 2023 18:18
@mrodm mrodm marked this pull request as ready for review January 17, 2023 18:18
@mrodm mrodm requested review from a team as code owners January 17, 2023 18:18
Comment on lines 2 to 6
- version: "1.21.0-next"
changes:
- description: Migrate dashboards to be by value
type: enhancement
link: https://github.com/elastic/integrations/pull/5023
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added just an entry in changelog with -next suffix so it is not going to be published.

In this way, @elastic/elastic-agent-data-plane can decide when it needs to be released by updating the manifest and removing this suffix in another PR.

@cmacknz cmacknz added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team [elastic/elastic-agent-data-plane] label Jan 18, 2023
@elasticmachine
Copy link

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@elasticmachine
Copy link

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@cmacknz cmacknz requested a review from a team January 18, 2023 15:31
@cmacknz
Copy link
Member

cmacknz commented Jan 18, 2023

I think some of the visualizations here were created by the SEI team, we will want them to review as well.

andrewkroh
andrewkroh previously approved these changes Jan 18, 2023
Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

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

I tested that they all still load in 8.1.0. 👍 (I didn't have data populated for them though)

packages/system/changelog.yml Outdated Show resolved Hide resolved
@andrewkroh andrewkroh dismissed their stale review January 18, 2023 16:01

Apparently I wasn't testing 1.21.0-next. I used elastic-package install successfully, but I still had 1.20.4 installed. So I can't say that I tested it.

Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

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

This time I can confirm that they all still load (😄 and that I was testing this code).

@andrewkroh andrewkroh changed the title Migrate system dashboards by value [System] Migrate dashboards to "by value" Jan 18, 2023
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "1.21.0-next"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we normally tag versions here with -next? Don't know if I've seen that on an integration before?

Copy link
Contributor Author

@mrodm mrodm Jan 18, 2023

Choose a reason for hiding this comment

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

If -next is added to the version, it is not published. This can be used to allow other PRs to be added without releasing.

Here is a doc about it where it shows a possible use case: https://github.com/elastic/integrations/blob/main/docs/developer_workflow_design_build_test_integration.md#remember-to-bump-up-the-version

I set the version as this (without updating manifest.yml), so the package owner team can release this when they decide.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As talked to @jlind23 and @pierrehilbert about this versioning, I'll update the changelog entry and the manifest to be 1.21.0 version. So once it is merged, it will be published.

Copy link
Contributor

@drewdaemon drewdaemon left a comment

Choose a reason for hiding this comment

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

This is great.

But I'm wondering: why was this done manually instead of using our automated tooling?

@mrodm
Copy link
Contributor Author

mrodm commented Jan 19, 2023

But I'm wondering: why was this done manually instead of using our automated tooling?

I didn't know about that tool, and as I needed to just migrate specific visualizations I did it manually following the process in the description of the PR. Taking advantage of the "Unlink from library" button and using elastic-package export dashboards.

@mrodm mrodm merged commit 33adbbe into elastic:main Jan 19, 2023
@mrodm mrodm deleted the migrate_system_dashboards_by_value branch January 19, 2023 14:08
@elasticmachine
Copy link

Package system - 1.21.0 containing this change is available at https://epr.elastic.co/search?package=system

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Integration:system System Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team [elastic/elastic-agent-data-plane]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate system dashboards to by value
6 participants