* Ensure we use existing Elasticsearch config
* Use separate type for this to ensure custom properties work
* PR suggestions
* PR feedback
* PR feedback
* Fix type issues
* PR feedback
* Allow registered alert types to be non-editable
* Fixed isUiEditEnabled values
* Fixed due to comments
* fixed failing tests
* Enable alert type selection per alert consumer, only 'alerting' consumer can display other consumers alert types, but in case if it isEditable
* fixed tests
* Removed consumer property from the client side alert type registry and added server side property producer which purpose is to manage a feature logic
* fixed type check
* Fixed tests and type checks
* Removed error message for non registered plugins
* Fixed failing tests
* Fixed due to comments
* fixed test
* -
* revert logic for requiresAppContext
* Added close toast after saving alert
* Final phase before the complete cutover
* NP migration
* lint fix
* More NP stuff
* Moved Stack Monitoring client plugin outside legacy and fixed all tests
* ...
* Removed unused files
* Fix for main links
* Fixed more tests
* Fixed redirect when clicking on SM icon again
* Code review feedback
* Addressed code review feedback
* Fixed return value
Work on #61313 has revealed that we don't have amock for AlertServices, which creates coupling between us and any solution depending on us, which makes it harder to make changes in our own code.
This PR adds mocks and uses them in SIEM, Monitoring and Uptime, so that we can make future changes without having to change outside solutions.
* [Telemetry] Add posibility of regitering exclusive collectors for collections
* [Telemetry] Filter unwanted fields from the kibana.os telemetry payload
* Filter the collectors properly in bulkFetch
* Move "kibana" usage collector from Monitoring to OSS Telemetry
* Remove exclusivity of the "kibana_settings" collector
* Unify "kibana_stats" collector from Monitoring and Legacy
* Remove unused legacy constants
* Proper type for UsageCollectionSetup in monitoring
* Missed one undo
* Add unit tests to the migrated collectors
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* WIP
* Add new alert with tests
* Fix type issues, and disable new alerting for tests
* Fix up the view all alerts view
* Turn off for merging
* Fix jest test
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* add plugin own contract as third element of getStartServices result
* adapt plugins code
* update tests
* revert unknown to use void again
* update generated doc
* fix UT
* update mock to allow non-object `pluginStartContract`
* add @typeParam documentation
* Align api/stats with the monitoring logic for kibana ops metrics
* Align collectors
* Add in locale to kibana_settings
* More tweaks
* PR feedback
* PR feedback
* [Telemetry] Migration to NP
* Telemetry management advanced settings section + fix import paths + dropped support for injectVars
* Fix i18nrc paths for telemetry
* Move ui_metric mappings to NP registerType
* Fixed minor test tweaks
* Add README docs (#60443)
* Add missing translation
* Update the telemetryService config only when authenticated
* start method is not a promise anymore
* Fix mocha tests
* No need to JSON.stringify the API responses
* Catch handleOldSettings as we used to do
* Deal with the forbidden use case in the optIn API
* No need to provide the plugin name in the logger.get(). It is automatically scoped + one missing CallCluster vs. APICaller type replacement
* Add empty start method in README.md to show differences with the other approach
* Telemetry collection with X-Pack README
* Docs update
* Allow monitoring collector to send its own ES client
* All collections should provide their own ES client
* PR feedback
* i18n NITs from kibana-platform feedback
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* First pass
* First pass
* Add new routes
* Getting closer
* Remove legacy server code, and other fixes
* Register the plugin with xpack
* Pass a legacy client to telemetry
* Suport callWithInternalUser
* Remove this
* More NP work
* Fix some tests
* Fix broken test
* Move over new telemetry changes, and fix other issues
* Fix TODO item
* Reuse the same schema as elasticsearch module
* Use a singular config definition here
* Disable this for now
* Use the right method
* Use custom config again
* Tweak the config to make this optional
* Remove these
* Remove these unnecessary files
* Fix jest test
* Fix some linting issues
* Fix type issue
* Fix localization issues
* Use the elasticsearch config
* Remove todos
* Fix this check
* Move kibana alerting over
* PR feedback
* Use new metrics core service
* Change config for xpack_api_polling_frequency_millis
* Make sure this is disabled for now
* Disable both
* Update this to the new function
* Tighten up legacy api needs
* Check for existence
* Fix jest tests
* Cleaning up the plugin definition
* Create custom type in our plugin
* Revert this change
* Fix CI issues
* Add these tests back
* Just use a different collector type
* Handle errors better
* Use custom type
* PR feedback
* Fix type issues
* PR feedback
* Initial attempt at a reactor of how this works
* Enter and exiting setup mode with migration buttons working
* Adding monitoring url step back in and some small cleanup
* Elasticsearch steps
* Add missing file
* Better organization here
* Remove this debug logic
* Clean up
* PR feedback
* Add in monospacing
* Persist monitoring url in local storage
* Rework the steps
* Change node to server, and add missing files
* Fix linting issues
* Fix api integration tests
* PR feedback
* Pass down if the product is the "primary" or not, then use that to show certain warnings in the UI (just supported for Kibana right now)
* Elasticsearch migration will work slightly differently in that all nodes must be partially migrated before we can disable internal collection
* More PR feedback
* PR feedback
* Better links
* Fix tests
* This should open in a new tab
* PR feedback
* Design and PR feedback
* Fix these tests
* PR feedback
* Remove debug
* PR feedback
* Update the import path
* Update this import path too
* PR feedback
* Fix i18n
* Minor changes to text.
* "Basic" is a proper name, so it should be capatalized.
* Cluster Alerts are plural.
* Fix tests to align with help text changes
* Missed one test file
* Initial code to force collectors to indicate when they are ready
* Add and fix tests
* Remove debug
* Add ready check in api call
* Fix prettier complaints
* Return 503 if not all collectors are ready
* PR feedback
* Add retry logic for usage collection in the reporting tests
* Fix incorrect boomify usage
* Fix more issues with the tests
* Just add debug I guess
* More debug
* Try and handle this exception
* Try and make the tests more defensive and remove console logs
* Retry logic here too
* Debug for the reporting tests failure
* I don't like this, but lets see if it works
* Move the retry logic into the collector set directly
* Add support for this new collector
* Localize this
* This shouldn't be static on the class, but rather static for the entire runtime
* Initial logic and tests for this
* Improve test
* Some cleanup and adding api integration tests
* Add comments
* Account for no documents returned
* Add detection logic and tests
* Ensure these fields are optional
* Update detection logic
* Beats, logstash and apm can only possibly exist
* Fix some issues with APM
* Fix tests
* Small updates based on needing to also include the filebeat index
* Fix issue with the reduce
* PR feedback
* More PR feedback
* Add additional tests
* Add additional tests
* Initial implementation
* More logs UI work
* Remove unnecessary code
* Add support to build a logs url based on the cluster and/or node uuid
* Deep link directly
* Update link
* Use CCS to access remote filebeat data
* Fix existing tests
* Add log specific api integration tests
* Localization
* Adding more localization
* Adding unit tests for logs ui
* Client side unit tests, configuration for log fetch count, adding visual callout for why we can't detect logs
* Remove debug
* Fix localization issue
* Update tests
* PR feedback
* Update import
* Format the count to avoid a huge string of numbers
* Use @timestamp instead
* Handle scenario where the time period is not right but the type exists
* Update jest tests
* Update api tests
* Text changes
* Add periods
* Update tests
Resolves#27513.
_This PR is a combination of #31293 (the code changes) + #33570 (test updates). These two PRs were individually reviewed and merged into a feature branch. This combo PR here simply sets up the merge from the feature branch to `master`._
Summary of changes, taken from #31293:
## Before this PR
The Logstash Pipeline Viewer UI would make a single Kibana API call to fetch all the information necessary to render the Logstash pipeline. This included information necessary to render the detail drawer that opens up when a user clicks on an individual vertex in the pipeline.
Naturally, this single API call fetched _a lot_ of data, not just from the Kibana server but also, in turn, from Elasticsearch as well. The "pro" of this approach was that the user would see instantaneous results if they clicked on a vertex in a pipeline and opened the detail drawer for that vertex. The "cons" were the amount of computation Elasticsearch had to perform and the amount of data being transferred over the wire between Elasticsearch and the Kibana server as well as between the Kibana server and the browser.
## With this PR
This PR makes the Kibana API call to fetch data necessary for **initially** rendering the pipeline — that is, with the detail drawer closed — much lighter. When the user clicks on a vertex in a pipeline, a second API call is then made to fetch data necessary for the detail drawer.
## Gains, by the numbers
Based on a simple, 1-input, 1-filter, and 1-output pipeline.
* Before this PR, the Elasticsearch `logstash_stats` API responses (multiple calls were made using the `composite` aggregation over the `date_histogram` aggregation) generated a total of 1228 aggregation buckets (before any `filter_path`s were applied but across all `composite` "pages"). With this PR, the single `logstash_stats` API response (note that this is just for the initial rendering of the pipeline, with the detail drawer closed) generated 12 buckets (also before any `filter_path`s were applied). That's a **99.02% reduction** in number of buckets.
* Before this PR, the Elasticsearch `logstash_stats` API responses added up to 70319 bytes. With this PR, the single `logstash_stats` API response for the same pipeline is 746 bytes. That's a **98.93% reduction** in size.
* Before this PR, the Elasticsearch `logstash_state` API response was 7718 bytes. With this PR, the API response for the same pipeline is 2328 bytes. That's a **69.83% reduction** in size.
* Before this PR the Kibana API response was 51777 bytes. With this PR, the API response for the same pipeline is 2567 bytes (again, note that this is just for the initial rendering of the pipeline, with the detail drawer closed). That's a **95.04% reduction** in size.
* [@kbn/expect] "fork" expect.js into repo
* [eslint] autofix references to expect.js
* [tslint] autofix all expect.js imports
* now that expect.js is in strict mode, avoid reassigning fn.length
* Minor change to stack monitoring tooltips
In the Linux documentation and source code, cgroups are always referred to without
capitalization and should be here as well.
* Update Jest snapshots
* Update more test fixtures
We have had `insert_final_newline = true` in our `.editorconfig` file since April 2015, but never validated it with eslint. I'm a little tired of extra changes showing up in PRs because some people use editors which respect the `.editorconfig` file and some don't, so I figured we might want to enable the rule in eslint so that the can be autofixed.
Votes requested please :)