-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
TSVB doesn't communicate it's index-patterns to dashboard #82964
Conversation
Pinging @elastic/kibana-app (Team:KibanaApp) |
8d3878d
to
bd50777
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elasticmachine merge upstream |
if (vis.type.getUsedIndexPattern) { | ||
indexPatterns = await vis.type.getUsedIndexPattern(vis.params); | ||
} else if (vis.data.indexPattern) { | ||
indexPatterns = [vis.data.indexPattern]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One idea that came to mind:
I'm wondering if, instead of having two sources of truth in a vis for the index pattern (either vis.data.indexPattern
OR vis.type.getUsedIndexPattern
), it would be cleaner to make a change in vis
itself so that vis.data.indexPattern
always reads from vis.type.getUsedIndexPattern
.
In vis.ts
we could do something like:
this.data.indexPattern = await this.type.getIndexPattern(this.data, this.params);
Then on the vis type:
await getIndexPattern(data: VisData, params: VisParams) {
...etc
}
Then on the vis type, getIndexPattern
is optional, and defaults to the logic that's currently in vis.ts
:
kibana/src/plugins/visualizations/public/vis.ts
Lines 140 to 153 in a17dcad
if (state.data && state.data.searchSource) { | |
this.data.searchSource = await getSearch().searchSource.create(state.data.searchSource!); | |
this.data.indexPattern = this.data.searchSource.getField('index'); | |
} | |
if (state.data && state.data.savedSearchId) { | |
this.data.savedSearchId = state.data.savedSearchId; | |
if (this.data.searchSource) { | |
this.data.searchSource = await getSearchSource( | |
this.data.searchSource, | |
this.data.savedSearchId | |
); | |
this.data.indexPattern = this.data.searchSource.getField('index'); | |
} | |
} |
WDYT @alexwizp? Do you think that would work / make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code here LGTM. I still think that it would feel a bit cleaner to modify setState
to call this new method from vis.type
, but I'll defer to @ppisljar's original feedback on that as I'm sure he had reasons for not doing so.
@elasticmachine merge upstream |
@ppisljar it wouldn't be right to merge/fix it without your feedback |
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Page load bundle
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code LGTM, not putting this on vis.data as that's specific to our 'classic' visualizations and should not try to cover all the custom vis types (like tsvb)
) * TSVB doesn't communicate it's index-patterns to dashboard Closes: elastic#81476 * useCustomSearchSource -> getUsedIndexPattern * fix CI Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
…83395) * TSVB doesn't communicate it's index-patterns to dashboard Closes: #81476 * useCustomSearchSource -> getUsedIndexPattern * fix CI Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* master: Migrate `/translations` route to core (elastic#83280) [APM] Ensure APM jest script can run (elastic#83398) [Uptime] Monitor status alert use url as instance (elastic#81736) [ML] Add basic license test run details to ML+Transform READMEs (elastic#83259) TSVB doesn't communicate it's index-patterns to dashboard (elastic#82964) [Alerting UI] Added ability to assign alert actions to resolved action group in UI (elastic#83139) Skips Vega test skip flaky suite (elastic#79967) [bundle optimization] Update to semver 7.x to get tree-shaking (elastic#83020) Added ability to fire actions when an alert instance is resolved (elastic#82799) [ML] Adds functional tests for the index data visualizer card contents (elastic#83174)
… into add-logs-to-node-details * 'add-logs-to-node-details' of github.com:phillipb/kibana: fix tall vislib charts in visualize (elastic#83340) [Lens] Avoid unnecessary data fetching on dimension flyout open (elastic#82957) [Security Solution][Case] Change case connector minimum required license to basic (elastic#83401) fix logstash central pipeline management test (elastic#83281) [Search] Send to background UI (elastic#81793) Migrate `/translations` route to core (elastic#83280) [APM] Ensure APM jest script can run (elastic#83398) [Uptime] Monitor status alert use url as instance (elastic#81736) [ML] Add basic license test run details to ML+Transform READMEs (elastic#83259) TSVB doesn't communicate it's index-patterns to dashboard (elastic#82964) [Alerting UI] Added ability to assign alert actions to resolved action group in UI (elastic#83139) Skips Vega test skip flaky suite (elastic#79967) [bundle optimization] Update to semver 7.x to get tree-shaking (elastic#83020) Added ability to fire actions when an alert instance is resolved (elastic#82799)
Hello Folks, |
@TheRiffRafi this fix covers Vega and TSVB, not timelion. I have created an issue to track it #86418. It is a little bit more complicated for Timelion but it is doable. |
) * TSVB doesn't communicate it's index-patterns to dashboard Closes: elastic#81476 * useCustomSearchSource -> getUsedIndexPattern * fix CI Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # src/plugins/vis_type_timeseries/public/metrics_type.ts # src/plugins/visualizations/public/embeddable/create_vis_embeddable_from_object.ts # src/plugins/visualizations/public/vis_types/base_vis_type.ts # src/plugins/visualizations/public/vis_types/types.ts
@stratoula this PR cover only TSVB related issues. For Vega we have a separate PR #84090. Please let me know if we also want to backport it into |
@alexwizp yes I meant that we did the fix for TSVB and vega for 7.11. Yes let's also backport the Vega PR ❤️ |
) (#86448) * TSVB doesn't communicate it's index-patterns to dashboard (#82964) * TSVB doesn't communicate it's index-patterns to dashboard Closes: #81476 * useCustomSearchSource -> getUsedIndexPattern * fix CI Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # src/plugins/vis_type_timeseries/public/metrics_type.ts # src/plugins/visualizations/public/embeddable/create_vis_embeddable_from_object.ts # src/plugins/visualizations/public/vis_types/base_vis_type.ts # src/plugins/visualizations/public/vis_types/types.ts * fix CI
Closes: #81476
Summary
For dashboard's filter bar to work visualisations communicate its index-patterns.
Some visualisations don't do that (#19408)
But according to (#19408 (comment)) TSVB should.
This is causing bugs and confusions with how filter bar is working on a dashboard when TSVB is used.
Especially filter bar is almost non usable for dashboards that have only TSVB visualisations and use non-default index patterns.
Steps to reproduce:
Checklist
Delete any items that are not applicable to this PR.
For maintainers