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

[Data Usage] New plugin #193466

Merged
merged 8 commits into from
Sep 20, 2024
Merged

[Data Usage] New plugin #193466

merged 8 commits into from
Sep 20, 2024

Conversation

neptunian
Copy link
Contributor

@neptunian neptunian commented Sep 19, 2024

The initial serverless only plugin for viewing data usage and retention in Management. The purpose of this PR is to provide a place for other engineers to work on it, hidden from public use.

  • Plugin is hidden by default and can be enabled through kibana.yml
    xpack.dataUsage.enabled: true
  • Currently it will show up in both stateful and serverless (if enabled using config above). When we are ready to make the plugin available we will enable it in config/serverless.yml
  • Renders a card in Management (serverless) when enabled:
Screenshot 2024-09-19 at 4 14 15 PM

#192965
#192966

@neptunian neptunian added the release_note:skip Skip the PR/issue when compiling release notes label Sep 19, 2024
@neptunian neptunian requested review from a team as code owners September 19, 2024 18:38
@obltmachine
Copy link

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@neptunian neptunian added v8.16.0 backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) and removed v8.16.0 labels Sep 19, 2024
@neptunian neptunian requested a review from a team as a code owner September 19, 2024 19:48
Copy link
Member

@jbudz jbudz left a comment

Choose a reason for hiding this comment

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

limits.yml

@neptunian
Copy link
Contributor Author

/ci

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #9 / OpenLensButton calls navigateToPrefilledEditor correctly

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
dataUsage - 30 +30

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
dataUsage - 6 +6

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
dataUsage - 6.7KB +6.7KB
management 45.9KB 46.1KB +219.0B
total +6.9KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
dataUsage - 4.0KB +4.0KB
serverless 14.0KB 14.1KB +168.0B
serverlessObservability 27.0KB 27.2KB +168.0B
serverlessSearch 20.8KB 21.0KB +168.0B
total +4.5KB
Unknown metric groups

API count

id before after diff
dataUsage - 6 +6

async chunk count

id before after diff
dataUsage - 1 +1

ESLint disabled in files

id before after diff
dataUsage - 1 +1

ESLint disabled line counts

id before after diff
dataUsage - 3 +3

Total ESLint disabled count

id before after diff
dataUsage - 4 +4

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Member

@sabarasaba sabarasaba left a comment

Choose a reason for hiding this comment

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

cards navigation changes lgtm

Copy link
Contributor

@gsoldevila gsoldevila left a comment

Choose a reason for hiding this comment

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

Core changes LGTM!

@neptunian neptunian merged commit bda0859 into elastic:main Sep 20, 2024
39 checks passed
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

You might need to backport the following PRs to 8.x:
- [ML] Anomaly Explorer: Hide top influencers panel for jobs without influencers (#192987)
- [Console] Add remote_indices to autocomplete overrides (#193403)
- [Console] Fix and skip flaky tests (#193508)
- [react@18] bump styled-components (#192368)
- [Response Ops][Rules] Rule Model Version Forward Compat (#193233)
- [Onboarding] Add mappings component to index details page (#193314)
- [EDR Workflows] Update Osquery and ECS fields schemas (#193399)
- [[ES

Manual backport

To create the backport manually run:

node scripts/backport --pr 193466

Questions ?

Please refer to the Backport tool documentation

neptunian added a commit to neptunian/kibana that referenced this pull request Sep 20, 2024
The initial serverless only plugin for viewing data usage and retention
in Management. The purpose of this PR is to provide a place for other
engineers to work on it, hidden from public use.

- Plugin is hidden by default and can be enabled through kibana.yml
`xpack.dataUsage.enabled: true`
- Currently it will show up in both stateful and serverless (if enabled
using config above). When we are ready to make the plugin available we
will enable it in config/serverless.yml
- Renders a card in Management (serverless) when enabled:
<img width="1269" alt="Screenshot 2024-09-19 at 4 14 15 PM"
src="https://github.com/user-attachments/assets/705e3866-bc88-436a-8532-2af53167f7b1">

elastic#192965
elastic#192966

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
jbudz pushed a commit that referenced this pull request Sep 20, 2024
The initial serverless only plugin for viewing data usage and retention
in Management. The purpose of this PR is to provide a place for other
engineers to work on it, hidden from public use.

- Plugin is hidden by default and can be enabled through kibana.yml
`xpack.dataUsage.enabled: true`
- Currently it will show up in both stateful and serverless (if enabled
using config above). When we are ready to make the plugin available we
will enable it in config/serverless.yml
- Renders a card in Management (serverless) when enabled: <img
width="1269" alt="Screenshot 2024-09-19 at 4 14 15 PM"
src="https://github.com/user-attachments/assets/705e3866-bc88-436a-8532-2af53167f7b1">

#192965
#192966

---------

## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.


### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
ashokaditya added a commit that referenced this pull request Oct 8, 2024
…ject metrics API (#193966)

## Summary
<img width="2365" alt="Screenshot 2024-10-07 at 10 28 51 AM"
src="https://github.com/user-attachments/assets/5c90a95d-d09d-4b44-8af3-5ca0361a5dc9">


Adds the bulk of the code for new [Data Usage
plugin](#193466). Plugin is still
disabled by default and will be enabled later for serverless only.

- UI components (filters, charts)
- Adds an internal API route that provides visualization data to render
data usage charts for serverless.

### request example
```json5
GET /internal/api/data_usage/metrics?from=1726858530000&to=1726908930000&size=0&metricTypes=ingest_rate&metricTypes=storage_retained&dataStreams=ds_name_1&dataStreams=ds_name_2
```

### Checklist
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

---------

Co-authored-by: neptunian <sandra.gonzales@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 8, 2024
…ject metrics API (elastic#193966)

## Summary
<img width="2365" alt="Screenshot 2024-10-07 at 10 28 51 AM"
src="https://github.com/user-attachments/assets/5c90a95d-d09d-4b44-8af3-5ca0361a5dc9">

Adds the bulk of the code for new [Data Usage
plugin](elastic#193466). Plugin is still
disabled by default and will be enabled later for serverless only.

- UI components (filters, charts)
- Adds an internal API route that provides visualization data to render
data usage charts for serverless.

### request example
```json5
GET /internal/api/data_usage/metrics?from=1726858530000&to=1726908930000&size=0&metricTypes=ingest_rate&metricTypes=storage_retained&dataStreams=ds_name_1&dataStreams=ds_name_2
```

### Checklist
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

---------

Co-authored-by: neptunian <sandra.gonzales@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit cb9f998)
kibanamachine added a commit that referenced this pull request Oct 8, 2024
…ss project metrics API (#193966) (#195412)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[DataUsage] Add internal API/UX hooks to interact with serverless
project metrics API
(#193966)](#193966)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"Ash","email":"1849116+ashokaditya@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-10-08T13:17:12Z","message":"[DataUsage]
Add internal API/UX hooks to interact with serverless project metrics
API (#193966)\n\n## Summary\r\n<img width=\"2365\" alt=\"Screenshot
2024-10-07 at 10 28
51 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/5c90a95d-d09d-4b44-8af3-5ca0361a5dc9\">\r\n\r\n\r\nAdds
the bulk of the code for new [Data
Usage\r\nplugin](#193466). Plugin
is still\r\ndisabled by default and will be enabled later for serverless
only.\r\n\r\n- UI components (filters, charts)\r\n- Adds an internal API
route that provides visualization data to render\r\ndata usage charts
for serverless.\r\n\r\n### request example\r\n```json5\r\nGET
/internal/api/data_usage/metrics?from=1726858530000&to=1726908930000&size=0&metricTypes=ingest_rate&metricTypes=storage_retained&dataStreams=ds_name_1&dataStreams=ds_name_2\r\n```\r\n\r\n###
Checklist\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n\r\n---------\r\n\r\nCo-authored-by:
neptunian <sandra.gonzales@elastic.co>\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"cb9f998c064f4519afd9e7bbf73c9c55ef7059b3","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor"],"title":"[DataUsage]
Add internal API/UX hooks to interact with serverless project metrics
API","number":193966,"url":"https://github.com/elastic/kibana/pull/193966","mergeCommit":{"message":"[DataUsage]
Add internal API/UX hooks to interact with serverless project metrics
API (#193966)\n\n## Summary\r\n<img width=\"2365\" alt=\"Screenshot
2024-10-07 at 10 28
51 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/5c90a95d-d09d-4b44-8af3-5ca0361a5dc9\">\r\n\r\n\r\nAdds
the bulk of the code for new [Data
Usage\r\nplugin](#193466). Plugin
is still\r\ndisabled by default and will be enabled later for serverless
only.\r\n\r\n- UI components (filters, charts)\r\n- Adds an internal API
route that provides visualization data to render\r\ndata usage charts
for serverless.\r\n\r\n### request example\r\n```json5\r\nGET
/internal/api/data_usage/metrics?from=1726858530000&to=1726908930000&size=0&metricTypes=ingest_rate&metricTypes=storage_retained&dataStreams=ds_name_1&dataStreams=ds_name_2\r\n```\r\n\r\n###
Checklist\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n\r\n---------\r\n\r\nCo-authored-by:
neptunian <sandra.gonzales@elastic.co>\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"cb9f998c064f4519afd9e7bbf73c9c55ef7059b3"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193966","number":193966,"mergeCommit":{"message":"[DataUsage]
Add internal API/UX hooks to interact with serverless project metrics
API (#193966)\n\n## Summary\r\n<img width=\"2365\" alt=\"Screenshot
2024-10-07 at 10 28
51 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/5c90a95d-d09d-4b44-8af3-5ca0361a5dc9\">\r\n\r\n\r\nAdds
the bulk of the code for new [Data
Usage\r\nplugin](#193466). Plugin
is still\r\ndisabled by default and will be enabled later for serverless
only.\r\n\r\n- UI components (filters, charts)\r\n- Adds an internal API
route that provides visualization data to render\r\ndata usage charts
for serverless.\r\n\r\n### request example\r\n```json5\r\nGET
/internal/api/data_usage/metrics?from=1726858530000&to=1726908930000&size=0&metricTypes=ingest_rate&metricTypes=storage_retained&dataStreams=ds_name_1&dataStreams=ds_name_2\r\n```\r\n\r\n###
Checklist\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n\r\n---------\r\n\r\nCo-authored-by:
neptunian <sandra.gonzales@elastic.co>\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"cb9f998c064f4519afd9e7bbf73c9c55ef7059b3"}}]}]
BACKPORT-->

Co-authored-by: Ash <1849116+ashokaditya@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants