-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[APM] Client new platform migration #64046
Conversation
Pinging @elastic/uptime (Team:uptime) |
51c86cd
to
7d86a57
Compare
…ims and legacy adapters.
7d86a57
to
9fa801a
Compare
retest |
"data", | ||
"home", | ||
"licensing", | ||
"triggers_actions_ui" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should probably be in optional, with the other plugins necessary for alerting (alerting
and actions
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actionTypeRegistry
and alertTypeRegistry
are required for <AlertsContextProvider>
, so it will have to be required unless we do some kind of conditional rendering of context, but i don't think that will be good for downstream consumers of that context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No specific concerns from me, just a few qs and suggestions - great work @ogupte!
}; | ||
|
||
/** | ||
* This module will be loaded asynchronously to reduce the bundle size of your plugin's main bundle. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we reword this comment?
@@ -20,7 +20,8 @@ import { | |||
ESSearchResponse | |||
} from '../../../typings/elasticsearch'; | |||
import { OBSERVER_VERSION_MAJOR } from '../../../common/elasticsearch_fieldnames'; | |||
import { pickKeys } from '../../../../../legacy/plugins/apm/public/utils/pickKeys'; | |||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths | |||
import { pickKeys } from '../../../public/utils/pickKeys'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we move this to common?
@@ -9,7 +9,7 @@ import { getErrorGroups } from './get_error_groups'; | |||
import { | |||
SearchParamsMock, | |||
inspectSearchParams | |||
} from '../../../../../legacy/plugins/apm/public/utils/testHelpers'; | |||
} from '../../../public/utils/testHelpers'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not related to this PR, but feels like this file should not be in public
anyway. there's a bunch of node imports there that will break when it's used in storybook for instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure it does, in fact, break in storybook.
@@ -9,7 +9,8 @@ import { EuiButtonEmpty, EuiContextMenuItem, EuiContextMenuPanel, EuiPopover } f | |||
import { FormattedMessage } from '@kbn/i18n/react'; | |||
import React, { useMemo } from 'react'; | |||
import { useVisibilityState } from '../../../utils/use_visibility_state'; | |||
import { getTraceUrl } from '../../../../../../legacy/plugins/apm/public/components/shared/Links/apm/ExternalLinks'; | |||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths | |||
import { getTraceUrl } from '../../../../../apm/public/components/shared/Links/apm/ExternalLinks'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be exported from /apm/public
to prevent the warning no?
// .svg | ||
import '../../../legacy/plugins/canvas/types/webpack'; | ||
// import '../../../legacy/plugins/canvas/types/webpack'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we remove this then?
*/ | ||
import { APMRequestHandlerContext } from '../../routes/typings'; | ||
|
||
export async function getApmIndexPatternTitle( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this async?
x-pack/plugins/apm/public/plugin.ts
Outdated
PluginStartContract as AlertingPluginPublicStart | ||
} from '../../alerting/public'; | ||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths | ||
import { PluginSetupContract as FeaturesPluginSetup } from '../../features/server'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we importing the right file here? we don't need the one from features/public
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're right, i was importing the wrong type. Also we don't even use the features plugin in the client app, so we could just omit it
} from '../../../../src/core/public'; | ||
import { ApmPlugin, ApmPluginSetup, ApmPluginStart } from './plugin'; | ||
|
||
export interface ConfigSchema { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not entirely clear to me when reading this what this type is based on. It looks like they are the properties we want to expose from the server config to the browser, but I'm not seeing the connection to runtime code. Can we tie them together in some way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not exercise the APM migration itself, but SIEM changes look good. Thank you for keeping those references up to date 👍
Pinging @elastic/apm-ui (Team:apm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! 👍 from me once tests pass and conflicts fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Operations: path updates in config LGTM
- 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
retest |
plugin start to when the Home screen first renders
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For SIEM changes this is 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Congrats 👏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need these files anymore. You might also want to look into the css files you moved over. A few of them reference selectors that no longer exist like kuiLocalNav
. I've only done a code scan of these changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the changes
// TODO fix file names in APM to remove these | ||
'x-pack/plugins/apm/public/**/*', | ||
'x-pack/plugins/apm/scripts/**/*', | ||
'x-pack/plugins/apm/e2e/**/*', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any automated way (eslint --fix
) to update the filenames?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not for scripts
or e2e
. for public
, i started working on a code mod to update all the imports with the new paths, but then it was suggested by the platform team to ignore them for now and address it in another PR
return await callApmApi({ | ||
pathname: '/api/apm/index_pattern/title' | ||
}); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want an endpoint for each config value the UI needs. Could we make this more generic so it returns all APM config values (supposing there is nothing confidential in them).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's some opportunity for that since we also get the various apm_oss indices for index settings default values. But Let's address it in another tech debt issue. I'd like to keep this PR as minimal as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, I should have made it clear that this was for follow-up. We don't have to do it until the need arises (eg. we need to pass another config value to the UI)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Does not seem to have touched any Endpoint files.
- 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
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* 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
* [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 * [APM] fixes type declaration for ApmRoute
* upstream/master: (315 commits) [APM] Fix failing `ApmIndices` test (elastic#64965) [APM] Fix paths for ts optimization script (elastic#65012) Use HDR for percentiles (elastic#64758) [EPM] fix updates available filter (elastic#64957) [Uptime] Certificates page (elastic#64059) load lens app lazily (elastic#64769) [legacy/server/config] remove unnecessary deps for simple helper (elastic#64954) Fixed alert Edit flyout shows the error message when one of this actions has a preconfigured action type (elastic#64742) [data.search.aggs] Remove legacy aggs APIs. (elastic#64719) Fixed `AddAlert` flyout does not immediately update state to reflect new props (elastic#64927) [Discover] Show doc viewer action buttons on focus (elastic#64912) [EPM] restrict package install endpoint from installing/updating to old packages (elastic#64932) [Metrics UI] Add inventory metric threshold alerts (elastic#64292) [Canvas] Adds edit menu (elastic#64738) [Canvas] Adds refresh and autoplay options to view menu (elastic#64375) [Lens] Trigger a filter action on click in datatable visualization (elastic#63840) [SIEM][CASE] Refactor Connectors - Jira Connector (elastic#63450) [APM] Client new platform migration (elastic#64046) [Monitoring] NP Migration complete client cutover (elastic#62908) Ingest Node Pipelines UI (elastic#62321) ...
…or-part-mvp-2 * 'master' of github.com:elastic/kibana: (51 commits) [APM] Fix failing `ApmIndices` test (elastic#64965) [APM] Fix paths for ts optimization script (elastic#65012) Use HDR for percentiles (elastic#64758) [EPM] fix updates available filter (elastic#64957) [Uptime] Certificates page (elastic#64059) load lens app lazily (elastic#64769) [legacy/server/config] remove unnecessary deps for simple helper (elastic#64954) Fixed alert Edit flyout shows the error message when one of this actions has a preconfigured action type (elastic#64742) [data.search.aggs] Remove legacy aggs APIs. (elastic#64719) Fixed `AddAlert` flyout does not immediately update state to reflect new props (elastic#64927) [Discover] Show doc viewer action buttons on focus (elastic#64912) [EPM] restrict package install endpoint from installing/updating to old packages (elastic#64932) [Metrics UI] Add inventory metric threshold alerts (elastic#64292) [Canvas] Adds edit menu (elastic#64738) [Canvas] Adds refresh and autoplay options to view menu (elastic#64375) [Lens] Trigger a filter action on click in datatable visualization (elastic#63840) [SIEM][CASE] Refactor Connectors - Jira Connector (elastic#63450) [APM] Client new platform migration (elastic#64046) [Monitoring] NP Migration complete client cutover (elastic#62908) Ingest Node Pipelines UI (elastic#62321) ... # Conflicts: # x-pack/plugins/ingest_pipelines/common/types.ts # x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form.tsx # x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_fields.tsx # x-pack/plugins/ingest_pipelines/public/shared_imports.ts
* master: (44 commits) onEvent prop for expression component (elastic#64995) [APM] Fix failing `ApmIndices` test (elastic#64965) [APM] Fix paths for ts optimization script (elastic#65012) Use HDR for percentiles (elastic#64758) [EPM] fix updates available filter (elastic#64957) [Uptime] Certificates page (elastic#64059) load lens app lazily (elastic#64769) [legacy/server/config] remove unnecessary deps for simple helper (elastic#64954) Fixed alert Edit flyout shows the error message when one of this actions has a preconfigured action type (elastic#64742) [data.search.aggs] Remove legacy aggs APIs. (elastic#64719) Fixed `AddAlert` flyout does not immediately update state to reflect new props (elastic#64927) [Discover] Show doc viewer action buttons on focus (elastic#64912) [EPM] restrict package install endpoint from installing/updating to old packages (elastic#64932) [Metrics UI] Add inventory metric threshold alerts (elastic#64292) [Canvas] Adds edit menu (elastic#64738) [Canvas] Adds refresh and autoplay options to view menu (elastic#64375) [Lens] Trigger a filter action on click in datatable visualization (elastic#63840) [SIEM][CASE] Refactor Connectors - Jira Connector (elastic#63450) [APM] Client new platform migration (elastic#64046) [Monitoring] NP Migration complete client cutover (elastic#62908) ...
Closes #32894.
x-pack/plugins/apm
./api/apm/index-pattern/title
which was necessary since this value was no longer available as an injected meta data in legacy. I was unable to expose it from the plugin config, since it's really a config value from a dependencyapm_oss
, so it made sense to just pass it to the client via API response.features
andtriggers_actions_ui
.apm/scripts
andapm/e2e
.apm/server/saved_objects
This PR does NOT:
For the reviewer's convenience, all substantive changes were limited to this commit: 9e72500