Commit graph

28 commits

Author SHA1 Message Date
Søren Louv-Jansen
4ddcd1d2a6
[APM] Fix anomalies not showing up on transaction charts (#76930)
* [APM] Fix anomalies not showing up on transaction charts

* Added API tests to check transaction groups charts for anomaly data

* Improve test names and assertions from PR feedback

* Updated the transaction groups chart API to make `environment` a
required param while making `uiFilters` optional

* updates the basic API tests for transaction_groups/charts with the
required `environment` param

* makes uiFIltersES default to [] on core setup and removes SetupUIFilters type

* fixes vertical shade

* - replaces uiFiltersES with esFilter & uiFilters and cleans up related code around these
- deduplicates the required environment in the transaction_groups/charts API

* updates basic apm_api_integration tests

* pr feedback

* updates api test snapshots with correct anomaly data

* removed environment query param from useTransactionCharts and ensures
it's included in uiFilters returned from useUrlParams

Co-authored-by: Oliver Gupte <olivergupte@gmail.com>
2020-10-02 00:45:50 -07:00
Cauê Marcondes
9c90c14b25
[APM] Show accurate metrics for containerized applications (#76768)
* adding cgroup fields

* calculate the memory based on the cgroup fields otherwise use the system fields

* updating script

* adding api tests

* using cgroup fields on service map

* addressing PR comment

* fixing unit test

* fixing test

* changing api tests to use snapshot

* removing inactive_files from calculation

* fixing test

* refactoring painless script

* addressing PR comment

* addressing pr comments

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-17 18:13:06 +02:00
Dario Gieselaar
520d348bf8
[APM] Service inventory redesign (#76744)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-14 16:10:04 +02:00
Cauê Marcondes
712c4bdde7
[APM] Prevent imports of public in server code (#75979)
* renaming test file

* removing eslint rule

* restructuring observability types

* refactoring fetchOptions type
2020-08-28 12:43:49 +02:00
Dario Gieselaar
789b67fb5f
[APM] Improvements for breakdown data gaps (#75534)
Closes #69704, #73387, #43780.
2020-08-26 10:59:44 +02:00
Dario Gieselaar
c66ea65ec1
[APM] Use apmEventClient for querying APM event indices (#73449)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-31 15:22:04 +02:00
Dario Gieselaar
19532fc439
[APM] Optimize traces overview (#70200)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-28 15:53:23 +02:00
Mikhail Shustov
f593455a62
Bump TypeScript to v3.9 (#67666)
* add babel support for export type

* bump ts version to 3.9.3

* rebuild kbn-pm

* bump typescript-eslint

* fix error in security plugin UI

* check export as works

* fix app migration type

* use correct test subj attribute

* fix errors from the old PR

* embeddable is already passed in props

* explicitly define type of fetch

* add some types for viz

* fix fetch type p.2

* add null to allow spreading without type errors due to override

* add type guard to fix type error

* cast to any, since cannot assign unknown

* add timestamp to known types

* fix type error in fetch

* fix type error. id is always defined in attibutes

* declare a type

* move ts-ignore to the lines with errors

* declare tuple type explicitly

* mute type error. cannot assign unknown

* fix errors. id is always defined

* fix error type

* fix override errors. id is always defined

* fix error. extends any doesn't work anymore

* fix type error. type is always defined

* env doesn't always contain values

* fix type error

* cast to string

* add: logs is already declared in getNodeLogsUrl

* state is already  passed in props

* fix some errors in timelion

* number of fragments is always defined

* 'absolute' is not just string, but value

* TEMP: option is always defined

* always true if cast to promise manually

* both props are always defined

* explicitly define returned SO type

* workaround type

* bump tslib to be compatible with ts v3.9

* test private property

* rebuild kbn-pm

* Fix ts errors for beats management

* Fix type inference broken by the TS 3.9 upgrade

* Fix ingest manager saved object attributes typings

* Fix TS errors in cross_cluster_replication and index_management.

* Fix TS error in Watcher.

* roll back colorRange wrong type

* fix security plugin types

* TypeScript 3.9 fixes for APM

* Fix ColorRange types.

* fix actions & alerts errors. ByGidi

* fix lists error

* More APM fixes

* Remove paramaterization from `removeEmpty in agent config SettingsPage component (it's only used there and doesn't need to be parameterized.)
* Add option chain for case in registerTransactionDurationAlertType
* Cast `overallValue` in transform_metrics_chart
* Use more specific type for custom link filters
* Add more option chaining for local UI filters buckets response
* Remove unused parameters from routes
* Fix getProjection type parameter
* Use destructuring in serviceNodesLocalFiltersRoute to hide `never` error
* Revert `UnionToIntersection` change in `AggregationResponseMap`

Fixes #67804.

* fix platform type error

* Fix visualizations types.

* Fix data plugin types.

* bump TS version to 3.9.5

* Fix telemetry TS errors

* Fix dashboard code

* Adding Canvas Fixes for TS 3.9

* Fix case and security_solution types

* roll back to the old export syntax. new one might cause problems in api-extractor

* update docs

* Fix timelion code

* Fix meta

* Fix types

* fix type errors om ingest_manager

* bump babel deps

* enable private props & methods syntax

* update kbn-pm dist

* whitelist 0BSD license

* use @babel/plugin-proposal-private-methods in default set as well

* disable new babel plugins

* Revert "disable new babel plugins"

This reverts commit 04d959431d.

* cleanup security_solution types

* Fixes type error for newer TypeScript

* update docs

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
Co-authored-by: Felix Stürmer <stuermer@weltenwort.de>
Co-authored-by: CJ Cenizal <cj@cenizal.com>
Co-authored-by: Larry Gregory <larry.gregory@elastic.co>
Co-authored-by: Nathan L Smith <smith@nlsmith.com>
Co-authored-by: Walter Rafelsberger <walter@elastic.co>
Co-authored-by: Luke Elmers <luke.elmers@elastic.co>
Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
Co-authored-by: Tim Roes <tim.roes@elastic.co>
Co-authored-by: Clint Andrew Hall <clint.hall@elastic.co>
Co-authored-by: Patryk Kopycinski <contact@patrykkopycinski.com>
Co-authored-by: FrankHassanabad <frank.hassanabad@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-11 10:04:09 +02:00
restrry
bf04235dae apply prettier styles 2020-05-22 09:08:58 +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
Nathan L Smith
b5f460fb6e
Remove all client-side map munging (#60701)
Remove the getCytoscapeElements function.

On the server:

* Replace `source` with `sourceData`, `destination` with `targetData`, `source.id` with `source`, and `destination.id` with `target`.
* Return a single array as an `elements` property instead of `nodes` and `connections`
* Map all of the items data to be inside of a `data` object
* Replace SERVICE_AGENT_NAME with AGENT_NAME
* Add some missing constants

On the client:

* Remove getCytoscapeElements
* Move all presentation-specific data transformation to use the original attributes in the place where they're needed
* Remove `href` since it wasn't being used
* Move BetaBadge to its own file
* Move cytoscapeDivStyle to cytoscapeOptions
* Fix storybook to work with new data formats
2020-03-20 13:14:39 -05: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
Court Ewing
7ac8e4d9cc Move x-pack plugins/server/common to x-pack/legacy 2019-06-20 13:34:48 -04:00
Dario Gieselaar
4526e2a2b5
[APM]: Inferred types for aggregations (#37360)
* [APM]: Inferred types for aggregations

Previously, aggregations returned by the ESClient were 'any' by default, and the return type had to be explicitly defined by the consumer to get any type safety. This leads to both type duplication and errors because of wrong assumptions.

This change infers the aggregation return type from the parameters passed to ESClient.search.

* Fix idx error

* Safeguard against querying against non-existing indices in functional tests

* Improve metric typings

* Automatically infer params from function arguments

* Remove unnecessary type hints
2019-06-17 21:56:23 +02:00
Oliver Gupte
182c329c7a
[APM] Java metrics follow-up fixes (#37337)
* [APM] Closes #69301 by adding CPU/Memory graphs back to java-specific
metrics, modifying java metrics chart labels, and adding thread count
max line to chart.

* [APM] update i18n unused translation

* [APM] add filter to exclude non-existent memory chart data
2019-05-30 17:04:24 -07:00
Søren Louv-Jansen
e03b080a1f
[APM] Refactor ESClient to allow other operations than search (#37334) 2019-05-30 16:24:52 +02:00
Oliver Gupte
6c3c5751ec
[APM] Add global service environment filter (#35778)
* [APM] Adds global service environment filter to all applicable pages and APIs via uiFilters pattern.

* [APM] addressed some PR feedback:
- removed useUiFilters custom hook, derives memoized uiFilters from urlParams with useMemo and use the obj ref in dependency array
- modified the layout of environments filter to use EuiFlex components
- added 'Select environment' label to seperator, changed capitalization to 'Not defined' option
- set services table set column widths to 40%,20% for first 2 cols, and added space to comma separated list of environments
- added tests for generating environment es filters

* [APM] rename getUiFilters -> useUiFilters since it's based on useMemo
2019-05-21 15:24:07 -04:00
Jason Rhodes
9ff443a5f1
[APM] Add "metrics-by-agent" api endpoint and refactors client to use it (#35651)
* Creates new java metrics endpoint

* Creates per-chart fetcher and index for per-agent metrics, with valid types

* Restructures client-side metrics charts to use new metrics endpoint, removes old unused code

* Adds i18n in the server for metrics charts

* Adds java metrics thread count chart

* Removes hard-coded agent name for metrics fetch

* General clean-up

* Writes new snapshots for es fieldname constants

* Small clean up for metrics based on PR review

* Makes agentName required for metrics charts

* Adds metrics transform test

* Uses casting to solve type problem with Hapi req.query

* Fixes functional test for required query param

* Simplify metric chart types

* Renames MetricsKeys to MetricSeriesKeys

* Rename transformDataToChart and a few other cleanups

* Fixes test and changes 0 B to just 0 in bytes unit y axes

* Improves byte format handling and adds test

* Removes unnecessary import

* More refactoring of the byte formatters and some extra tests to cover null and NaN cases

* Uses unmemoized version of byte formatter factory to prevent unnecessary function caching
2019-05-07 21:44:37 -04:00
Søren Louv-Jansen
0eff2e15f5
[APM] Set minimum bucket size to connect dots in metric chart (#34473) 2019-04-09 09:33:58 +02:00
Søren Louv-Jansen
9036aa49f4
Use ReturnType instead of explicit interfaces (#34065) 2019-04-03 00:44:58 +02:00
Tyler Smalley
1b95bed2da
[linting] Enforce relative paths for X-Pack modules (#34349)
* Add module-migration support for toRelative

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* tslint fixes

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* Move configuration to root

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* Simplify root definition

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2019-04-02 10:08:13 -07:00
Søren Louv-Jansen
de2c976796
[APM] Cleanup ES queries (#30363) 2019-02-10 12:41:38 +01:00
Søren Louv-Jansen
f782b9fe35
[APM] Add support for chained exceptions (#29345)
* [APM] Add support for chained exceptions

* Rename constants to elasticsearch_fieldnames
2019-02-04 18:08:23 +01:00
Søren Louv-Jansen
9d33143ff9
[APM] Remove v1 and make required ECS changes (#28068)
* [APM] ECS changes

* Remove ambient types for idx

* Update `observer.listening`

* Added type safety to property config

* More ECS updates

* Juan fixes for ECS
2019-01-24 12:13:14 +01:00
Søren Louv-Jansen
aac425fe1b
[APM] Remove shared metricsFetcher and minor renames (#29071) 2019-01-23 11:57:20 +01:00
Jason Rhodes
f469861c78 Requires fields necessary for percent calculation (#29021)
* Requires fields necessary for percent calculation

* Fix snapshot

* Add guard to asPercent formatter
2019-01-21 18:27:24 +01:00
Jason Rhodes
15a975b274
Finalize memory charts (#28625)
* Adds available memory stats (in percent) to metrics server response

* Updates UI memory charts for new data

* Updates memory chart metrics to be usage (average and max), removes other unused metrics

* Review feedback addressed, small refactors

* Updates memory chart tests
2019-01-16 09:50:16 -05:00
Jason Rhodes
e8f7d9e8b7
APM Metrics, UI Baseline (#26608)
* Service detail page refactor with TS conversions

* Adds error group list back to the service details page tabs

* Fixes after rebasing upstream master

* Adds integrations menu and flyouts, with no-transaction ML job creation and lookup

* WIP adds memory usage chart with fake data

* Adds error group distribution chart to metrics tab

* Metrics "memory" chart data flow from server to chart

* Server side query and transform set up for cpu charts

* CPU charts created

* Review feedback and watcher flyout

* Server tests added, broken tests fixed

* Review feedback

* Fixes up type problems

* Converts metric key paths to constants

* Fixes error group type issue after rebasing from master

* Makes transaction type filterable on transactions list tab

* Review feedback

* Chart formatting tweaks and fixes

* Fixes y-axis ticks for GB chart

* Restores machine learning annotations with some test fixes

* Continued styling and other review based changes

* More review fixes and cleanup

* Updated chartGroupProps -> hoverXHandlers

* Removes "type" column from transaction list table

* Re-centers around using urlParams

* Fixes panel item references in service integrations menu

* Serves default transaction type from /transactions route

* Reverts tooltip series ordering change

* Adds a clarification note about route config

* Makes it possible to request transaction chart data without specifying type

* Fixes empty series problem for memory chart

* Fixes tests

* Review feedback

* Fixes after rebase

* Replaces boolean casted array#find with array#some
2018-12-19 13:27:21 -05:00