-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Use Saved Objects API for exporting and importing dashboards #27220
Conversation
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
e8e9a47
to
1d96f7f
Compare
1d96f7f
to
2d44a6c
Compare
Pinging @elastic/agent (Team:Agent) |
@mtojek once this goes in it will affect the beats import script, as this is already converting dashboards. On the other side, I don't think we are using the same format, thoughts? |
I have added it to our development documentation. Let me know if that is not clear. Also, I am adding it to the changelog soon. |
That sounds good. Any idea about the support matrix? I'm having a hard time interpreting what compatibility guarantees are made there. |
Well, what I inferred from the support matrix is that version(Beats) <= version(Elasticsearch): https://www.elastic.co/support/matrix#matrix_compatibility This is also what we agreed on in: #20672 (comment) |
jenkins run tests |
1 similar comment
jenkins run tests |
} | ||
} | ||
|
||
func decodeLine(line []byte) []byte { |
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.
I think json.Unmarshal will return an error if you try to decode an empty slice.
You might want to do a if len(bytes.TrimSpace(line)) == 0 { return }
. This handles both empty slices and blank lines (which are allowable per the NDJSON spec you linked to.)
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.
👍 I have added this check to more functions that needed it.
Failing test is unrelated. |
This PR adopts the Saved Objects API for exporting and importing dashboards and index templates. We have agreed to provide essential support, so there are a few limitations: * You can only import assets they have exported using Beats 7.15 and the assets we ship with Beats. * You can only export new assets, not legacy format. We have to move forward to let Kibana remove the old API. Try to setup the dashboards of a Beat: ```sh ./filebeat setup --dashboards ``` Export dashboards: ```sh ./filebeat export dashboard --id {my-id} ``` and: ```sh go run dev-tools/cmd/dashboards/export_dashboards.go -dashboard {my-id} ``` The changeset is huge, but most of it comes from converting the dashboards. I suggest you use the file filter and disable json, ndjson and yml files. The changes are moving json to ndjson format and changing the extensions in the module.yml files from json to ndjson. Please also test it manually with both the setup command and `export_dashboards.go`. Closes #20672
…#27398) This PR adopts the Saved Objects API for exporting and importing dashboards and index templates. We have agreed to provide essential support, so there are a few limitations: * You can only import assets they have exported using Beats 7.15 and the assets we ship with Beats. * You can only export new assets, not legacy format. We have to move forward to let Kibana remove the old API. Try to setup the dashboards of a Beat: ```sh ./filebeat setup --dashboards ``` Export dashboards: ```sh ./filebeat export dashboard --id {my-id} ``` and: ```sh go run dev-tools/cmd/dashboards/export_dashboards.go -dashboard {my-id} ``` The changeset is huge, but most of it comes from converting the dashboards. I suggest you use the file filter and disable json, ndjson and yml files. The changes are moving json to ndjson format and changing the extensions in the module.yml files from json to ndjson. Please also test it manually with both the setup command and `export_dashboards.go`. Closes #20672 Co-authored-by: Noémi Ványi <[email protected]>
What does this PR do?
This PR adopts the Saved Objects API for exporting and importing dashboards and index templates. We have agreed to provide essential support, so there are a few limitations:
TODO
Why is it important?
We have to move forward to let Kibana remove the old API.
Checklist
- [ ] I have made corresponding change to the default configuration filesCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
Try to setup the dashboards of a Beat:
Export dashboards:
./filebeat export dashboard --id {my-id}
and:
Notes to the reviewer
The changeset is huge, but most of it comes from converting the dashboards. I suggest you use the file filter and disable json, ndjson and yml files. The changes are moving json to ndjson format and changing the extensions in the module.yml files from json to ndjson.
Please also test it manually with both the setup command and
export_dashboards.go
.Related issues
Closes #20672