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

Table Visualization for TSVB #12813

Merged
merged 56 commits into from
Oct 24, 2017
Merged

Conversation

simianhacker
Copy link
Member

@simianhacker simianhacker commented Jul 12, 2017

This PR adds a table visualization for Time Series Visual Builder. For the most part everything works like the rest of the visualizations with a few exceptions:

  • The user MUST pick a group by field to aggregate the data on.
  • Series Aggs are not available via the normal aggregation picker. The same functionality is located in the series options.
  • Series can have filters that are applied only to that series (or column). This is useful for things like network traffic where you want to aggregate the series by system.network.name but you want to filter using -system.network.name:lo* to remove localhost.
  • Time shifting is removed (since everything is run with the same aggregation)
  • Sorting works only on columns where the last metric is a basic aggregation (or sortable)

Editor

image

On a dashboard

image

Series Options

image

Panel Options

image

@simianhacker simianhacker added Feature:TSVB TSVB (Time Series Visual Builder) Feature:Visualizations Generic visualization features (in case no more specific feature label is available) WIP Work in progress labels Jul 12, 2017
@trevan
Copy link
Contributor

trevan commented Jul 13, 2017

@simianhacker, what do you mean by "id_field to pivot data on"?

I'm also curious why you are using different sort icons from the rest of the app?

@simianhacker
Copy link
Member Author

@shaharmor The date_histogram is being used and is at the heart of TSVB, even in the TopN, Gauge, Metric and Table visualizations. This is what allows users to create metrics like "current network throughput" or any kind of rate. You need the historical data to do the derivative for those metrics. Also currently in Kibana there isn't any other way to show the value of the "last bucket" or what could be considered the "near real time" value.

Copy link
Contributor

@mattapperson mattapperson left a comment

Choose a reason for hiding this comment

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

When creating a a new vis and selecting table I am getting the error of

TypeError: Cannot read property 'order' of undefined
    at doc (/Users/mattapperson/Development/kibana/src/core_plugins/metrics/server/lib/vis_data/request_processors/table/pivot.js:47:51

Not sure if this is because I need to adjust metrics, but at the very least this should really be handled differently

Copy link
Contributor

@mattapperson mattapperson left a comment

Choose a reason for hiding this comment

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

code LGTM, just need to fix that one error

Copy link
Contributor

@mattapperson mattapperson left a comment

Choose a reason for hiding this comment

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

LGTM

@shaharmor
Copy link
Contributor

When is this going to be merged? Are you waiting for the 6.0 GA in order to merge it to the 6.x branch?

@simianhacker
Copy link
Member Author

@shaharmor Probably some time today :D

@simianhacker simianhacker merged commit d891623 into elastic:master Oct 24, 2017
simianhacker added a commit that referenced this pull request Oct 24, 2017
* Adding table vis

* Making linter happy

* Getting the data api inline

* Fixing aggs for table vis

* Fixing aggs for table vis

* Adding table vis

* Adding uiState and sorting

* Adding sorting

* Adding sorting and removing display fields

* fixing color picker in timeseries and gauge; thresholds for trend arrows

* Removing thresholds from trends

* removing background color

* remvoing obsolete tests

* Fixing terminology... pivot doesn't make sense

* updating error message

* making the sort icons match the rest of the app

* Fixing eslint bullshit

* Fixing a few bugs from merges

* Fixing linting issues

* Adding a falsy check

* Adding aria labels

* Changing toggle to use a button

* Adding focus-ring back in

* Adding check for model and visData; they should never be null

* Changing ids to use new htmlIdGenerator function

* Switching to htmlIdGenerator

* Fixing the way sorting works; fixing the error handling

* making no data compatible with vis

* Fixing defaults bug; Adding missing css rule

* Fixing sorting bug
@simianhacker
Copy link
Member Author

Back ported to 6.x with fe7e8a5

min_doc_count: 0,
extended_bounds: {
min: from.valueOf(),
max: to.valueOf() - (bucketSize * 1000)
Copy link
Contributor

Choose a reason for hiding this comment

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

@simianhacker why do you reduce the bucketSize here?

Copy link
Member Author

Choose a reason for hiding this comment

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

This was removed from the rest of TSVB but because this PR languished in review for so long I forgot to remove it from here as well. I have a PR that fixes this. #14553

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops... Added that one as well to the PR... Thanks!

filter: {
range: {
[timeField]: {
gte: to.valueOf() - (bucketSize * 1500),
Copy link
Contributor

Choose a reason for hiding this comment

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

Also here, why change the value?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is here for sorting, the group by terms works the same way (https://github.com/elastic/kibana/blob/master/src/core_plugins/metrics/server/lib/vis_data/request_processors/series/split_by_terms.js#L26-L44). You can't sort a terms aggregation on a metric that is a child of a date histogram so you have to create a metric outside the date histogram to sort on with a filter that approximates the last bucket. I originally took the bucket size and multiplied by 1000 milliseconds but would occasionally get strange results; using 1500 milliseconds made things more reliable. Also notice this is slightly different because it's adding the time to the gte side and not the lte side.

chrisronline pushed a commit to chrisronline/kibana that referenced this pull request Nov 20, 2017
* Adding table vis

* Making linter happy

* Getting the data api inline

* Fixing aggs for table vis

* Fixing aggs for table vis

* Adding table vis

* Adding uiState and sorting

* Adding sorting

* Adding sorting and removing display fields

* fixing color picker in timeseries and gauge; thresholds for trend arrows

* Removing thresholds from trends

* removing background color

* remvoing obsolete tests

* Fixing terminology... pivot doesn't make sense

* updating error message

* making the sort icons match the rest of the app

* Fixing eslint bullshit

* Fixing a few bugs from merges

* Fixing linting issues

* Adding a falsy check

* Adding aria labels

* Changing toggle to use a button

* Adding focus-ring back in

* Adding check for model and visData; they should never be null

* Changing ids to use new htmlIdGenerator function

* Switching to htmlIdGenerator

* Fixing the way sorting works; fixing the error handling

* making no data compatible with vis

* Fixing defaults bug; Adding missing css rule

* Fixing sorting bug
chrisronline pushed a commit to chrisronline/kibana that referenced this pull request Dec 1, 2017
* Adding table vis

* Making linter happy

* Getting the data api inline

* Fixing aggs for table vis

* Fixing aggs for table vis

* Adding table vis

* Adding uiState and sorting

* Adding sorting

* Adding sorting and removing display fields

* fixing color picker in timeseries and gauge; thresholds for trend arrows

* Removing thresholds from trends

* removing background color

* remvoing obsolete tests

* Fixing terminology... pivot doesn't make sense

* updating error message

* making the sort icons match the rest of the app

* Fixing eslint bullshit

* Fixing a few bugs from merges

* Fixing linting issues

* Adding a falsy check

* Adding aria labels

* Changing toggle to use a button

* Adding focus-ring back in

* Adding check for model and visData; they should never be null

* Changing ids to use new htmlIdGenerator function

* Switching to htmlIdGenerator

* Fixing the way sorting works; fixing the error handling

* making no data compatible with vis

* Fixing defaults bug; Adding missing css rule

* Fixing sorting bug
@Shifter2600
Copy link

Issue when using a Date field as the Group By Field.
I have a field that is formatted to YYYY-MM and when I try to use that as my group by I get
1443657600000
1427846400000
1430438400000
....
The Columns should be taking the Field Specific Format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:TSVB TSVB (Time Series Visual Builder) Feature:Visualizations Generic visualization features (in case no more specific feature label is available) review v6.1.0 v7.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants