Skip to content
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

[UX Dashboard] Migrate service list query out of APM #132548

Merged
merged 8 commits into from
May 24, 2022

Conversation

justinkambic
Copy link
Contributor

Summary

Related to #454.

Migrates the service list query and route out of APM to the UX plugin.

Changes:

  • deleted the service list route
  • deleted the service list query
  • migrated the unit test to UX (snapshot remains unchanged, minus the removal of the apm key)
  • utilized the Data plugin to fetch the data
  • deleted some APM-specific code from the query generation process, output of the query generator seemed to remain unchanged
  • leveraging data view hook to get the pattern to use for the useEsSearch call
  • copied some server-specific helper functions from APM server to UX for use in query generation

Testing this PR

You should test the dashboard against a rich set of UX data, like that available on the o11y edge cluster.

Ensure that the expected services show up in the dropdown. Select each value and see that the view updates as expected.

Apply any kind of filtering the app is capable of to ensure that the list behaves according to your expectations.

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@justinkambic justinkambic added chore technical debt Improvement of the software architecture and operational architecture labels May 19, 2022
@justinkambic justinkambic requested review from a team as code owners May 19, 2022 18:56
@justinkambic justinkambic self-assigned this May 19, 2022
@botelastic botelastic bot added the Team:APM All issues that need APM UI Team support label May 19, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:apm)

: U
: U;

export function mergeProjection<T extends any, U extends SourceProjection>(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ended up moving this over because there's logic about projection in the query generator for this component. LMK if this can be somehow skipped and we can delete this file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APM doesn't use projections anymore. If you also want to get rid of projections for the UX related code you are welcome to do it as part of this PR or a follow-up. If you do that we can delete the merge_projections.ts in both APM and UX.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sqren I think there are one or two other components in APM relying on that code. When I take them out I'll make sure nothing else references the projections and delete then.

@shahzad31 I'd appreciate your thoughts on whether we want this projection code to move into UX or if we can remove it here and now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think if it makes sense we can move these. If you think the util apm is using in place of projections, it's also worth exploring those.

import { UxUIFilters } from '../../../typings/ui_filters';
import { environmentQuery } from '../../components/app/rum_dashboard/local_uifilters/queries';

export function getEsFilter(uiFilters: UxUIFilters, exclude?: boolean) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise copied this from the server because the component's query generator depends on it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copying is probably fine. Fewer dependencies <3

@justinkambic justinkambic added release_note:skip Skip the PR/issue when compiling release notes v8.3.0 v8.4.0 labels May 19, 2022
return { rumServices };
},
});

const rumVisitorsBreakdownRoute = createApmServerRoute({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the remaining routes will have to be moved out in a future PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sqren yes we are going to be doing this one component at a time, or grouped if there are some that it makes sense to move at once. Some are going to be ported to using data plugin queries, others will become embeddables, with the goal of avoiding adding a server component to the UX plugin. We're planning to have them all removed soon!

metric = 'metric',
span = 'span',
profile = 'profile',
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine for now. But we should find a way to share these to avoid duplication. Eg. this could reside in plugins/observability/common/apm/processor_event.ts (or something like it).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++ I am happy to move them there now and reference from APM if you want. I can make that as a follow-up so it's easier to review without these tangential changes.

: U
: U;

export function mergeProjection<T extends any, U extends SourceProjection>(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APM doesn't use projections anymore. If you also want to get rid of projections for the UX related code you are welcome to do it as part of this PR or a follow-up. If you do that we can delete the merge_projections.ts in both APM and UX.

import { UxUIFilters } from '../../../typings/ui_filters';
import { environmentQuery } from '../../components/app/rum_dashboard/local_uifilters/queries';

export function getEsFilter(uiFilters: UxUIFilters, exclude?: boolean) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copying is probably fine. Fewer dependencies <3

@shahzad31
Copy link
Contributor

@elasticmachine merge upstream

Copy link
Contributor

@shahzad31 shahzad31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !!

Thanks for picking it up.

@justinkambic justinkambic enabled auto-merge (squash) May 23, 2022 19:01
@justinkambic
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
ux 133 138 +5

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
ux 154.0KB 155.3KB +1.3KB
Unknown metric groups

ESLint disabled line counts

id before after diff
ux 13 12 -1

Total ESLint disabled count

id before after diff
ux 14 13 -1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @justinkambic

@justinkambic justinkambic merged commit 1886f39 into elastic:main May 24, 2022
@justinkambic justinkambic changed the title [Synthetics] Migrate service list query out of APM [UX Dashboard] Migrate service list query out of APM May 24, 2022
@justinkambic justinkambic added the auto-backport Deprecated - use backport:version if exact versions are needed label May 24, 2022
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.4 The branch "8.4" is invalid or doesn't exist

Manual backport

To create the backport manually run:

node scripts/backport --pr 132548

Questions ?

Please refer to the Backport tool documentation

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 132548 or prevent reminders by adding the backport:skip label.

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label May 25, 2022
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 132548 or prevent reminders by adding the backport:skip label.

2 similar comments
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 132548 or prevent reminders by adding the backport:skip label.

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 132548 or prevent reminders by adding the backport:skip label.

@shahzad31 shahzad31 removed backport missing Added to PRs automatically when the are determined to be missing a backport. auto-backport Deprecated - use backport:version if exact versions are needed labels May 30, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label May 30, 2022
@shahzad31 shahzad31 deleted the 454/service-list-migration branch May 30, 2022 16:27
@sorenlouv sorenlouv added v8.3.0 and removed v8.4.0 labels Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting chore release_note:skip Skip the PR/issue when compiling release notes Team:APM All issues that need APM UI Team support technical debt Improvement of the software architecture and operational architecture v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants