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

Check for indices before enabling get search profile in serverless #201630

Merged
merged 9 commits into from
Dec 4, 2024

Conversation

SoniaSanzV
Copy link
Contributor

@SoniaSanzV SoniaSanzV commented Nov 25, 2024

Closes #195342

Summary

In serverless, the default query for the search profiler fails if there is not indices. For avoiding this error, when there are no indices present, this PR disabled the "Profile" button and add a tooltip explaining why it is disabled.

New strings

This is the tooltip for string verification @kibana-docs [Code]:
Screenshot 2024-11-25 at 16 15 08

How to test

  • Run Kibana in serverless
  • Go to Index Management and verify you haven't indices (or delete them if you do have indices).
  • Go to Dev Tools and click the Search Profiler tab. Verify that the button is disabled and the tooltip displayed if you hover over it.
  • Go back to Index Management and create one or more indices.
  • Go back to Dev Tools > Search Profiler. Now the button should be enabled and the profile should be created if you click it.

Demo

Screen.Recording.2024-11-25.at.16.02.24.mov

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines

@SoniaSanzV SoniaSanzV added Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more release_note:skip Skip the PR/issue when compiling release notes Feature:Search Profiler backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) labels Nov 25, 2024
@SoniaSanzV SoniaSanzV requested a review from a team November 25, 2024 15:24
@SoniaSanzV SoniaSanzV self-assigned this Nov 25, 2024
@SoniaSanzV SoniaSanzV requested a review from a team as a code owner November 25, 2024 15:24
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-management (Team:Kibana Management)

@SoniaSanzV SoniaSanzV changed the title Verify if there are indices before leverage search profile Verify if there are indices before enabling get search profile Nov 25, 2024
@SoniaSanzV SoniaSanzV changed the title Verify if there are indices before enabling get search profile Check for indexes before enabling get search profile in serverless Nov 25, 2024
@SoniaSanzV SoniaSanzV changed the title Check for indexes before enabling get search profile in serverless Check for indices before enabling get search profile in serverless Nov 25, 2024
Copy link
Contributor

@florent-leborgne florent-leborgne left a comment

Choose a reason for hiding this comment

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

Hi! Small suggestion on the copy to use an active voice 🚗

<EuiToolTip
position="top"
content={i18n.translate('xpack.searchProfiler.formProfileButtonTooltip', {
defaultMessage: 'An index must be created before leveraging Search Profiler',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
defaultMessage: 'An index must be created before leveraging Search Profiler',
defaultMessage: 'You must have at least one index to use Search Profiler',

Attempt to make the sentence active

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your feedback. Changed :)

@SoniaSanzV SoniaSanzV force-pushed the searchProfile_verify_indices branch from 5832a76 to c4e45db Compare November 26, 2024 07:03
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.

Nice work @SoniaSanzV! Tested locally and all works well. I do have a few things I'd like to discuss further in terms of implementation, but let me know what you think!

<EuiText>
{i18n.translate('xpack.searchProfiler.formProfileButtonLabel', {
defaultMessage: 'Profile',
{licenseEnabled && !hasIndices ? (
Copy link
Member

Choose a reason for hiding this comment

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

It feels a bit odd to redefine the button twice based on the conditionals provided, how about we refactor it a little bit to avoid redefining elements? I was thinking perhaps something like this might work:

const isDisabled = !licenseEnabled || !hasIndices;
const tooltipContent = i18n.translate('xpack.searchProfiler.formProfileButtonTooltip', {
  defaultMessage: 'You must have at least one index to use Search Profiler',
});

const button = (
  <EuiButton
    data-test-subj={isDisabled ? 'disabledProfileButton' : 'profileButton'}
    fill
    disabled={isDisabled}
    onClick={!isDisabled ? handleProfileClick : undefined}
  >
    <EuiText>
      {i18n.translate('xpack.searchProfiler.formProfileButtonLabel', {
        defaultMessage: 'Profile',
      })}
    </EuiText>
  </EuiButton>
);

... 
{isDisabled ? (
  <EuiToolTip position="top" content={tooltipContent}>
    {button}
  </EuiToolTip>
) : (
  button
)};

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, I agree is odd. I did this way because the tooltip is only displayed when there is not indices. But I can think on a way of avoiding duplicate code.

);
router.get(
{
path: '/api/searchprofiler/getIndices',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
path: '/api/searchprofiler/getIndices',
path: '/api/searchprofiler/get_indices',

@SoniaSanzV SoniaSanzV force-pushed the searchProfile_verify_indices branch 2 times, most recently from c55824a to b2a6b66 Compare November 27, 2024 10:24
@SoniaSanzV
Copy link
Contributor Author

@florent-leborgne I changed what you requested an added a new tooltip [in code]. It would be shown when the user hasn't a valid license and when it happens we already show a banner at top level

Screenshot 2024-11-26 at 13 52 51

Copy link
Contributor

@florent-leborgne florent-leborgne left a comment

Choose a reason for hiding this comment

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

@SoniaSanzV thanks for the ping. Let me know if the suggestion sounds good to you

const isDisabled = !licenseEnabled || !hasIndices;
const tooltipContent = !licenseEnabled
? i18n.translate('xpack.searchProfiler.formProfileButton.noLicenseTooltip', {
defaultMessage: 'You do not have the license to use Search Profiler',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
defaultMessage: 'You do not have the license to use Search Profiler',
defaultMessage: 'You need an active license to use Search Profiler',

Would that work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, that sounds so much better! Changed, thank you!

@SoniaSanzV SoniaSanzV force-pushed the searchProfile_verify_indices branch from b2a6b66 to 62b484a Compare November 27, 2024 10:46
@SoniaSanzV SoniaSanzV force-pushed the searchProfile_verify_indices branch from 62b484a to 510c707 Compare November 28, 2024 12:59
@sabarasaba
Copy link
Member

@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.

Thanks for addressing my feedback @SoniaSanzV! Left few more comments, let me know what you think

return response.ok({
body: {
ok: true,
hasIndices,
Copy link
Member

Choose a reason for hiding this comment

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

this is a bit strange to me, the api endpoint is called get_indices so I would be expecting a list of indices but in reality it returns a boolean that says whether it has indices or not.

I think we can rename this api endpoint to then be something slightly more semantic such as has_indices which clearly reflects that the API checks if indices exists or not. Also we dont need the ok: true since we have the http status code if needed.

Likewise the useIndices hook in the UI I think we could also rename to something like useHasIndices, in order to properly reflect which endpoint is calling.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, it makes more sense

Comment on lines 93 to 95
useEffect(() => {
setHasIndices(indicesData?.ok ? indicesData?.hasIndices : false);
}, [indicesData]);
Copy link
Member

Choose a reason for hiding this comment

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

I think we can remove the complexity of the useEffect and the useState by leveraging the states returned from the useIndices hook.

  const { data: indicesData, isLoading, error } = useIndices();
  ...
  const hasIndices = (isLoading || error) ? false : indicesData?.hasIndices;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed!

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.

Nice job, latest changes lgtm! Just one last comment 🚀


return response.ok({
body: {
ok: true,
Copy link
Member

Choose a reason for hiding this comment

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

I dont think we need the ok: true anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i missed that part of your previous comment 😓

@SoniaSanzV SoniaSanzV enabled auto-merge (squash) December 4, 2024 11:46
@SoniaSanzV SoniaSanzV merged commit 41bd2af into elastic:main Dec 4, 2024
8 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

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

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #15 / useHistoryBlock without search params should block if edited and not navigate on cancel

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
searchprofiler 79 80 +1

Async chunks

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

id before after diff
searchprofiler 48.5KB 49.0KB +587.0B

Page load bundle

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

id before after diff
searchprofiler 15.6KB 15.7KB +132.0B

History

cc @SoniaSanzV

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 4, 2024
…lastic#201630)

Closes [elastic#195342](elastic#195342)

## Summary
In serverless, the default query for the search profiler fails if there
is not indices. For avoiding this error, when there are no indices
present, this PR disabled the "Profile" button and add a tooltip
explaining why it is disabled.

### New strings
This is the tooltip for string verification @kibana-docs
[[Code](https://github.com/elastic/kibana/pull/201630/commits/5832a76683ad0cf55558655ca5981d623f344b72?diff=unified&w=0#diff-bf48cd9834b39a2a1634680225fc63c9a4ddb3ca881d9120f648006ad0277046R154-R1552?diff=unified&w=0#diff-bf48cd9834b39a2a1634680225fc63c9a4ddb3ca881d9120f648006ad0277046R155)]:
<img width="460" alt="Screenshot 2024-11-25 at 16 15 08"
src="https://github.com/user-attachments/assets/a3395cfb-fc5e-4c22-9dd8-954a60fd1b5d">

### How to test
* Run Kibana in serverless
* Go to Index Management and verify you haven't indices (or delete them
if you do have indices).
* Go to Dev Tools and click the Search Profiler tab. Verify that the
button is disabled and the tooltip displayed if you hover over it.
* Go back to Index Management and create one or more indices.
* Go back to Dev Tools > Search Profiler. Now the button should be
enabled and the profile should be created if you click it.

### Demo

https://github.com/user-attachments/assets/9bda072e-7897-4418-a906-14807e736c44

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [ ] 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
- [ ] 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 was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit 41bd2af)
@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

@SoniaSanzV SoniaSanzV deleted the searchProfile_verify_indices branch December 4, 2024 16:12
kibanamachine added a commit that referenced this pull request Dec 4, 2024
…ess (#201630) (#202972)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Check for indices before enabling get search profile in serverless
(#201630)](#201630)

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

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

<!--BACKPORT [{"author":{"name":"Sonia Sanz
Vivas","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-04T15:53:36Z","message":"Check
for indices before enabling get search profile in serverless
(#201630)\n\nCloses
[#195342](https://github.com/elastic/kibana/issues/195342)\r\n\r\n##
Summary\r\nIn serverless, the default query for the search profiler
fails if there\r\nis not indices. For avoiding this error, when there
are no indices\r\npresent, this PR disabled the \"Profile\" button and
add a tooltip\r\nexplaining why it is disabled.\r\n\r\n### New
strings\r\nThis is the tooltip for string verification
@kibana-docs\r\n[[Code](https://github.com/elastic/kibana/pull/201630/commits/5832a76683ad0cf55558655ca5981d623f344b72?diff=unified&w=0#diff-bf48cd9834b39a2a1634680225fc63c9a4ddb3ca881d9120f648006ad0277046R154-R1552?diff=unified&w=0#diff-bf48cd9834b39a2a1634680225fc63c9a4ddb3ca881d9120f648006ad0277046R155)]:\r\n<img
width=\"460\" alt=\"Screenshot 2024-11-25 at 16 15
08\"\r\nsrc=\"https://github.com/user-attachments/assets/a3395cfb-fc5e-4c22-9dd8-954a60fd1b5d\">\r\n\r\n###
How to test\r\n* Run Kibana in serverless\r\n* Go to Index Management
and verify you haven't indices (or delete them\r\nif you do have
indices).\r\n* Go to Dev Tools and click the Search Profiler tab. Verify
that the\r\nbutton is disabled and the tooltip displayed if you hover
over it.\r\n* Go back to Index Management and create one or more
indices.\r\n* Go back to Dev Tools > Search Profiler. Now the button
should be\r\nenabled and the profile should be created if you click
it.\r\n\r\n###
Demo\r\n\r\n\r\nhttps://github.com/user-attachments/assets/9bda072e-7897-4418-a906-14807e736c44\r\n\r\n\r\n###
Checklist\r\n\r\nCheck the PR satisfies following conditions.
\r\n\r\nReviewers should verify this PR satisfies this list as
well.\r\n\r\n- [ ] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [ ] [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- [ ] If a plugin
configuration key changed, check if it needs to be\r\nallowlisted in the
cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\r\nchanges have been approved by the breaking-change committee.
The\r\n`release_note:breaking` label should be applied in these
situations.\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- [ ] The PR description includes
the appropriate Release Notes section,\r\nand the correct
`release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"41bd2af9f142b97ab6a5deef2444330a8e93f7ed","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Kibana
Management","release_note:skip","Feature:Search
Profiler","v9.0.0","backport:prev-minor"],"title":"Check for indices
before enabling get search profile in
serverless","number":201630,"url":"https://github.com/elastic/kibana/pull/201630","mergeCommit":{"message":"Check
for indices before enabling get search profile in serverless
(#201630)\n\nCloses
[#195342](https://github.com/elastic/kibana/issues/195342)\r\n\r\n##
Summary\r\nIn serverless, the default query for the search profiler
fails if there\r\nis not indices. For avoiding this error, when there
are no indices\r\npresent, this PR disabled the \"Profile\" button and
add a tooltip\r\nexplaining why it is disabled.\r\n\r\n### New
strings\r\nThis is the tooltip for string verification
@kibana-docs\r\n[[Code](https://github.com/elastic/kibana/pull/201630/commits/5832a76683ad0cf55558655ca5981d623f344b72?diff=unified&w=0#diff-bf48cd9834b39a2a1634680225fc63c9a4ddb3ca881d9120f648006ad0277046R154-R1552?diff=unified&w=0#diff-bf48cd9834b39a2a1634680225fc63c9a4ddb3ca881d9120f648006ad0277046R155)]:\r\n<img
width=\"460\" alt=\"Screenshot 2024-11-25 at 16 15
08\"\r\nsrc=\"https://github.com/user-attachments/assets/a3395cfb-fc5e-4c22-9dd8-954a60fd1b5d\">\r\n\r\n###
How to test\r\n* Run Kibana in serverless\r\n* Go to Index Management
and verify you haven't indices (or delete them\r\nif you do have
indices).\r\n* Go to Dev Tools and click the Search Profiler tab. Verify
that the\r\nbutton is disabled and the tooltip displayed if you hover
over it.\r\n* Go back to Index Management and create one or more
indices.\r\n* Go back to Dev Tools > Search Profiler. Now the button
should be\r\nenabled and the profile should be created if you click
it.\r\n\r\n###
Demo\r\n\r\n\r\nhttps://github.com/user-attachments/assets/9bda072e-7897-4418-a906-14807e736c44\r\n\r\n\r\n###
Checklist\r\n\r\nCheck the PR satisfies following conditions.
\r\n\r\nReviewers should verify this PR satisfies this list as
well.\r\n\r\n- [ ] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [ ] [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- [ ] If a plugin
configuration key changed, check if it needs to be\r\nallowlisted in the
cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\r\nchanges have been approved by the breaking-change committee.
The\r\n`release_note:breaking` label should be applied in these
situations.\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- [ ] The PR description includes
the appropriate Release Notes section,\r\nand the correct
`release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"41bd2af9f142b97ab6a5deef2444330a8e93f7ed"}},"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/201630","number":201630,"mergeCommit":{"message":"Check
for indices before enabling get search profile in serverless
(#201630)\n\nCloses
[#195342](https://github.com/elastic/kibana/issues/195342)\r\n\r\n##
Summary\r\nIn serverless, the default query for the search profiler
fails if there\r\nis not indices. For avoiding this error, when there
are no indices\r\npresent, this PR disabled the \"Profile\" button and
add a tooltip\r\nexplaining why it is disabled.\r\n\r\n### New
strings\r\nThis is the tooltip for string verification
@kibana-docs\r\n[[Code](https://github.com/elastic/kibana/pull/201630/commits/5832a76683ad0cf55558655ca5981d623f344b72?diff=unified&w=0#diff-bf48cd9834b39a2a1634680225fc63c9a4ddb3ca881d9120f648006ad0277046R154-R1552?diff=unified&w=0#diff-bf48cd9834b39a2a1634680225fc63c9a4ddb3ca881d9120f648006ad0277046R155)]:\r\n<img
width=\"460\" alt=\"Screenshot 2024-11-25 at 16 15
08\"\r\nsrc=\"https://github.com/user-attachments/assets/a3395cfb-fc5e-4c22-9dd8-954a60fd1b5d\">\r\n\r\n###
How to test\r\n* Run Kibana in serverless\r\n* Go to Index Management
and verify you haven't indices (or delete them\r\nif you do have
indices).\r\n* Go to Dev Tools and click the Search Profiler tab. Verify
that the\r\nbutton is disabled and the tooltip displayed if you hover
over it.\r\n* Go back to Index Management and create one or more
indices.\r\n* Go back to Dev Tools > Search Profiler. Now the button
should be\r\nenabled and the profile should be created if you click
it.\r\n\r\n###
Demo\r\n\r\n\r\nhttps://github.com/user-attachments/assets/9bda072e-7897-4418-a906-14807e736c44\r\n\r\n\r\n###
Checklist\r\n\r\nCheck the PR satisfies following conditions.
\r\n\r\nReviewers should verify this PR satisfies this list as
well.\r\n\r\n- [ ] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [ ] [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- [ ] If a plugin
configuration key changed, check if it needs to be\r\nallowlisted in the
cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\r\nchanges have been approved by the breaking-change committee.
The\r\n`release_note:breaking` label should be applied in these
situations.\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- [ ] The PR description includes
the appropriate Release Notes section,\r\nand the correct
`release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"41bd2af9f142b97ab6a5deef2444330a8e93f7ed"}}]}]
BACKPORT-->

Co-authored-by: Sonia Sanz Vivas <[email protected]>
SoniaSanzV added a commit to SoniaSanzV/kibana that referenced this pull request Dec 9, 2024
…lastic#201630)

Closes [elastic#195342](elastic#195342)

## Summary
In serverless, the default query for the search profiler fails if there
is not indices. For avoiding this error, when there are no indices
present, this PR disabled the "Profile" button and add a tooltip
explaining why it is disabled.

### New strings
This is the tooltip for string verification @kibana-docs
[[Code](https://github.com/elastic/kibana/pull/201630/commits/5832a76683ad0cf55558655ca5981d623f344b72?diff=unified&w=0#diff-bf48cd9834b39a2a1634680225fc63c9a4ddb3ca881d9120f648006ad0277046R154-R1552?diff=unified&w=0#diff-bf48cd9834b39a2a1634680225fc63c9a4ddb3ca881d9120f648006ad0277046R155)]:
<img width="460" alt="Screenshot 2024-11-25 at 16 15 08"
src="https://github.com/user-attachments/assets/a3395cfb-fc5e-4c22-9dd8-954a60fd1b5d">

### How to test
* Run Kibana in serverless
* Go to Index Management and verify you haven't indices (or delete them
if you do have indices).
* Go to Dev Tools and click the Search Profiler tab. Verify that the
button is disabled and the tooltip displayed if you hover over it.
* Go back to Index Management and create one or more indices.
* Go back to Dev Tools > Search Profiler. Now the button should be
enabled and the profile should be created if you click it.

### Demo


https://github.com/user-attachments/assets/9bda072e-7897-4418-a906-14807e736c44


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] 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
- [ ] 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 was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Elastic Machine <[email protected]>
SoniaSanzV added a commit to SoniaSanzV/kibana that referenced this pull request Dec 9, 2024
…lastic#201630)

Closes [elastic#195342](elastic#195342)

## Summary
In serverless, the default query for the search profiler fails if there
is not indices. For avoiding this error, when there are no indices
present, this PR disabled the "Profile" button and add a tooltip
explaining why it is disabled.

### New strings
This is the tooltip for string verification @kibana-docs
[[Code](https://github.com/elastic/kibana/pull/201630/commits/5832a76683ad0cf55558655ca5981d623f344b72?diff=unified&w=0#diff-bf48cd9834b39a2a1634680225fc63c9a4ddb3ca881d9120f648006ad0277046R154-R1552?diff=unified&w=0#diff-bf48cd9834b39a2a1634680225fc63c9a4ddb3ca881d9120f648006ad0277046R155)]:
<img width="460" alt="Screenshot 2024-11-25 at 16 15 08"
src="https://github.com/user-attachments/assets/a3395cfb-fc5e-4c22-9dd8-954a60fd1b5d">

### How to test
* Run Kibana in serverless
* Go to Index Management and verify you haven't indices (or delete them
if you do have indices).
* Go to Dev Tools and click the Search Profiler tab. Verify that the
button is disabled and the tooltip displayed if you hover over it.
* Go back to Index Management and create one or more indices.
* Go back to Dev Tools > Search Profiler. Now the button should be
enabled and the profile should be created if you click it.

### Demo


https://github.com/user-attachments/assets/9bda072e-7897-4418-a906-14807e736c44


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] 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
- [ ] 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 was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Elastic Machine <[email protected]>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 9, 2024
…lastic#201630)

Closes [elastic#195342](elastic#195342)

## Summary
In serverless, the default query for the search profiler fails if there
is not indices. For avoiding this error, when there are no indices
present, this PR disabled the "Profile" button and add a tooltip
explaining why it is disabled.

### New strings
This is the tooltip for string verification @kibana-docs
[[Code](https://github.com/elastic/kibana/pull/201630/commits/5832a76683ad0cf55558655ca5981d623f344b72?diff=unified&w=0#diff-bf48cd9834b39a2a1634680225fc63c9a4ddb3ca881d9120f648006ad0277046R154-R1552?diff=unified&w=0#diff-bf48cd9834b39a2a1634680225fc63c9a4ddb3ca881d9120f648006ad0277046R155)]:
<img width="460" alt="Screenshot 2024-11-25 at 16 15 08"
src="https://github.com/user-attachments/assets/a3395cfb-fc5e-4c22-9dd8-954a60fd1b5d">

### How to test
* Run Kibana in serverless
* Go to Index Management and verify you haven't indices (or delete them
if you do have indices).
* Go to Dev Tools and click the Search Profiler tab. Verify that the
button is disabled and the tooltip displayed if you hover over it.
* Go back to Index Management and create one or more indices.
* Go back to Dev Tools > Search Profiler. Now the button should be
enabled and the profile should be created if you click it.

### Demo


https://github.com/user-attachments/assets/9bda072e-7897-4418-a906-14807e736c44


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] 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
- [ ] 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 was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Elastic Machine <[email protected]>
Samiul-TheSoccerFan pushed a commit to Samiul-TheSoccerFan/kibana that referenced this pull request Dec 10, 2024
…lastic#201630)

Closes [elastic#195342](elastic#195342)

## Summary
In serverless, the default query for the search profiler fails if there
is not indices. For avoiding this error, when there are no indices
present, this PR disabled the "Profile" button and add a tooltip
explaining why it is disabled.

### New strings
This is the tooltip for string verification @kibana-docs
[[Code](https://github.com/elastic/kibana/pull/201630/commits/5832a76683ad0cf55558655ca5981d623f344b72?diff=unified&w=0#diff-bf48cd9834b39a2a1634680225fc63c9a4ddb3ca881d9120f648006ad0277046R154-R1552?diff=unified&w=0#diff-bf48cd9834b39a2a1634680225fc63c9a4ddb3ca881d9120f648006ad0277046R155)]:
<img width="460" alt="Screenshot 2024-11-25 at 16 15 08"
src="https://github.com/user-attachments/assets/a3395cfb-fc5e-4c22-9dd8-954a60fd1b5d">

### How to test
* Run Kibana in serverless
* Go to Index Management and verify you haven't indices (or delete them
if you do have indices).
* Go to Dev Tools and click the Search Profiler tab. Verify that the
button is disabled and the tooltip displayed if you hover over it.
* Go back to Index Management and create one or more indices.
* Go back to Dev Tools > Search Profiler. Now the button should be
enabled and the profile should be created if you click it.

### Demo


https://github.com/user-attachments/assets/9bda072e-7897-4418-a906-14807e736c44


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] 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
- [ ] 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 was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Elastic Machine <[email protected]>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
…lastic#201630)

Closes [elastic#195342](elastic#195342)

## Summary
In serverless, the default query for the search profiler fails if there
is not indices. For avoiding this error, when there are no indices
present, this PR disabled the "Profile" button and add a tooltip
explaining why it is disabled.

### New strings
This is the tooltip for string verification @kibana-docs
[[Code](https://github.com/elastic/kibana/pull/201630/commits/5832a76683ad0cf55558655ca5981d623f344b72?diff=unified&w=0#diff-bf48cd9834b39a2a1634680225fc63c9a4ddb3ca881d9120f648006ad0277046R154-R1552?diff=unified&w=0#diff-bf48cd9834b39a2a1634680225fc63c9a4ddb3ca881d9120f648006ad0277046R155)]:
<img width="460" alt="Screenshot 2024-11-25 at 16 15 08"
src="https://github.com/user-attachments/assets/a3395cfb-fc5e-4c22-9dd8-954a60fd1b5d">

### How to test
* Run Kibana in serverless
* Go to Index Management and verify you haven't indices (or delete them
if you do have indices).
* Go to Dev Tools and click the Search Profiler tab. Verify that the
button is disabled and the tooltip displayed if you hover over it.
* Go back to Index Management and create one or more indices.
* Go back to Dev Tools > Search Profiler. Now the button should be
enabled and the profile should be created if you click it.

### Demo


https://github.com/user-attachments/assets/9bda072e-7897-4418-a906-14807e736c44


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] 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
- [ ] 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 was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Elastic Machine <[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 (9.0) the previous minor version (i.e. one version back from main) Feature:Search Profiler release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Search profiler] Default query fails on serverless
5 participants