Commit graph

28 commits

Author SHA1 Message Date
Cauê Marcondes e7b0e28237
[APM] Track usage of Gold+ features (#77630)
* adding license check

* fixing api test

* refactoring
2020-09-18 10:14:13 +02:00
Larry Gregory 2e34eb239f
Hide management sections based on cluster/index privileges (#67791)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-14 09:30:47 -04:00
Dario Gieselaar 113936a649
[APM] Use observer.hostname instead of observer.name (#76074) 2020-09-07 11:11:00 +02:00
Oliver Gupte b1cb8b8c7f
[APM] Transaction duration anomaly alerting integration (#75719)
* Closes #72636. Adds alerting integration for APM transaction duration anomalies.

* Code review feedback

* Display alert summary with the selected anomaly severity label instead of the anomaly score.

* - refactored ALL_OPTION and NOT_DEFINED_OPTION to be shared from common/environment_filter_values
- utilize getEnvironmentLabel in the alerting trigger components and added support for the 'All' label

* refactor get_all_environments to minimize exports and be more consistent and clean

* - Reorg the alerts menu for different alert types (threshold/anomaly)
- default environment alert settings to the selected filter

* - Filters default transaction type to only those supported in the APM anomaly detection jobs
- Removes Service name and transaction type from the set of expressions in the alerting setup

* - remove bell icon from alerts menu

* Adds target service back into the anomaly alert setup as a ready-only expression

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-27 21:19:36 -07:00
Nathan L Smith 8e57db696a
[APM] Use licensing from context (#70118)
* [APM] Use licensing from context

We added the usage of `featureUsage.notifyUsage` from the licensing plugin in #69455.

This required us to use `getStartServices to add `licensing` to `context.plugins`.

In #69838 `featureUsage` was added to `context.licensing`, so we don't need to add it to `context.plugins`.
2020-06-29 08:23:52 -05:00
Nathan L Smith 2642d658c4
[APM] License feature tracking for service maps (#69455)
Use the license feature API to register the service maps feature and track its usage when the API endpoint is accessed.

Fixes #64850.
2020-06-17 19:18:15 -05:00
Oliver Gupte cac9018f81
[APM] Service maps - Fix missing ML status for services with jobs but no anomalies (#68486)
* Closes #68485 by:
  - use the ML plugin to query for all APM jobs
  - inspect the ml job groups to find all jobs related to a particular service
  - use the mlAnomalySearch client to get ml job buckets with the max anomaly score
  - query for the model_plot buckets to obtain actual/median values for the ML description
  - return the relevant ML job with the max anomaly score for a service
  - indicate to the user that no anomalies were found for a service with an ml job

* - Use the anomalyDetectorsProvider jobs API rather than the search endpoint directly
- Defines a specific return type for the ml jobs api
- Update the empty anomaly data message

* Code and types cleanup

* Return to using record result type on anomaly queries. These are the
same values used in the anomaly explorer and it includes actual &
typical values which greatly improve performance of the previous query.

* - If anomaly data is missing show a gray border around node

* - moved AnomalyDetection out of service map Contents into own component

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-09 20:58:46 -07:00
Yuliia Naumenko ce45dad8b6
Changed alerting API endpoints urls, bodies and params to follow Kibana STYLEGUIDE (#66838)
* Changed alerting API endpoints urls, bodies and params to follow Kibana STYLEGUIDE

* Changed alerting REST API to keep the pattern 'alerts/alert/{id}'

* fixed tests

* fixed tests

* Fixed jest tests

* Renamed plugin from alerting to alerts

* fixed tests

* fixed tests

* Fixed alert type check error

* Fixed find api

* fixed type checks

* fixed tests security issues

* Fixed view in app

* -

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-01 18:45:36 -07:00
restrry bf04235dae apply prettier styles 2020-05-22 09:08:58 +02:00
Diana Derevyankina 27fe2650b6
Move apm tutorial from apm plugin into apm_oss plugin (#66432)
* Move apm tutorial from apm plugin into apm_oss plugin

Closes #65629

* Fix types issues and some paths

* Add unregisterTutorial to tutorials_registry.mock

* Add apm path to .i18nrc.json to fix internationalization error

* Rename apm path in .i18nrc.json into apmOss and revert some imports paths
2020-05-20 14:40:37 +03:00
Oliver Gupte 531eb7cadc
[APM] Change plugin id for apm_oss to apmOss (#66164)
* Change apm oss plugin name from apm_oss to apmOss

* change plugin name

* update apm_oss -> apmOss inn requiredPlugins

Co-authored-by: mohinderps <mohin19derp@gmail.com>
2020-05-12 16:28:27 -07:00
Dario Gieselaar 399eed77bb
[APM] Annotations API (#64796) 2020-05-05 19:49:39 +02:00
Cauê Marcondes 91b27570c1
[APM] Ensure that /api/apm/security/indices_privileges doesn't fail when security is disabled (#64627)
* logging when security api is disable

* logging when security api is disable

* checking statuc code 400

* adding security plugin

* checking if security plugin is enabled before calling it

* fixing unit test

* show apm ui when index is empty

* addressing PR comments

* refactoring

* refactoring

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-04 21:22:06 +02:00
Oliver Gupte 16ba937bae
[APM] Client new platform migration (#64046)
* migrate files from legacy path to new plugin path

* update file paths to reflect migrated files

* move minimal legacy client files back to legacy path in order to run kibana

* Completes the full cutover to the new kibana platform removing all shims and legacy adapters.

* Adds APM to ignored list for casing check.

* - moves public/utils/pickKeys.ts to common/utils/pick_keys.ts
- exposes getTraceUrl as a plugin static export of apm/public and updates import in infra
- fixes FeaturesPluginSetup import in apm/public app
- renames get_apm_index_pattern_titles -> get_apm_index_pattern_title
- getApmIndexPatternTitle is now a synchronous getter function
- removes unused comments and xpack.apm.apmForESDescription i18n translations

* Moves automatic index pattern saved object creation from
plugin start to when the Home screen first renders

* removed unnecessary legacy css imports

* fixed ci issues by:
- moving readOnly badge, and help extension setup to occure only
  when apm app is mounted
- registering saved object types
- also moved createStaticIndexPattern from a react useEffect on the
  APM home screen to when the app is mounted
2020-04-30 13:08:50 -07:00
Rudolf Meijering 00a1144ae2
Refactor Plugins to access elasticsearch from CoreStart (#59915)
* x-pack/watcher: use Elasticsearch from CoreStart

* x-pack/upgrade_assistant: use Elasticsearch from CoreStart

* x-pack/actions: use Elasticsearch from CoreStart

* x-pack/alerting: use Elasticsearch from CoreStart

* x-pack/lens: use Elasticsearch from CoreStart

* expressions: use Elasticsearch from CoreStart

* x-pack/remote_clusters: remove unused Elasticsearch dependency on CoreSetup

* x-pack/oss_telemetry: use Elasticsearch from CoreStart

* Cleanup after #59886

* x-pack/watcher: create custom client only once

* Revert "x-pack/watcher: create custom client only once"

This reverts commit 78fc4d2e93.

* Revert "x-pack/watcher: use Elasticsearch from CoreStart"

This reverts commit b621af9388.

* x-pack/task_manager: use Elasticsearch from CoreStart

* x-pack/event_log: use Elasticsearch from CoreStart

* x-pack/alerting: use Elasticsearch from CoreStart

* x-pack/apm: use Elasticsearch from CoreStart

* x-pack/actions: use Elasticsearch from CoreStart

* PR Feedback

* APM review nits

* Remove unused variable

* Remove unused variable

* x-pack/apm: better typesafety

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-15 17:07:57 +02:00
Dario Gieselaar 6bd8755df4
[APM] Re-revert "Collect telemetry about data/API performance" (#61030)
* Revert "Revert "[APM] Collect telemetry about data/API performance (#51612)""

This reverts commit 6de7f2a62b.

* Update transaction mock data to reflect the type
2020-03-24 13:38:15 +01:00
Dario Gieselaar 85c0be357a
[APM] Threshold alerts (#59566)
* Add alerting/actions permissions for APM

* Export TIME_UNITS, getTimeUnitLabel from triggers actions UI plugin

* Add APM alert types and UI

* Review feedback

* Use Expression components for triggers

* Update alert name for transaction duration

* Change defaults for error rate trigger
2020-03-24 11:15:10 +01:00
spalger 6de7f2a62b Revert "[APM] Collect telemetry about data/API performance (#51612)"
This reverts commit 13baa51561.
2020-03-23 22:26:15 -07:00
Dario Gieselaar 13baa51561
[APM] Collect telemetry about data/API performance (#51612)
* [APM] Collect telemetry about data/API performance

Closes #50757.

* Ignore apm scripts package.json

* Config flag for enabling/disabling telemetry collection
2020-03-23 23:08:44 +01:00
Cauê Marcondes 2817d6e3a8
[APM] Create settings page to manage Custom Links (#57788)
* creating custom action index

* reverting service form to service section

* creating useForm hooks and fields section

* adding react-hook-form

* refactoring

* validating filters

* fixing imports

* refactoring to NP and creating save custom action

* creating basic apis for custom actions

* refactoring

* changing custom action filters type

* adding delete option

* removing useForm

* fixing flyout view

* filters are invalid when selecting the default value

* ui fixes

* ui fixes

* fixing typescript

* fixing typescript

* fixing labels and adding space btw components

* refactoring filters structure

* removing reach-hook-form

* removing reach-hook-form

* adding unit tests

* adding unit tests

* create custom action index

* adding filter option

* refactoring create index, creating filter links

* creating list api

* rename custom action to custom link

* fixing unit tests

* adding unit tests

* refactoring callApmApi

* removing useCallApmApi hook

* Rename Flyoutfooter.tsx to FlyoutFooter.tsx

* removing unused import

* fixing typescript errors

* fixing duplicate messages

* removing filters

* fixing save functionality

* fixing pr comments

* fixing pr comments
2020-03-06 11:06:16 +01:00
Søren Louv-Jansen d474ccf244
[APM] Fix timeout in APM setup (#58727)
* [APM] Fix timeout in APM setup

* Update plugin.ts
2020-02-27 22:55:02 +01:00
Nathan L Smith 2ea4bdfe0d
Server-side license check for APM service map (#58547)
* Factor our the license checking logic and messaging to common
* Add licensing plugin as a dependency of the APM plugin
* Throw a forbidden error on the server if trying to access the service map routes
2020-02-26 07:14:08 -06:00
Oliver Gupte 96a0aa0266
[APM] NP Migration - Moves plugin server files out of legacy (#57532)
* Closes @56832 Migrates uses of the saved objects client to the internal
and context scoped clients exposed in the new platform core setup

* moves apm server, common, and typings dirs to the new plugin directory

* fixes path imports and type errors

* fixes some lint errors

* fixes CI failure. Use internal saved objects client like before.

* uses the context-scoped saved objects client for saving runtime APM indices,
and uses the internal saved objects client when creating apm index
pattern, so that any user who navigates to apm can trigger it

* fixes the type check error by updating import paths

* renamed files and directories to snake_case to pass scripts/check_file_casing

* rebase fixes and commit filename case changes

* moves get_indices_privileges.ts out of legacy path
2020-02-19 13:43:03 -08:00
Joe Reuter 7c40a24fcc
Tutorial migration (#54910) 2020-01-22 15:31:11 +01:00
Mikhail Shustov 56041f03ad
Don't expose Elasticsearch client as Observable (#53824)
* expose ES clients without observables

* expose observable-less api to plugins

* update core api and mocks

* update plugins

* NP SO & legacy use updated API

* update SO tests

* update TSDocs

* update types

* update docs

* document createCluster analog in np

* typo
2020-01-08 12:01:47 +03:00
Jason Rhodes ab5913d109
Infra server NP shim + config/routing API adoption (#45299)
* Basic cleanup before refactoring for shim work

* shim WIP

* Removes the configuration adapter

* WIP more stuff

* WIP refactoring of shimming work

* WIP continues

* Logging UI now runs on top of new platform shim

* WIP continues

* Removes unused imports and variables

* Basic infra NP server shim in place

* Reimplemented graphql http error handling for infra NP server shim

* Adds new platform infra plugin to handle NP config for legacy server shim

* Basic cleanup before refactoring for shim work

* shim WIP

* Removes the configuration adapter

* WIP more stuff

* WIP refactoring of shimming work

* WIP continues

* Logging UI now runs on top of new platform shim

* WIP continues

* Removes unused imports and variables

* Basic infra NP server shim in place

* Reimplemented graphql http error handling for infra NP server shim

* Adds new platform infra plugin to handle NP config for legacy server shim

* Adds comment about duplicating full config for NP config

* Use New Platform features plugin to registerFeature()

* Re-arranging and relying on request context as uch as possible

* Refactors KibanaRequest for RequestHandlerContext

* fixes types for callWithRequest

* Moves callWithRequest method override types directly into class to get them working, need to fix this when we understand it better

* Fixes callWithRequest framework types

* Removes a few NP_TODO comments

* Fix broken imports

* Ensure GraphQL resolvers are actually passed requestContext and not the raw request, and switch to the savedObjects client via requestContext

* Remove the legacy traces of the savedObjects plugin

* Fixes TSVB access with NP raw requests and requestContext

* Remove unused getUiSettingsService (moved to requestContext)

* Migrate to new Spaces plugin

* Fix calculateMetricInterval after merged changes

* Reinstate and migrate the infrastructure metadata route

* Fix various type check errors

* Amend InfraSources lib unit tests

Mock the savedObjects client differently

* Amend MetricsExplorer API response

Renaming of variable inadvertently broke the response

* Remove GraphQLI references from feature controls tests

* Remove other GraphiQL references

* Fix security / access issue

* Add a framework level registerRoute method which always adds access tags by default

* *Temp* disable test

* Migrate the log rate validation endpoint to the new platform

Fully migrates the [Logs UI] log rate setup index validation #50008 PR to New Platform routing etc

* Amend types

* Example of how to expose APM get indices method in NP

* Fix calls to TSVB bug caused by object mutation
This is a temp fix as the TSVB NP migration will supercede this

* Converts getApmIndices function to accept saved object client, implements usage in infra

* Fix APM setup_request tests

* Fixes some unused references for linting

* Migrate all work from #50730 to NP

* Remove duplicate declaration files for rison_node and add a single source of truth at x-pack/typings/rison_node.d.ts for x-pack uses

* Moved type file back into infra plugin to bypass strange break

* Updates apm indices method signature per feedback from @elastic/apm-ui
2019-12-06 13:35:34 -05:00
Dario Gieselaar 861f064083
[APM] Address fallout from NP server migration (#51725)
* [APM] Address fallout from NP server migration

* Fix type issues in integration tests

* Await creation of agent configuration index
2019-12-03 21:26:44 +01:00
Dario Gieselaar 06bee60512
[APM] Migrate server routes to NP (#49455)
* [APM] Migrate server routes to NP

Closes #49238.

Pass legacy API to NP plugin in order to use internal SO client

Fix issues with agent configuration APIs

Update tsconfig template for TS optimization

Fix typo

* Review feedback

* Fix type issues after browser duration changes

* Revert changes in getServices due to readability concerns

* Review feedback
2019-11-21 15:46:34 +01:00