Your window into the Elastic Stack
Find a file
Ryland Herrick 63e1e750dd
[SIEM] Migrating frontend services to NP (#53669) (#53727)
* [SIEM] Migrating frontend services to NP (#52783)

* Remove legacy index_patterns import

We'd already brought in the new interface in a previous commit; this was
just used as an unnecessary type assertion.

* Update snapshots following new docLink mocks

* Remove unused manual mocks

These are not picked up by jest; calling
jest.mock('lib/compose/kibana_core') has the same effect whether or not
these files exist.

* WIP: Use kibana core mock everywhere we're doing it manually

The timeline tests are the last place we're explicitly mocking
useKibanaCore; removing the mocks cause tests to hang. I think  hey're
relying on the side effects of importing the mock/ui_settings file, but
I'll figure that out next.

* Replace ui/documentation_links with core NP service

In most instances, this meant using the useContext hook with our NP core
context.

This also updates our mocks to leverage the factory so graciously
provided by platform.

There are a few failing tests, mostly due to links being previously
undefined in tests.

* Use new mocks on timeline test that doesn't hang

The rest of these do, though.

* Remove remaining uses of mockUiSettings in useKibanaCore mocks

These have to be evaluated immediately so that we always return the
same core object. Otherwise we get stuck in a loop between
render/useEffect/setState due to the savedObjects client being different
on each invocation.

* Invoke platform's mock factory at mock time

Previously, we were invoking it any time someone called `useKibanaCore`,
getting a new object back each time. This both caused some bugs (looping
with useEffect) and was not representative of how the actual hook
worked.

This also moves that invokation into the mock function, along with
shaping the mocked module so that we don't have to do it in every call
to jest.mock.

* WIP: migrating to use kibana_react's provider and helpers

We're re-exporting these locally to have more control around mocking
them (until platform implements that).

This breaks everything that was using the old mocks. Will fix.

* WIP: Migrating to use kibana_react

Instead of our homegrown hooks we can use these utilities instead.

Unfortunately kibana_react doesn't yet have mocks, so we had to implement
that ourselves. Luckily, we already had local mocks for the settings
service. This migrates to a the new format. For clarity and consistency,
we also re-export new platform's mocks here and use them to populate our
kibana_react mocks.

We started by migrating the UiSettings service to new platform, and let
that drive the rest. With the mocks in place for kibana_react, removing
the usage of useKibanaCore was a natural step as well.

The next step is removing the usage of chrome.getUiSettingsClient with
our useUiSetting$ hook, and with that (and maybe some config setup; I'm
seeing errors at runtime), we should be ready to start migrating other
services.

* Bind a copy of kibana at mock creation

We were previously returning a new copy any time e.g. useKibana was
called, which is not the contract that consumers are expecting. and in
fact caused looping with components employing useEffect etc.

* Remove internal context providers and last usage

We're now using kibana_react fully.

* Fix tests failing due to wrong mocks

Remaining failures are either due to a date format issue, or something
being rendered differently. Those are up next.

Still haven't touched use of chrome.getUiSettingsClient, that's after.

* Fix test failures related to date formatting

* mocks missing UI Setting (DEFAULT_TIMEZONE_BROWSER) which is required
by our formatted_date utilities
* mock timepicker ranges in the one test that uses it (SuperDatePicker)

* Remove unnecessary and/or redundant mocks

Since our TestProvider now mocks new platform, the only tests that
should need to mock uiSettings related stuff (e.g. timezone preferences)
would be the tests that (directly or no) use kibana_react to get it.

* Refactor kibana_react mocks

* adds a mock for the non-observable useUiSetting
* removes the unmockable HOC withKibana

* Replace usage of chrome.getUiSettingsClient with useUiSetting

We're opting for the non-observable behavior here because I believe
that's more analagous.

There are a few remaining usages in non-react code.

Tests are still using the mocks, those'll be removed next.

* Remove ui_settings mocks

Now that we're not using this hook there's no need for the mocks. Tests
are green.

* Remove siem's UI settings hook

We're now using the ones provided by kibana_react.

* Use withKibana HOC on our component classes

React was kind enough to remind me that I can't put hooks in classes.
Whoops.

* Set defaults for some unknown UI settings

The service claims not to know about these settings we're retrieving.
Until I can figure out where they should come from, we're going to
initialize them with what seem to be the defaults at plugin
initialization.

* Remove old hooks

These have now been replaced with kibana_react's equivalents.

* Fix type error on usage of useKibana hook

This is one of the few places where we're using another plugin, which
are not present in the default typings due to their opt-in nature.

* Fix type error on ML call

The indexPattern we get back is actually an array. The endpoint seems to
handle this just fine (at least, it doesn't blow up), but once we
started retrieving a typed value this error surfaced.

* Export a 'bound' version of the useKibana function

Rather than having to type this on each invocation. This requires us to
define which plugins we depend on, which is a good thing.

* Instantiate our mock function

We aren't using these right now I didn't notice, but that wasn't the
right reference.

* Fix test that relies on unmocked service

Our QueryBar component relies very (very, very) indirectly on a storage
service that does not exist in New Platform, nor its corresponding
mocks. To get it passing for now, we're just gonna pretend like it's
there.

* Remove use of ui/chrome in our charts

Replaces with hooks that accomplish the same.

* Remove last use of chrome.getUiSettingsClient

This function is itself a hook, so we should be good here.

* Remove unnecessary non-null assertions

Now that we're using our typed version of the useKibana hook, typescript
knows that these services will be available (once we actually enforce
that in our kibana.json, of course).

* Fix chart tests

These rely on a kibana hook now, so we need to mock it out for these
renders lest we blow up when the context isn't there.

* Replace missing mock

I deleted this in a previous commit, thinking it unneeded.
However, getHostDetailsBreadcrumbs ultimately asks for some
default date parameters for the timerange boundaries.

* Add back tests for our theming hook

* Style: cleanup

* Remove unneeded default UI Settings values

We were previously getting errors due to these values not being known to
the client, but it looks like that was either fixed upstream, or a
temporary issue caused by some improper context setup.

* Simplify kibana_react mocks

Let's leave JSX out of it.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

* Update references to now-deleted hooks

These hooks were deleted on a recent branch, but new usages were merged
to master in the meantime.

* Fix remaining uses of hooks/chrome that were not merge conflicts

* Use HOC on class component

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2019-12-20 17:12:07 -06:00
.ci Add top level examples folder and command to run, --run-examples. (#52027) (#52739) 2019-12-11 10:38:49 -05:00
.github Revert commit of CODEOWNERS in non-master branch 2019-12-11 12:11:56 -08:00
bin Update node options Initialization on our scripts (#40302) (#43358) 2019-08-15 17:30:07 +01:00
common/graphql [Uptime] Implement EuiSuperDatePicker (#28217) 2019-01-18 13:44:58 -05:00
config Hide stderr git output during APM agent configuration (#52878) (#52890) 2019-12-12 17:58:40 +01:00
data [folder structure] plugins/.data -> data 2016-07-05 14:06:16 -05:00
docs [docs][APM] Clarify advanced queries (#53034) (#53600) 2019-12-20 14:03:42 -08:00
examples Embeddable examples on the platform and included with --run-examples flag (#52111) (#53190) 2019-12-16 17:45:26 -05:00
licenses Migrate x-pack-kibana source to kibana 2018-04-24 13:48:10 -07:00
packages Shim input_control_vis for KP (#52243) (#53547) 2019-12-19 09:08:04 -06:00
rfcs/text Console to NP ready (#43346) (#45511) 2019-09-12 18:30:03 +02:00
scripts autofix all violations 2019-12-13 23:55:01 -07:00
src [7.x] Enforce shimmed plugin boundaries (#52633) (#53716) 2019-12-20 23:41:28 +01:00
style_guides Style guide cleanup (#46464) (#46559) 2019-09-25 13:19:15 +02:00
tasks Embeddable examples on the platform and included with --run-examples flag (#52111) (#53190) 2019-12-16 17:45:26 -05:00
test [7.x] Enforce shimmed plugin boundaries (#52633) (#53716) 2019-12-20 23:41:28 +01:00
typings [7.x ]Backport/7.x/pr 52688 (#53720) 2019-12-20 13:57:09 -07:00
utilities autofix all violations 2019-12-13 23:55:01 -07:00
vars [7.x] Print out agent debugging links during CI (#52812) (#52901) 2019-12-12 15:14:35 -05:00
webpackShims autofix all violations 2019-12-13 23:55:01 -07:00
x-pack [SIEM] Migrating frontend services to NP (#53669) (#53727) 2019-12-20 17:12:07 -06:00
.backportrc.json [backport-config] Adds 7.4 branch (#44402) 2019-08-29 10:11:53 -07:00
.browserslistrc [7.x] [autoprefixer] upgrade to 9.6.1, unify browserslist hand… (#41145) 2019-07-15 13:01:17 -07:00
.editorconfig Apply the same editorconfig rules to both markdown and asciidoc files 2016-09-07 11:41:41 -04:00
.eslintignore [7.x] Move @kbn/es-query into data plugin (#51014) (#51783) 2019-11-26 16:07:16 -07:00
.eslintrc.js [7.x] Add lint rule to prevent server code being imported into… (#53019) 2019-12-16 16:46:07 -06:00
.gitattributes [7.x] [canvas] Color fixes + Storybook 5 (#34075) (#34369) 2019-04-02 16:35:28 -05:00
.gitignore Instrument Kibana with Elastic APM (#43548) (#52186) 2019-12-04 17:04:12 +01:00
.i18nrc.json NP Migration: Sample data (#52753) (#53718) 2019-12-20 21:06:42 +01:00
.node-version Update Node.js to version 10.18.0 (#52865) (#53471) 2019-12-18 15:48:59 +01:00
.nvmrc Update Node.js to version 10.18.0 (#52865) (#53471) 2019-12-18 15:48:59 +01:00
.prettierrc Increase prettier line width to 100 (#20535) 2018-07-09 22:50:37 +02:00
.sass-lint.yml Move query utils ⇒ NP (#49636) (#50633) 2019-11-14 14:49:25 +02:00
.yarnrc [kbn-pm] Use yarn workspaces for dependencies (#24095) 2018-11-12 12:38:11 -06:00
CONTRIBUTING.md Add example apm.dev.js config file to CONTRIBUTING.md (#52206) (#52292) 2019-12-05 19:06:40 +01:00
FAQ.md propose language changes (#10709) 2017-03-05 12:10:32 -05:00
github_checks_reporter.json implementing github checks - second attempt (#35757) (#35906) 2019-05-01 19:53:02 -05:00
Gruntfile.js autofix all violations 2019-12-13 23:55:01 -07:00
Jenkinsfile Add PR comments to pipeline (#51504) (#52143) 2019-12-03 20:36:16 -05:00
kibana.d.ts Update eslint related packages (#48513) (#48853) 2019-10-22 06:41:28 -07:00
LICENSE.txt Migrate x-pack-kibana source to kibana 2018-04-24 13:48:10 -07:00
NOTICE.txt [7.x] remove remaining idx usage (#52354) (#52580) 2019-12-09 19:09:11 -07:00
package.json [7.x ]Backport/7.x/pr 52688 (#53720) 2019-12-20 13:57:09 -07:00
preinstall_check.js Apache 2.0 license headers (#19383) 2018-05-28 20:06:30 -07:00
README.md [7.x] chore: point issue links to choose (#49616) (#49648) 2019-10-29 20:37:52 +01:00
renovate.json5 [7.x] Update babel-typescript config (#53108) (#53167) 2019-12-17 11:11:03 +01:00
STYLEGUIDE.md [7.x] Upgrade to TypeScript 3.7.2 (#47188) (#50756) 2019-11-15 13:49:03 +01:00
tsconfig.browser.json [typescript] continue to use the default config in development (#21966) 2018-08-14 15:27:07 -07:00
tsconfig.json Es ui shared updates (#46570) (#46716) 2019-10-29 11:25:50 +01:00
tsconfig.types.json [Core] Move Saved objects files to core (#38771) (#39158) 2019-06-19 17:27:16 +02:00
TYPESCRIPT.md [7.x] Update deprecated React.SFC and React.StatelessComponent types (#50852) (#51336) 2019-11-22 13:12:30 +01:00
yarn.lock [7.x ]Backport/7.x/pr 52688 (#53720) 2019-12-20 13:57:09 -07:00

Kibana

Kibana is your window into the Elastic Stack. Specifically, it's a browser-based analytics and search dashboard for Elasticsearch.

Getting Started

If you just want to try Kibana out, check out the Elastic Stack Getting Started Page to give it a whirl.

If you're interested in diving a bit deeper and getting a taste of Kibana's capabilities, head over to the Kibana Getting Started Page.

Using a Kibana Release

If you want to use a Kibana release in production, give it a test run, or just play around:

Building and Running Kibana, and/or Contributing Code

You might want to build Kibana locally to contribute some code, test out the latest features, or try out an open PR:

Documentation

Visit Elastic.co for the full Kibana documentation.

For information about building the documentation, see the README in elastic/docs.

Version Compatibility with Elasticsearch

Ideally, you should be running Elasticsearch and Kibana with matching version numbers. If your Elasticsearch has an older version number or a newer major number than Kibana, then Kibana will fail to run. If Elasticsearch has a newer minor or patch number than Kibana, then the Kibana Server will log a warning.

Note: The version numbers below are only examples, meant to illustrate the relationships between different types of version numbers.

Situation Example Kibana version Example ES version Outcome
Versions are the same. 5.1.2 5.1.2 💚 OK
ES patch number is newer. 5.1.2 5.1.5 ⚠️ Logged warning
ES minor number is newer. 5.1.2 5.5.0 ⚠️ Logged warning
ES major number is newer. 5.1.2 6.0.0 🚫 Fatal error
ES patch number is older. 5.1.2 5.1.0 ⚠️ Logged warning
ES minor number is older. 5.1.2 5.0.0 🚫 Fatal error
ES major number is older. 5.1.2 4.0.0 🚫 Fatal error

Questions? Problems? Suggestions?

  • If you've found a bug or want to request a feature, please create a GitHub Issue. Please check to make sure someone else hasn't already created an issue for the same topic.
  • Need help using Kibana? Ask away on our Kibana Discuss Forum and a fellow community member or Elastic engineer will be glad to help you out.