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

[Infra] Create endpoint to verify if there is data #189470

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

crespocarlos
Copy link
Contributor

@crespocarlos crespocarlos commented Jul 30, 2024

closes 189247

Summary

Create an endpoint to return whether there is data for modules passed via modules query param. When modules is not passed, the query will just check if there is any data in the index patterns configured in the Settings page

How to test

  • Start a local Kibana instance
  • Run node scripts/synthtrace infra_hosts_with_apm_hosts --live
  • Run in the Dev tools:
    • GET kbn:/api/metrics/source/hasData?modules=kubernetes&modules=system
    • GET kbn:/api/metrics/source/hasData?modules=system
    • GET kbn:/api/metrics/source/hasData?modules=kubernetes&modules=system&modules=kafka&modules=aws&modules=azure - should return 400
    • GET kbn:/api/metrics/source/hasData

@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!)

@crespocarlos crespocarlos changed the title [Infra] Create endpoint to check if there is data for a given module [Infra] Create endpoint to verify if there is data Jul 30, 2024
@crespocarlos crespocarlos force-pushed the 189247-hasData-endpoint branch 2 times, most recently from bcdcc36 to b4d2a7d Compare July 30, 2024 09:57
@crespocarlos crespocarlos force-pushed the 189247-hasData-endpoint branch from b4d2a7d to be1770b Compare July 30, 2024 11:21
@crespocarlos
Copy link
Contributor Author

/ci

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #8 / ColumnsPopover renders correctly a list of selected columns

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
infra 1.5MB 1.5MB -116.0B

History

  • 💔 Build #224601 failed b4d2a7d6b0f455cc62d0f1c2b5846ff34b88c898
  • 💔 Build #224558 failed c8bd27a671825b370a180d31f7064f52bcf5e358

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

@crespocarlos crespocarlos marked this pull request as ready for review July 30, 2024 13:32
@crespocarlos crespocarlos requested review from a team as code owners July 30, 2024 13:32
@crespocarlos crespocarlos added release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team v8.16.0 labels Jul 30, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

Copy link
Contributor

@cauemarcondes cauemarcondes left a comment

Choose a reason for hiding this comment

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

LGTM

@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Jul 30, 2024
.expect(expectedHttpStatusCode);
};

before(() => patchRequest({ name: 'default', metricAlias: 'metrics-*,metricbeat-*' }));
Copy link
Member

Choose a reason for hiding this comment

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

I've seen much code in our repo that does this syntax, dropping the async / await.
Is there no worry of a timing issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it returns a promise, jest should recognize it as an async operation a treat it accordingly

Copy link
Member

Choose a reason for hiding this comment

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

Indeed, thanks for sharing your perspective.

Copy link
Member

Choose a reason for hiding this comment

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

One question, can you tell me which Jest config this test is apart of?

Copy link
Member

@dmlemeshko dmlemeshko left a comment

Choose a reason for hiding this comment

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

LGTM Code review only.

I'm still confused why we are required as code owners when it is set to:

/x-pack/test/api_integration/apis/infra @elastic/obs-ux-infra_services-team

Copy link
Member

@wayneseymour wayneseymour left a comment

Choose a reason for hiding this comment

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

Just one nit.

@crespocarlos crespocarlos merged commit ea64b47 into elastic:main Jul 30, 2024
29 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jul 30, 2024
@crespocarlos crespocarlos deleted the 189247-hasData-endpoint branch July 30, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Infra] Endpoint to check if there is data
8 participants