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] use auto ops service #196312

Merged
merged 10 commits into from
Oct 17, 2024

Conversation

neptunian
Copy link
Contributor

@neptunian neptunian commented Oct 15, 2024

Summary

  • use AutoOpsAPIService service and removes mock data
  • removes checking for serviceConfig.enabled to register routes as they won't register if the plugin isn't enabled
  • adds UI toasts with error message when requests fail
  • adds centralized DataUsageService for managing other services

@@ -78,7 +81,7 @@ class AutoOpsAPIService {
},
};

const response = await axios<UsageMetricsResponseSchemaBody>(requestConfig).catch(
const response = await axios<UsageMetricsAutoOpsResponseSchemaBody>(requestConfig).catch(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

check against the auto ops response instead of our api response

@neptunian neptunian added release_note:skip Skip the PR/issue when compiling release notes backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Oct 15, 2024
@neptunian
Copy link
Contributor Author

/ci

@neptunian neptunian marked this pull request as ready for review October 15, 2024 15:11
@neptunian neptunian requested review from a team as code owners October 15, 2024 15:11
@neptunian neptunian added backport:version Backport to applied version labels v8.16.0 v8.17.0 and removed backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Oct 15, 2024
@neptunian neptunian requested a review from ashokaditya October 16, 2024 20:25
@@ -53,6 +53,8 @@ export class DataUsagePlugin
}
setup(coreSetup: CoreSetup, pluginsSetup: DataUsageSetupDependencies): DataUsageServerSetup {
this.logger.debug('data usage plugin setup');
const dataUsageService = new DataUsageService(this.dataUsageContext);
Copy link
Member

Choose a reason for hiding this comment

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

I was thinking of adding only the auto ops service to the appContextService on start, but this is much neater. 🚀

Comment on lines +30 to +31
from: string;
to: string;
Copy link
Member

Choose a reason for hiding this comment

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

I'm hoping they come through with strings for date ranges. I don't see the open API spec updated yet about it. 🤞🏼

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
dataUsage 237.4KB 237.8KB +415.0B

History

@neptunian neptunian removed the v8.16.0 label Oct 17, 2024
@neptunian neptunian added backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) backport:skip This commit does not require backporting and removed backport:version Backport to applied version labels v8.17.0 backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) backport:skip This commit does not require backporting labels Oct 17, 2024
@neptunian neptunian merged commit 7af4c6d into elastic:main Oct 17, 2024
46 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11391746068

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 17, 2024
## Summary

- use AutoOpsAPIService service and removes mock data
- removes checking for serviceConfig.enabled to register routes as they
won't register if the plugin isn't enabled
- adds UI toasts with error message when requests fail
- adds centralized DataUsageService for managing other services

(cherry picked from commit 7af4c6d)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Oct 17, 2024
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Data Usage] use auto ops service
(#196312)](#196312)

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

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

<!--BACKPORT [{"author":{"name":"Sandra
G","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-17T19:30:05Z","message":"[Data
Usage] use auto ops service (#196312)\n\n## Summary\r\n\r\n- use
AutoOpsAPIService service and removes mock data\r\n- removes checking
for serviceConfig.enabled to register routes as they\r\nwon't register
if the plugin isn't enabled\r\n- adds UI toasts with error message when
requests fail\r\n- adds centralized DataUsageService for managing other
services","sha":"7af4c6da4a08b6452c0c6e1264d1ceffbf628c42","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor"],"title":"[Data
Usage] use auto ops
service","number":196312,"url":"https://github.com/elastic/kibana/pull/196312","mergeCommit":{"message":"[Data
Usage] use auto ops service (#196312)\n\n## Summary\r\n\r\n- use
AutoOpsAPIService service and removes mock data\r\n- removes checking
for serviceConfig.enabled to register routes as they\r\nwon't register
if the plugin isn't enabled\r\n- adds UI toasts with error message when
requests fail\r\n- adds centralized DataUsageService for managing other
services","sha":"7af4c6da4a08b6452c0c6e1264d1ceffbf628c42"}},"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/196312","number":196312,"mergeCommit":{"message":"[Data
Usage] use auto ops service (#196312)\n\n## Summary\r\n\r\n- use
AutoOpsAPIService service and removes mock data\r\n- removes checking
for serviceConfig.enabled to register routes as they\r\nwon't register
if the plugin isn't enabled\r\n- adds UI toasts with error message when
requests fail\r\n- adds centralized DataUsageService for managing other
services","sha":"7af4c6da4a08b6452c0c6e1264d1ceffbf628c42"}}]}]
BACKPORT-->

Co-authored-by: Sandra G <[email protected]>
@neptunian neptunian added v8.16.0 backport:version Backport to applied version labels labels Oct 21, 2024
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.16, 8.x

https://github.com/elastic/kibana/actions/runs/11447623095

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 21, 2024
## Summary

- use AutoOpsAPIService service and removes mock data
- removes checking for serviceConfig.enabled to register routes as they
won't register if the plugin isn't enabled
- adds UI toasts with error message when requests fail
- adds centralized DataUsageService for managing other services

(cherry picked from commit 7af4c6d)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.16
8.x Cherrypick failed because the selected commit (7af4c6d) is empty. It looks like the commit was already backported in #196769

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 196312

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Oct 21, 2024
# Backport

This will backport the following commits from `main` to `8.16`:
- [[Data Usage] use auto ops service
(#196312)](#196312)

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

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

<!--BACKPORT [{"author":{"name":"Sandra
G","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-17T19:30:05Z","message":"[Data
Usage] use auto ops service (#196312)\n\n## Summary\r\n\r\n- use
AutoOpsAPIService service and removes mock data\r\n- removes checking
for serviceConfig.enabled to register routes as they\r\nwon't register
if the plugin isn't enabled\r\n- adds UI toasts with error message when
requests fail\r\n- adds centralized DataUsageService for managing other
services","sha":"7af4c6da4a08b6452c0c6e1264d1ceffbf628c42","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","v8.16.0","backport:version","v8.17.0"],"title":"[Data
Usage] use auto ops
service","number":196312,"url":"https://github.com/elastic/kibana/pull/196312","mergeCommit":{"message":"[Data
Usage] use auto ops service (#196312)\n\n## Summary\r\n\r\n- use
AutoOpsAPIService service and removes mock data\r\n- removes checking
for serviceConfig.enabled to register routes as they\r\nwon't register
if the plugin isn't enabled\r\n- adds UI toasts with error message when
requests fail\r\n- adds centralized DataUsageService for managing other
services","sha":"7af4c6da4a08b6452c0c6e1264d1ceffbf628c42"}},"sourceBranch":"main","suggestedTargetBranches":["8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196312","number":196312,"mergeCommit":{"message":"[Data
Usage] use auto ops service (#196312)\n\n## Summary\r\n\r\n- use
AutoOpsAPIService service and removes mock data\r\n- removes checking
for serviceConfig.enabled to register routes as they\r\nwon't register
if the plugin isn't enabled\r\n- adds UI toasts with error message when
requests fail\r\n- adds centralized DataUsageService for managing other
services","sha":"7af4c6da4a08b6452c0c6e1264d1ceffbf628c42"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/196769","number":196769,"state":"MERGED","mergeCommit":{"sha":"d2bcd89599918d7094b2c16dbfb34a227e762441","message":"[8.x]
[Data Usage] use auto ops service (#196312) (#196769)\n\n#
Backport\n\nThis will backport the following commits from `main` to
`8.x`:\n- [[Data Usage] use auto ops
service\n(#196312)](https://github.com/elastic/kibana/pull/196312)\n\n<!---
Backport version: 9.4.3 -->\n\n### Questions ?\nPlease refer to the
[Backport
tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT
[{\"author\":{\"name\":\"Sandra\nG\",\"email\":\"[email protected]\"},\"sourceCommit\":{\"committedDate\":\"2024-10-17T19:30:05Z\",\"message\":\"[Data\nUsage]
use auto ops service (#196312)\\n\\n## Summary\\r\\n\\r\\n-
use\nAutoOpsAPIService service and removes mock data\\r\\n- removes
checking\nfor serviceConfig.enabled to register routes as
they\\r\\nwon't register\nif the plugin isn't enabled\\r\\n- adds UI
toasts with error message when\nrequests fail\\r\\n- adds centralized
DataUsageService for managing
other\nservices\",\"sha\":\"7af4c6da4a08b6452c0c6e1264d1ceffbf628c42\",\"branchLabelMapping\":{\"^v9.0.0$\":\"main\",\"^v8.17.0$\":\"8.x\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"release_note:skip\",\"v9.0.0\",\"backport:prev-minor\"],\"title\":\"[Data\nUsage]
use auto
ops\nservice\",\"number\":196312,\"url\":\"https://github.com/elastic/kibana/pull/196312\",\"mergeCommit\":{\"message\":\"[Data\nUsage]
use auto ops service (#196312)\\n\\n## Summary\\r\\n\\r\\n-
use\nAutoOpsAPIService service and removes mock data\\r\\n- removes
checking\nfor serviceConfig.enabled to register routes as
they\\r\\nwon't register\nif the plugin isn't enabled\\r\\n- adds UI
toasts with error message when\nrequests fail\\r\\n- adds centralized
DataUsageService for managing
other\nservices\",\"sha\":\"7af4c6da4a08b6452c0c6e1264d1ceffbf628c42\"}},\"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/196312\",\"number\":196312,\"mergeCommit\":{\"message\":\"[Data\nUsage]
use auto ops service (#196312)\\n\\n## Summary\\r\\n\\r\\n-
use\nAutoOpsAPIService service and removes mock data\\r\\n- removes
checking\nfor serviceConfig.enabled to register routes as
they\\r\\nwon't register\nif the plugin isn't enabled\\r\\n- adds UI
toasts with error message when\nrequests fail\\r\\n- adds centralized
DataUsageService for managing
other\nservices\",\"sha\":\"7af4c6da4a08b6452c0c6e1264d1ceffbf628c42\"}}]}]\nBACKPORT-->\n\nCo-authored-by:
Sandra G <[email protected]>"}}]}] BACKPORT-->

Co-authored-by: Sandra G <[email protected]>
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) backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes v8.16.0 v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants