Skip to content

Conversation

@cjcenizal
Copy link
Contributor

Release note

The Data Streams tab in Index Management now allows users to view additional information for data streams:

  • Health
  • Storage size on disk
  • Timestamp the data stream was last updated
  • The index template that configures the data stream's indices
  • The index lifecycle policy that manages the data stream's lifecycle

ds_stats

image

Testing

To test this PR, create a data stream and then view it in the UI:

PUT _index_template/ds
{
  "index_patterns": ["ds"],
  "data_stream": {},
  "template": {
    "settings": {
      "index.lifecycle.name": "kibana-event-log-policy"
    }
  }
}

POST ds/_doc
{
  "@timestamp": "2020-01-27"
}

- Extract out DataHealth component for use in both Data Streams and Indices tabs.
- Refactor detail panel to use data structure & algo to build component.
- Refactor detail panel to use i18n.translate instead of FormattedMessage.
… panel.

- Add 'Include stats' switch.
- Add humanizeTimeStamp service, localized to data streams.
@cjcenizal cjcenizal added release_note:enhancement Feature:Index Management Index and index templates UI v8.0.0 Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// v7.10.0 labels Aug 14, 2020
@cjcenizal cjcenizal marked this pull request as ready for review August 16, 2020 20:01
@cjcenizal cjcenizal requested a review from a team as a code owner August 16, 2020 20:01
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

@cjcenizal
Copy link
Contributor Author

@elasticmachine merge upstream

1 similar comment
@cjcenizal
Copy link
Contributor Author

@elasticmachine merge upstream

@cjcenizal
Copy link
Contributor Author

@elasticmachine merge upstream

@cjcenizal
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@alisonelizabeth alisonelizabeth left a comment

Choose a reason for hiding this comment

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

Nice job @cjcenizal! LGTM. Tested locally. I left a few non-blocking comments.

@@ -0,0 +1,22 @@
# Index Management UI
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding this!


const clickIncludeStatsSwitch = () => {
const { find } = testBed;
find('includeStatsSwitch').simulate('click');
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] The test lib does provide toggleEuiSwitch, which checks for the existence of the element before simulating click.

https://github.com/elastic/kibana/blob/master/src/test_utils/public/testbed/testbed.ts#L246

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I'll convert this to use toggleEuiSwitch.

}),
content:
ilmPolicyName ??
i18n.translate('xpack.idxMgmt.dataStreamDetailPanel.ilmPolicyContentNoneMessage', {
Copy link
Contributor

Choose a reason for hiding this comment

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

does this need i18n?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably not 😄 I'll remove it. Good spot!

import { RouteDependencies } from '../../../types';
import { addBasePath } from '../index';

// Require the template format version (V1 or V2) to be provided as Query param
Copy link
Contributor

Choose a reason for hiding this comment

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

Wrong comment? 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, right

// type, and then remove it.
expect(dataStream.storageSize).to.be.ok();
expect(typeof dataStream.storageSize).to.be('string');
delete dataStream.storageSize;
Copy link
Contributor

@alisonelizabeth alisonelizabeth Aug 21, 2020

Choose a reason for hiding this comment

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

Can you explain why storageSize needs to be deleted? Never mind I understand now based on your comment above. It does feel a little strange to delete it though in a test. Could you do something like this instead?

const { storageSize, ....response } = dataStream;

and assert against response?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea! Will do.


import moment from 'moment';

export const humanizeTimeStamp = (timeStamp?: number): string =>
Copy link
Contributor

Choose a reason for hiding this comment

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

should timeStamp be required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great spot! Will fix.

@cjcenizal
Copy link
Contributor Author

@alisonelizabeth I ended up rendering "None" instead of a dash for when data is missing. I think this will be more useful for screen readers and for other locales.

image

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

@kbn/optimizer bundle module count

id value diff baseline
indexManagement 500 +1 499

async chunks size

id value diff baseline
indexManagement 1.6MB +5.9KB 1.5MB

page load bundle size

id value diff baseline
indexManagement 248.1KB -91.0B 248.1KB

History

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

@cjcenizal cjcenizal merged commit 50499a5 into elastic:master Aug 22, 2020
@cjcenizal cjcenizal deleted the data-streams/related-entities branch August 22, 2020 00:53
cjcenizal added a commit that referenced this pull request Aug 22, 2020
…75107) (#75713)

* Add Index Management README and quick testing steps for data streams.
* Surface data stream health in Data Streams tab (table and detail panel).
  - Extract out DataHealth component for use in both Data Streams and Indices tabs.
  - Refactor detail panel to use data structure & algo to build component.
  - Refactor detail panel to use i18n.translate instead of FormattedMessage.
* Render index template name and index lifecycle policy name in the detail panel.
* Render storage size and max timestamp information in table and detail panel.
  - Add 'Include stats' switch.
  - Add humanizeTimeStamp service, localized to data streams.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Index Management Index and index templates UI release_note:enhancement Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// v7.10.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants