Skip to content

[TSVB] Fix shard failures are not reported#123474

Merged
alexwizp merged 7 commits intoelastic:mainfrom
alexwizp:shards
Jan 27, 2022
Merged

[TSVB] Fix shard failures are not reported#123474
alexwizp merged 7 commits intoelastic:mainfrom
alexwizp:shards

Conversation

@alexwizp
Copy link
Copy Markdown
Contributor

@alexwizp alexwizp commented Jan 20, 2022

Closes: #122944, Closes: #15424

🏁 Shard failures are not reported #122944

Describe the feature:

TSVB does not report shard failures as long as there's at least one shard successfully returning data. This can make it hard to debug issues and bears a risk of misinterpreting charts because parts of data are silently missing

Screens:

Screen.Recording.2022-01-21.at.6.45.33.PM.mov

🏁 Allow Elasticsearch request bodies to be displayed #15424

Describe the feature:

For most of the Kibana visualizations, there's a UP arrow button in the lower left corner when on the Visualize tab that allows the user to see the data in table view, the raw request + response, and query stats. This doesn't seem to exist for the Time Series Visual Builder visualization.

I know it's more complicated because the TSVB supports multiple queries being executed but it'd be useful to see the request/response like with other visualizations.

Screens:

Screen.Recording.2022-01-21.at.6.46.14.PM.mov

@alexwizp alexwizp changed the title [TSVB] Fix shard failures are not reported #122944 [TSVB] Fix shard failures are not reported Jan 21, 2022
@alexwizp alexwizp self-assigned this Jan 21, 2022
@alexwizp alexwizp added v8.1.0 release_note:feature Makes this part of the condensed release notes Feature:TSVB TSVB (Time Series Visual Builder) Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// labels Jan 21, 2022
@alexwizp alexwizp marked this pull request as ready for review January 21, 2022 15:55
@alexwizp alexwizp requested review from a team as code owners January 21, 2022 15:55
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors)

@alexwizp
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@flash1293
Copy link
Copy Markdown
Contributor

Not sure whether related to this PR, but on adding an annotations source, TSVB does a lot of requests (eventually it stops though):
Kapture 2022-01-24 at 18 03 52

Copy link
Copy Markdown
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Some nits, but works great - thanks for this! We should look into the annotations thing though to make sure it's not caused by this PR - I tested on 8.0-beta and it's not happening there for some reason.

Otherwise this LGTM

@alexwizp
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

Copy link
Copy Markdown
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Tested and works well. LGTM 👍

# Conflicts:
#	src/plugins/vis_types/timeseries/public/metrics_type.ts
@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
data 2767 2771 +4

Async chunks

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

id before after diff
visTypeTimeseries 447.8KB 447.9KB +69.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 448.9KB 449.0KB +53.0B
inspector 22.3KB 22.3KB +38.0B
visTypeTimeseries 14.8KB 15.5KB +741.0B
total +832.0B
Unknown metric groups

API count

id before after diff
data 3364 3368 +4

History

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

cc @alexwizp

@alexwizp
Copy link
Copy Markdown
Contributor Author

@elastic/infra-monitoring-ui @elastic/kibana-app-services please have a look

@flash1293 flash1293 added release_note:fix and removed release_note:feature Makes this part of the condensed release notes labels Jan 27, 2022
Copy link
Copy Markdown
Contributor

@Dosant Dosant left a comment

Choose a reason for hiding this comment

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

Nice improvement 👍 From my and app services code perspective lgtm

But have some questions/suggestions for TSVB code. Maybe some of the worth an issue:


  1. It seems like error path of TSVB is handled poorly and hides a lot of info

For example:

this is what I got:
All shards failed
Screen Shot 2022-01-27 at 12 54 08

And this is how much info inside the es response:

{"errBody":{"is_partial":true,"is_running":false,"start_time_in_millis":1643284656920,"expiration_time_in_millis":1643284716920,"response":{"took":3,"timed_out":false,"terminated_early":false,"num_reduce_phases":0,"_shards":{"total":1,"successful":0,"skipped":0,"failed":1,"failures":[{"shard":0,"index":"kibana_sample_data_ecommerce","node":"aTguCaz_QamVRWwzvm0LGA","reason":{"type":"query_shard_exception","reason":"failed to create query: [kibana_sample_data_ecommerce][0] Watch out!","index_uuid":"kq37gPxmRBSoaQs0xhbGnA","index":"kibana_sample_data_ecommerce","caused_by":{"type":"runtime_exception","reason":"[kibana_sample_data_ecommerce][0] Watch out!"}}}]},"hits":{"total":{"value":0,"relation":"gte"},"max_score":null,"hits":[]}},"error":{"type":"status_exception","reason":"error while executing search","caused_by":{"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"kibana_sample_data_ecommerce","node":"aTguCaz_QamVRWwzvm0LGA","reason":{"type":"query_shard_exception","reason":"failed to create query: [kibana_sample_data_ecommerce][0] Watch out!","index_uuid":"kq37gPxmRBSoaQs0xhbGnA","index":"kibana_sample_data_ecommerce","caused_by":{"type":"runtime_exception","reason":"[kibana_sample_data_ecommerce][0] Watch out!"}}}]}}},"statusCode":400}
  1. Currently errored es responses aren't propagated through trackedEsSearches. I think this would be very useful to add.

  2. FYI, there is a testing module in es that could help with testing errors: elastic/elasticsearch#71674

)
.pipe(
tap((data) => {
if (trackingEsSearchMeta?.requestId && trackedEsSearches) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think that would be nice if this code also executed when searching request errors out completely.

}),
schema: schema.boolean(),
},
[UI_SETTINGS.ALLOW_CHECKING_FOR_FAILED_SHARDS]: {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure I understand the reason for adding the uiSetting

@flash1293
Copy link
Copy Markdown
Contributor

Agreed, reporting errors in the same way would be a nice addition. However I think it's fine to split that out into a separate PR as the issue is about shard warnings which were hidden completely from the users point of view previously (in case all shards fail it's very obvious from the state of the chart).

@alexwizp alexwizp merged commit 7e1b780 into elastic:main Jan 27, 2022
@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label Jan 27, 2022
awahab07 pushed a commit to awahab07/kibana that referenced this pull request Jan 31, 2022
* [TSVB] Fix shard failures are not reported elastic#122944

Closes: elastic#122944

* fix PR comments

* Update ui_settings.ts

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
alexwizp added a commit to alexwizp/kibana that referenced this pull request Feb 1, 2022
* [TSVB] Fix shard failures are not reported elastic#122944

Closes: elastic#122944

* fix PR comments

* Update ui_settings.ts

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 7e1b780)

# Conflicts:
#	src/plugins/vis_types/timeseries/common/constants.ts
#	src/plugins/vis_types/timeseries/kibana.json
#	src/plugins/vis_types/timeseries/public/metrics_type.ts
#	src/plugins/vis_types/timeseries/server/ui_settings.ts
#	x-pack/plugins/infra/server/lib/adapters/metrics/kibana_metrics_adapter.ts
alexwizp added a commit that referenced this pull request Feb 3, 2022
* [TSVB] Fix shard failures are not reported (#123474)

* [TSVB] Fix shard failures are not reported #122944

Closes: #122944

* fix PR comments

* Update ui_settings.ts

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 7e1b780)

# Conflicts:
#	src/plugins/vis_types/timeseries/common/constants.ts
#	src/plugins/vis_types/timeseries/kibana.json
#	src/plugins/vis_types/timeseries/public/metrics_type.ts
#	src/plugins/vis_types/timeseries/server/ui_settings.ts
#	x-pack/plugins/infra/server/lib/adapters/metrics/kibana_metrics_adapter.ts

* fix CI

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
flash1293 pushed a commit to flash1293/kibana that referenced this pull request Feb 9, 2022
* [TSVB] Fix shard failures are not reported elastic#122944

Closes: elastic#122944

* fix PR comments

* Update ui_settings.ts

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 7e1b780)

# Conflicts:
#	src/plugins/vis_types/timeseries/kibana.json
#	src/plugins/vis_types/timeseries/public/metrics_type.ts
flash1293 added a commit that referenced this pull request Feb 11, 2022
* [TSVB] Fix shard failures are not reported (#123474)

* [TSVB] Fix shard failures are not reported #122944

Closes: #122944

* fix PR comments

* Update ui_settings.ts

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 7e1b780)

# Conflicts:
#	src/plugins/vis_types/timeseries/kibana.json
#	src/plugins/vis_types/timeseries/public/metrics_type.ts

* fix

* fix telemetry

Co-authored-by: Alexey Antonov <alexwizp@gmail.com>
Co-authored-by: Kibana Machine <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 PR does not require backporting Feature:TSVB TSVB (Time Series Visual Builder) release_note:fix Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v7.17.1 v8.0.1 v8.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TSVB] Shard failures are not reported [TSVB] Allow Elasticsearch request bodies to be displayed

7 participants