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

[Dashboard] /api/metrics/vis/data calls are duplicated #96629

Closed
dmlemeshko opened this issue Apr 8, 2021 · 5 comments
Closed

[Dashboard] /api/metrics/vis/data calls are duplicated #96629

dmlemeshko opened this issue Apr 8, 2021 · 5 comments
Assignees
Labels
enhancement New value added to drive a business result Feature:TSVB TSVB (Time Series Visual Builder) impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. performance Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.0.0

Comments

@dmlemeshko
Copy link
Member

Kibana version: master

Elasticsearch version: master

Server OS version: MacOS 10.15.7

Browser version: Chrome 89

Browser OS version: MacOS 10.15.7

Original install method (e.g. download page, yum, from source, etc.): source

Describe the bug:

Steps to reproduce:

  1. Start Kibana from x-pack
  2. Load eCommerce sample data
  3. Go to Dashboards -> open [eCommerce] Revenue Dashboard
  4. In Chrome dev tools check /api/metrics/vis/data requests

There are 2 requests (time series and gauge) followed by exact the same 2 requests (time series and gauge):

curl 'http://localhost:5620/api/metrics/vis/data' \
  -H 'Connection: keep-alive' \
  -H 'sec-ch-ua: "Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36' \
  -H 'kbn-version: 8.0.0' \
  -H 'Content-Type: application/json' \
  -H 'Accept: */*' \
  -H 'Origin: http://localhost:5620' \
  -H 'Sec-Fetch-Site: same-origin' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Referer: http://localhost:5620/app/dashboards' \
  -H 'Accept-Language: en-US,en;q=0.9,ru;q=0.8,de;q=0.7' \
  -H 'Cookie: Idea-552088b1=58e1d3bc-c5c1-47d4-98b9-92fae4939914; sid=Fe26.2**b3146c18d486b9ac1f9f7c0c25184ffb1a9efba046d58cb019ff37d573abf61f*C9pcTbnj96Yig2kyBQziSA*M6zy7QZ8Tr9UjiS0xebIxysfHrFt3jhXvtj88XIWrGr3qn8SdP8APwHo24_-QxKECyMgX3RN1yb4ytt1sh-N6lCTa5_25mPQGWGgLEmbYlgVHjkQi5oKZXpLVbUQLGYAEJ1LFxXmPXlLF6HjGyHAc5e6x2DvcB32scIpAoW0ZR-SPo4G8LH8xpqIzfGAPkoAxjhxi5-JYY3t0TrSgniihov5QlKE7Ty20dL-xBh62Z4**22f994681238b0a577e25e366cf84e5471a4c9db699e202a502549e0838930ab*NCQUK_iU3r4wGOAW_hHim0ZdZydylqSwZ9w2FzvNUAo' \
  --data-raw $'{"timerange":{"timezone":"Europe/Berlin","min":"2021-04-01T11:27:15.556Z","max":"2021-04-08T11:27:15.556Z"},"query":[{"language":"kuery","query":""}],"filters":[],"panels":[{"id":"61ca57f0-469d-11e7-af02-69e470af7417","type":"timeseries","series":[{"id":"ea20ae70-b88d-11e8-a451-f37365e9f268","color":"rgba(240,138,217,1)","split_mode":"everything","metrics":[{"id":"ea20ae71-b88d-11e8-a451-f37365e9f268","type":"sum","field":"taxful_total_price"}],"separate_axis":0,"axis_position":"right","formatter":"number","chart_type":"line","line_width":1,"point_size":1,"fill":"0.7","stacked":"none","filter":{"query":"products.product_name:*trouser*","language":"lucene"},"label":"Revenue Trousers","value_template":"${{value}}","split_color_mode":"gradient"},{"id":"062d77b0-b88e-11e8-a451-f37365e9f268","color":"rgba(191,240,129,1)","split_mode":"everything","metrics":[{"id":"062d77b1-b88e-11e8-a451-f37365e9f268","type":"sum","field":"taxful_total_price"}],"separate_axis":0,"axis_position":"right","formatter":"number","chart_type":"line","line_width":1,"point_size":1,"fill":"0.7","stacked":"none","filter":{"query":"products.product_name:*watch*","language":"lucene"},"label":"Revenue Watches","value_template":"${{value}}","split_color_mode":"gradient"},{"id":"61ca57f1-469d-11e7-af02-69e470af7417","color":"rgba(23,233,230,1)","split_mode":"everything","metrics":[{"id":"61ca57f2-469d-11e7-af02-69e470af7417","type":"sum","field":"taxful_total_price"}],"separate_axis":0,"axis_position":"right","formatter":"number","chart_type":"line","line_width":1,"point_size":1,"fill":"0.7","stacked":"none","filter":{"query":"products.product_name:*bag*","language":"lucene"},"label":"Revenue Bags","value_template":"${{value}}","split_color_mode":"gradient"},{"id":"faa2c170-b88d-11e8-a451-f37365e9f268","color":"rgba(235,186,180,1)","split_mode":"everything","metrics":[{"id":"faa2c171-b88d-11e8-a451-f37365e9f268","type":"sum","field":"taxful_total_price"}],"separate_axis":0,"axis_position":"right","formatter":"number","chart_type":"line","line_width":1,"point_size":1,"fill":"0.7","stacked":"none","filter":{"query":"products.product_name:*cocktail dress*","language":"lucene"},"label":"Revenue Cocktail Dresses","value_template":"${{value}}","split_color_mode":"gradient"}],"time_field":"order_date","interval":">=12h","use_kibana_indexes":true,"axis_position":"left","axis_formatter":"number","axis_scale":"normal","show_legend":1,"show_grid":1,"legend_position":"bottom","annotations":[{"fields":"taxful_total_price","template":"Ring the bell\u0021 ${{taxful_total_price}}","query_string":{"query":"taxful_total_price:>250","language":"lucene"},"id":"c8c30be0-b88f-11e8-a451-f37365e9f268","color":"rgba(25,77,51,1)","time_field":"order_date","icon":"fa-bell","ignore_global_filters":1,"ignore_panel_filters":1,"index_pattern":{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f"}}],"index_pattern":{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f"},"tooltip_mode":"show_all"}],"state":{},"searchSession":{"sessionId":"2a5bad78-575b-450c-b908-55d47d50bfcc","isRestore":false,"isStored":false}}' \
  --compressed
curl 'http://localhost:5620/api/metrics/vis/data' \
  -H 'Connection: keep-alive' \
  -H 'sec-ch-ua: "Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36' \
  -H 'kbn-version: 8.0.0' \
  -H 'Content-Type: application/json' \
  -H 'Accept: */*' \
  -H 'Origin: http://localhost:5620' \
  -H 'Sec-Fetch-Site: same-origin' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Referer: http://localhost:5620/app/dashboards' \
  -H 'Accept-Language: en-US,en;q=0.9,ru;q=0.8,de;q=0.7' \
  -H 'Cookie: Idea-552088b1=58e1d3bc-c5c1-47d4-98b9-92fae4939914; sid=Fe26.2**b3146c18d486b9ac1f9f7c0c25184ffb1a9efba046d58cb019ff37d573abf61f*C9pcTbnj96Yig2kyBQziSA*M6zy7QZ8Tr9UjiS0xebIxysfHrFt3jhXvtj88XIWrGr3qn8SdP8APwHo24_-QxKECyMgX3RN1yb4ytt1sh-N6lCTa5_25mPQGWGgLEmbYlgVHjkQi5oKZXpLVbUQLGYAEJ1LFxXmPXlLF6HjGyHAc5e6x2DvcB32scIpAoW0ZR-SPo4G8LH8xpqIzfGAPkoAxjhxi5-JYY3t0TrSgniihov5QlKE7Ty20dL-xBh62Z4**22f994681238b0a577e25e366cf84e5471a4c9db699e202a502549e0838930ab*NCQUK_iU3r4wGOAW_hHim0ZdZydylqSwZ9w2FzvNUAo' \
  --data-raw '{"timerange":{"timezone":"Europe/Berlin","min":"2021-04-01T11:27:15.556Z","max":"2021-04-08T11:27:15.556Z"},"query":[{"language":"kuery","query":""}],"filters":[],"panels":[{"id":"61ca57f0-469d-11e7-af02-69e470af7417","type":"gauge","series":[{"id":"61ca57f1-469d-11e7-af02-69e470af7417","color":"#68BC00","split_mode":"everything","metrics":[{"id":"61ca57f2-469d-11e7-af02-69e470af7417","type":"count"}],"separate_axis":0,"axis_position":"right","formatter":"number","chart_type":"line","line_width":1,"point_size":1,"fill":0.5,"stacked":"none","label":"Trxns / day","split_color_mode":"gradient"}],"time_field":"order_date","interval":"1d","axis_position":"left","axis_formatter":"number","axis_scale":"normal","show_legend":1,"show_grid":1,"gauge_color_rules":[{"value":150,"id":"6da070c0-b891-11e8-b645-195edeb9de84","gauge":"rgba(104,188,0,1)","operator":"gte"},{"value":150,"id":"9b0cdbc0-b891-11e8-b645-195edeb9de84","gauge":"rgba(244,78,59,1)","operator":"lt"}],"gauge_width":"15","gauge_inner_width":10,"gauge_style":"half","filter":"","gauge_max":"300","use_kibana_indexes":true,"index_pattern":{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f"},"tooltip_mode":"show_all"}],"state":{},"searchSession":{"sessionId":"2a5bad78-575b-450c-b908-55d47d50bfcc","isRestore":false,"isStored":false}}' \
  --compressed

Expected behavior: Since requests are completely identical, doing it a single time sounds reasonable.

Screenshots (if relevant):

image

@dmlemeshko dmlemeshko added the bug Fixes for quality problems that affect the customer experience label Apr 8, 2021
@botelastic botelastic bot added the needs-team Issues missing a team label label Apr 8, 2021
@dmlemeshko dmlemeshko added the Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas label Apr 8, 2021
@elasticmachine
Copy link
Contributor

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

@botelastic botelastic bot removed the needs-team Issues missing a team label label Apr 8, 2021
@ThomThomson ThomThomson added Feature:Input Control Input controls visualization impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort labels Apr 8, 2021
@dmlemeshko dmlemeshko changed the title [Dashboard] /api/metrics/vis/data calls areduplicated [Dashboard] /api/metrics/vis/data calls are duplicated Apr 13, 2021
@mattkime
Copy link
Contributor

While multiple calls are not ideal, we should have well defined performance goals before putting effort into deduping.

@wylieconlon
Copy link
Contributor

On that front, I just opened a new issue about the biggest bottleneck in these requests: schema validation #97061

@timroes timroes added Feature:TSVB TSVB (Time Series Visual Builder) Team:Visualizations Visualization editors, elastic-charts and infrastructure and removed Feature:Input Control Input controls visualization Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas labels Apr 29, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@timroes timroes added performance enhancement New value added to drive a business result and removed impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort bug Fixes for quality problems that affect the customer experience labels Apr 29, 2021
@stratoula stratoula added the impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. label Jul 21, 2021
@alexwizp alexwizp self-assigned this Jul 22, 2021
@alexwizp
Copy link
Contributor

duplicate requests was fixed here #106398

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:TSVB TSVB (Time Series Visual Builder) impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. performance Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.0.0
Projects
None yet
Development

No branches or pull requests

8 participants