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

[BUG] [Inspect] Request data does not contain all the params like in the payload of the browser developer tools #3950

Open
quanghungb opened this issue Apr 26, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request medium priority ux / ui Improvements or additions to user experience, flows, components, UI elements

Comments

@quanghungb
Copy link

I could notice that the request data given in: Inspect > View:Requests> Request does not contain all the params sent to the server.

Indeed the payload captured by the browser dev tools contains also the index that was missing in the inspected request data.

Steps to reproduce the behavior:

  1. Go to Visualize and open an existing visualisation (or create one) with the index my_index
  2. Open the browser Developer Tools
  3. Refresh or update
  4. Click on Inspect > View: Requests > Request (tab) where is displayed the request sent. You can see something like that (without the index name)
{
  "aggs": {
    "5": {
      "terms": {
        "field": "my_field",
        "order": {
          "1": "desc"
        },
        "size": 500000
      },
      "aggs": {
        "1": {
          "sum": {
            "field": "qty"
          }
        }
      }
    }
  },
  "size": 0,
  "stored_fields": [
    "*"
  ],
  "script_fields": {},
  "docvalue_fields": [
    {
      "field": "data.kt_begin",
      "format": "date_time"
    },
    {
      "field": "data.timestamp",
      "format": "date_time"
    },
    {
      "field": "timestamp",
      "format": "date_time"
    }
  ],
  "_source": {
    "excludes": []
  },
  "query": {
    "bool": {
      "must": [],
      "filter": [
        {
          "match_all": {}
        },
        {
          "range": {
            "timestamp": {
              "gte": "2023-04-26T22:40:23.287Z",
              "lte": "2023-04-26T22:55:23.287Z",
              "format": "strict_date_optional_time"
            }
          }
        }
      ],
      "should": [],
      "must_not": []
    }
  }
}
  1. In the browser Develper Tools console, open the Payload (or select the request then copy as cURL
    You could see that there is also the index (of the visualisation) in the request
'{"params":{"index":"my_index","body":{"aggs":{"5"
  1. As a result you can not use the inspected request data for the replay. But you can replay the request with the copy as cURL one

Expected behavior
The inspected request data should contain all the params in order to be replayed correctly.

OpenSearch Version
v2.4.1
Dashboards Version
v2.4.1

Host/Environment:

  • Browser and version: Chrome Version 112.0.5615.137
@quanghungb quanghungb added bug Something isn't working untriaged labels Apr 26, 2023
@joshuarrrr joshuarrrr added ux / ui Improvements or additions to user experience, flows, components, UI elements and removed untriaged labels May 2, 2023
@joshuarrrr
Copy link
Member

@kgcreative @KrooshalUX @dagneyb I wonder if we can make the Inspect results from Dashboards visualizations more useful, perhaps by making it easy to open those requests in the console in one-click, or to copy the (full) request as a cURL command.

As for this particular behavior, I'm not aware of any good reason for the index to be excluded.

@quanghungb
Copy link
Author

@joshuarrrr I used this feature in order to have the request posted for debugging/investigation purpose. TBH the inspect feature could be cool to see things but only for a "small" request with few parameters but a "big" one (usually the ones that trigger issues) it's very hard to read the json. Therefore it's more useful to have it as curl request for the replay.

So I would be useful if we can easily copy it directly (including the auth token at the same time :))

@kgcreative
Copy link
Member

@joshuarrrr I like it

@seanneumann seanneumann added medium priority enhancement New feature or request and removed bug Something isn't working labels May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request medium priority ux / ui Improvements or additions to user experience, flows, components, UI elements
Projects
None yet
Development

No branches or pull requests

4 participants