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

[maps] vector tile layer does not display request warnings #170654

Closed
nreese opened this issue Nov 6, 2023 · 1 comment · Fixed by #171144
Closed

[maps] vector tile layer does not display request warnings #170654

nreese opened this issue Nov 6, 2023 · 1 comment · Fixed by #171144
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Maps Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas

Comments

@nreese
Copy link
Contributor

nreese commented Nov 6, 2023

Steps to view problem

  1. In console, run:
    PUT geo1
    {}
    
    PUT geo1/_mapping
    {
      "properties": {
        "location": {
          "type": "geo_point"
        }
      }
    }
    
    PUT geo1/_doc/1
    {
      "location": "25,25"
    }
    
    PUT geo2
    {}
    
    PUT geo2/_mapping
    {
      "properties": {
        "location": {
          "type": "geo_point"
        }
      }
    }
    
    PUT geo2/_doc/1
    {
      "location": "35,35"
    }
    
  2. Create geo* data view
  3. create new map, add documents layer from geo* data view.
  4. add filter
    {
      "error_query": {
        "indices": [
          {
            "error_type": "exception",
            "message": "local shard failure message 123",
            "name": "geo2"
          }
        ]
      }
    }
    
  5. Notice how no warnings are displayed to user, yet there is a shard failure and partial results are displayed. This may causes users to make incorrect inferences from map.
  6. You can view the shard failure by running the vector request in console
    POST /geo*/_mvt/location/1/1/0
    {
      "buffer": 0,
      "grid_precision": 0,
      "exact_bounds": true,
      "extent": 4096,
      "query": {
        "bool": {
          "filter": [
            {
              "error_query": {
                "indices": [
                  {
                    "error_type": "exception",
                    "message": "local shard failure message 123",
                    "name": "geo2"
                  }
                ]
              }
            }
          ],
          "must": [],
          "must_not": [],
          "should": []
        }
      },
      "runtime_mappings": {},
      "track_total_hits": 10001,
      "with_labels": false,
      "fields": []
    }
    
    Notice how the response meta contains the shard failures that need to be surfaced in the UI
    {
      "meta": [
        {
          "geometry": {
            "type": "Point",
            "coordinates": [
              569,
              3508
            ]
          },
          "properties": {
            "_shards.failed": 1,
            "_shards.failures.0.index": "geo2",
            "_shards.failures.0.node": "NvVWLT9BQXCC9M-4L_oo2Q",
            "_shards.failures.0.reason.caused_by.reason": "[geo2][0] local shard failure message 123",
            "_shards.failures.0.reason.caused_by.type": "runtime_exception",
            "_shards.failures.0.reason.index": "geo2",
            "_shards.failures.0.reason.index_uuid": "_oFDcbPoRVaU-sdUf5yeiQ",
            "_shards.failures.0.reason.reason": "failed to create query: [geo2][0] local shard failure message 123",
            "_shards.failures.0.reason.type": "query_shard_exception",
            "_shards.failures.0.shard": 0,
            "_shards.skipped": 0,
            "_shards.successful": 1,
            "_shards.total": 2,
            "hits.total.relation": "eq",
            "hits.total.value": 1,
            "timed_out": false,
            "took": 1
          }
        }
      ],
      "hits": []
    }
    

Instead, layer legend should indicate warning. Legend should display warning icon and legend details should display warning callout.

@nreese nreese added bug Fixes for quality problems that affect the customer experience Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas Feature:Maps labels Nov 6, 2023
@elasticmachine
Copy link
Contributor

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

nreese added a commit that referenced this issue Nov 16, 2023
Closes #170653
Closes #170654

PR updates Maps to display incomplete result warnings in layer legend
(instead of displaying toast)

### Test setup
1. In console, run:
    ```
    PUT geo1
    {}

    PUT geo1/_mapping
    {
      "properties": {
        "location": {
          "type": "geo_point"
        }
      }
    }

    PUT geo1/_doc/1
    {
      "location": "25,25"
    }

    PUT geo2
    {}

    PUT geo2/_mapping
    {
      "properties": {
        "location": {
          "type": "geo_point"
        }
      }
    }

    PUT geo2/_doc/1
    {
      "location": "35,35"
    }
    ```
2. Create `geo*` data view

### Test vector tile request warning
"View details" button for vector tile requests is out of scope for this
PR. Vector tile requests use _mvt API instead of _search API. As such,
vector tile requests do not use search source or request inspector.

1. create new map, add documents layer from `geo*` data view.
2. add filter
    ```
    {
      "error_query": {
        "indices": [
          {
            "error_type": "exception",
            "message": "local shard failure message 123",
            "name": "geo2"
          }
        ]
      }
    }
    ```
<img width="400" alt="Screenshot 2023-11-13 at 2 08 06 PM"
src="https://github.com/elastic/kibana/assets/373691/8b608400-79d0-4800-9980-5af76b507a43">

### Test geojson incomplete results warning with single request
1. create new map, add documents layer from `geo*` data view.
2. Set scaling to "Limit results to 10000"
3. add filter
    ```
    {
      "error_query": {
        "indices": [
          {
            "error_type": "exception",
            "message": "local shard failure message 123",
            "name": "geo2"
          }
        ]
      }
    }
    ```
<img width="400" alt="Screenshot 2023-11-13 at 2 11 48 PM"
src="https://github.com/elastic/kibana/assets/373691/e1b1de01-1db7-40ad-b221-29f42baf5735">

### Test geojson incomplete results warning with multiple requests
1. create new map, add documents layer from `geo*` data view.
2. Set scaling to "Show clusters when results exceed 10000"
3. add filter
    ```
    {
      "error_query": {
        "indices": [
          {
            "error_type": "exception",
            "message": "local shard failure message 123",
            "name": "geo2"
          }
        ]
      }
    }
    ```
<img width="400" alt="Screenshot 2023-11-13 at 2 12 57 PM"
src="https://github.com/elastic/kibana/assets/373691/27beffc4-1dba-4ec4-90f8-e92002f8a63a">

---------

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
bug Fixes for quality problems that affect the customer experience Feature:Maps Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants