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

On search source error, show 'view details' action that opens request in inspector #170790

Merged
merged 18 commits into from Nov 14, 2023

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Nov 7, 2023

Closes #167904

PR updates EsError with getActions method that returns "View details" button. Clicking "View details" opens inspector to request that failed. PR updates Discover and maps to display EsError action.

PR does not update lens to display "View details". Chatted with @drewdaemon and the implementation path is more involved. This will be completed in another PR.

Test setup

  1. install sample web logs

Test discover with EsError

  1. open discover
  2. Add filter
    {
      "error_query": {
        "indices": [
          {
            "error_type": "exception",
            "message": "local shard failure message 123",
            "name": "kibana_sample_data_logs"
          }
        ]
      }
    }
    
  3. Verify View details action is displayed and clicking action opens inspector
    Screenshot 2023-11-07 at 12 53 31 PM

Test search embeddable with EsError

  1. create new dashboard. Add saved search from kibana_sample_data_logs data view
  2. Add filter
    {
      "error_query": {
        "indices": [
          {
            "error_type": "exception",
            "message": "local shard failure message 123",
            "name": "kibana_sample_data_logs"
          }
        ]
      }
    }
    
  3. Verify View details action is displayed and clicking action opens inspector
    Screenshot 2023-11-07 at 12 55 46 PM

Test discover with PainlessError

Screenshot 2023-11-07 at 12 52 51 PM

Test Maps error

  1. create new map
  2. Add documents layer
  3. Set scaling to "limit to 10000"
  4. Add filter
    {
      "error_query": {
        "indices": [
          {
            "error_type": "exception",
            "message": "local shard failure message 123",
            "name": "kibana_sample_data_logs"
          }
        ]
      }
    }
    
  5. Verify "View details" button is displayed in maps legend in error callout
    Screenshot 2023-11-08 at 12 07 42 PM

@nreese
Copy link
Contributor Author

nreese commented Nov 8, 2023

@elasticmachine merge upstream

@nreese
Copy link
Contributor Author

nreese commented Nov 9, 2023

@elasticmachine merge upstream

@nreese nreese marked this pull request as ready for review November 10, 2023 16:49
@nreese nreese requested review from a team as code owners November 10, 2023 16:49
@nreese nreese added Feature:Discover Discover Application Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph) Feature:Maps labels Nov 10, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@nreese nreese added the v8.12.0 label Nov 10, 2023
@stratoula
Copy link
Contributor

I will leave the review to the Discovery team which owns search

Copy link
Member

@lukasolson lukasolson left a comment

Choose a reason for hiding this comment

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

It looks like we're still missing at least one error. Steps to reproduce:

  1. Ingest a nested document:
PUT my-index-000001
{
  "mappings": {
    "properties": {
      "user": {
        "type": "nested" 
      }
    }
  }
}

POST my-index-000001/_doc
{
  "group" : "fans",
  "user" : [
    {
      "first" : "John",
      "last" :  "Smith"
    },
    {
      "first" : "Alice",
      "last" :  "White"
    }
  ]
}
  1. Try to query using incorrect KQL syntax: user.last.keyword : "Smith"

Here's the error:

image

And here's what you get when clicking "View details":

image

@botelastic botelastic bot added the Feature:Embedding Embedding content via iFrame label Nov 13, 2023
@nreese
Copy link
Contributor Author

nreese commented Nov 13, 2023

@lukasolson

It looks like we're still missing at least one error. Steps to reproduce:

Thanks for the example error. In this case, the error is not an EsError instance, but rather an error thrown by KQL. The error is thrown before search_source.fetch is called so there is never a request/response from elasticsearch.

The "View details" is button is the one from discover error callout. The think the current behavior is expected since there is nothing to view in the inspector since the request never made it to elasticsearch.

Copy link
Member

@lukasolson lukasolson left a comment

Choose a reason for hiding this comment

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

The error is thrown before search_source.fetch is called so there is never a request/response from elasticsearch.

Makes sense, thanks for the explanation!

LGTM

Copy link
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

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

Presentation team changes LGTM! Tested this locally in chrome and the view details button appears when expected and works as expected. Also looked through the code, and everything looks great. Left one nit.

@nreese
Copy link
Contributor Author

nreese commented Nov 14, 2023

@elasticmachine merge upstream

@nreese
Copy link
Contributor Author

nreese commented Nov 14, 2023

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
embeddable 116 115 -1

Async chunks

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

id before after diff
data 46.9KB 46.9KB +1.0B
discover 590.3KB 590.3KB +63.0B
maps 2.9MB 2.9MB +662.0B
total +726.0B

Page load bundle

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

id before after diff
data 413.3KB 414.3KB +1.1KB
embeddable 78.4KB 78.5KB +144.0B
total +1.2KB

History

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

@nreese nreese merged commit f9870c1 into elastic:main Nov 14, 2023
27 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Nov 14, 2023
jillguyonnet pushed a commit to jillguyonnet/kibana that referenced this pull request Nov 16, 2023
… in inspector (elastic#170790)

Closes elastic#167904

PR updates `EsError` with `getActions` method that returns "View
details" button. Clicking "View details" opens inspector to request that
failed. PR updates Discover and maps to display EsError action.

PR does not update lens to display "View details". Chatted with
@drewdaemon and the implementation path is more involved. This will be
completed in another PR.

### Test setup
1. install sample web logs

### Test discover with EsError
1. open discover 
2. Add filter
    ```
    {
      "error_query": {
        "indices": [
          {
            "error_type": "exception",
            "message": "local shard failure message 123",
            "name": "kibana_sample_data_logs"
          }
        ]
      }
    }
    ```
3. Verify `View details` action is displayed and clicking action opens
inspector
<img width="300" alt="Screenshot 2023-11-07 at 12 53 31 PM"
src="https://github.com/elastic/kibana/assets/373691/6b43e9c8-daab-4782-876e-ded6958d15cf">

### Test search embeddable with EsError
1. create new dashboard. Add saved search from `kibana_sample_data_logs`
data view
2. Add filter
    ```
    {
      "error_query": {
        "indices": [
          {
            "error_type": "exception",
            "message": "local shard failure message 123",
            "name": "kibana_sample_data_logs"
          }
        ]
      }
    }
    ```
3. Verify `View details` action is displayed and clicking action opens
inspector
<img width="300" alt="Screenshot 2023-11-07 at 12 55 46 PM"
src="https://github.com/elastic/kibana/assets/373691/5ebe37c6-467a-4d72-89e3-21fc53f59d89">

### Test discover with PainlessError
<img width="300" alt="Screenshot 2023-11-07 at 12 52 51 PM"
src="https://github.com/elastic/kibana/assets/373691/6d17498f-657c-46e8-86e8-dde461599267">

### Test Maps error
1. create new map
2. Add `documents` layer
3. Set scaling to "limit to 10000"
4. Add filter
    ```
    {
      "error_query": {
        "indices": [
          {
            "error_type": "exception",
            "message": "local shard failure message 123",
            "name": "kibana_sample_data_logs"
          }
        ]
      }
    }
    ```
5. Verify "View details" button is displayed in maps legend in error
callout
<img width="500" alt="Screenshot 2023-11-08 at 12 07 42 PM"
src="https://github.com/elastic/kibana/assets/373691/2eb2cc41-0919-49a3-9792-fda9707973cb">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
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 Feature:Discover Discover Application Feature:Embedding Embedding content via iFrame Feature:Maps release_note:enhancement Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph) Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[search source] 'View details' UI action to open clusters inspector tab when request fails
7 participants