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

[APM] Average latency map for mobile service overview #144127

Merged
merged 10 commits into from
Nov 1, 2022

Conversation

gbamparop
Copy link
Contributor

@gbamparop gbamparop commented Oct 27, 2022

Add average latency map to mobile service overview.

Screen.Recording.2022-10-31.at.18.59.11.mov

Closes #143502

@gbamparop gbamparop changed the title [APM] Add average latency map to mobile service overview [APM] Average latency map for mobile service overview Oct 31, 2022
@gbamparop gbamparop added Team:APM All issues that need APM UI Team support v8.6.0 labels Oct 31, 2022
@gbamparop gbamparop marked this pull request as ready for review October 31, 2022 19:03
@gbamparop gbamparop requested a review from a team as a code owner October 31, 2022 19:03
@elasticmachine
Copy link
Contributor

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

@gbamparop gbamparop added the release_note:skip Skip the PR/issue when compiling release notes label Oct 31, 2022
),
},
],
indexPatternId: APM_STATIC_DATA_VIEW_ID,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ad hoc data views could be used as a follow up

Copy link
Contributor

@cauemarcondes cauemarcondes left a comment

Choose a reason for hiding this comment

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

A couple of suggestions, let me know what do you think.

import { useApmParams } from '../../../../../hooks/use_apm_params';
import { useTimeRange } from '../../../../../hooks/use_time_range';

export function EmbeddedMapComponent({ filters }: { filters: Filter[] }) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need to export this component?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good spot, removed the export

Comment on lines 56 to 60
| EmbeddableFactory<
MapEmbeddableInput,
MapEmbeddableOutput,
MapEmbeddable
>
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this type be inferred by TS based on the response of embeddablePlugin?.getEmbeddableFactory?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not inferred, but I've moved it to the call of getEmbeddableFactory

Comment on lines 65 to 84
if (!factory) {
setError(true);
notifications?.toasts.addDanger({
title: i18n.translate(
'xpack.apm.serviceOverview.embeddedMap.error.toastTitle',
{
defaultMessage: 'An error occurred when adding map embeddable',
}
),
text: i18n.translate(
'xpack.apm.serviceOverview.embeddedMap.error.toastDescription',
{
defaultMessage: `Embeddable factory with id "{embeddableFactoryId}" was not found.`,
values: {
embeddableFactoryId: MAP_SAVED_OBJECT_TYPE,
},
}
),
});
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't you stop the execution of this function if the factory is not defined?

hideFilterActions: true,
};

const embeddableObject = await factory?.create(input);
Copy link
Contributor

Choose a reason for hiding this comment

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

Like the comment above, you wouldn't need to add ? after factory here if you had stoped the function or only run this peace of code in the else block when factory is defined.

SERVICE_VERSION,
} from '../../../../../common/elasticsearch_fieldnames';

function termQuery<T extends string>(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't you use the one that already exists in the Observability plugin

Copy link
Contributor Author

@gbamparop gbamparop Nov 1, 2022

Choose a reason for hiding this comment

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

It's in the /server, the plan is to move it to a common folder on a follow up PR. (#144304)

Comment on lines +36 to +46
const {
path: { serviceName },
query: {
environment,
transactionType,
device,
osVersion,
appVersion,
netConnectionType,
},
} = useApmParams('/services/{serviceName}/overview');
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't you feel it would be better if this function receives as parameters all these values instead of using useApmParams? If we decide to use this on another page we'd have to add another path here and so on.

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 think it's more clear this way to just return the filters, but agree if we find out that it is being used in other pages and have to add more and more we can refactor.

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
apm 1340 1344 +4

Async chunks

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

id before after diff
apm 3.1MB 3.1MB +4.7KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
apm 28.9KB 29.4KB +518.0B
Unknown metric groups

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
apm 79 80 +1
enterpriseSearch 19 21 +2
fleet 57 63 +6
osquery 103 108 +5
securitySolution 439 443 +4
total +18

Total ESLint disabled count

id before after diff
apm 92 93 +1
enterpriseSearch 20 22 +2
fleet 65 71 +6
osquery 104 110 +6
securitySolution 516 520 +4
total +19

History

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

Copy link
Contributor

@cauemarcondes cauemarcondes left a comment

Choose a reason for hiding this comment

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

LGTM

@gbamparop gbamparop merged commit 58b53d8 into elastic:main Nov 1, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Nov 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 release_note:skip Skip the PR/issue when compiling release notes Team:APM All issues that need APM UI Team support v8.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[APM] Mobile APM Map and Geo loc data
5 participants