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] Display all properties by default in flyout #113221

Merged
merged 11 commits into from
Oct 5, 2021

Conversation

dgieselaar
Copy link
Member

Closes #71985.

Use an exception list rather than a allowlist, and instead of using _source, use the _fields API to be able to get consistent output of values.

@dgieselaar dgieselaar added release_note:fix Team:APM All issues that need APM UI Team support auto-backport Deprecated - use backport:version if exact versions are needed v7.16.0 labels Sep 28, 2021
@dgieselaar dgieselaar requested review from a team as code owners September 28, 2021 07:10
@elasticmachine
Copy link
Contributor

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

@dgieselaar
Copy link
Member Author

@formgeist right now I'm capitalising all section labels. Previously we hardcoded some. So, what was previously HTTP is now Http, which looks kind of odd. Do you want to keep the list of hardcoded overrides, or maybe just lowercase them all?

@formgeist
Copy link
Contributor

@formgeist right now I'm capitalising all section labels. Previously we hardcoded some. So, what was previously HTTP is now Http, which looks kind of odd. Do you want to keep the list of hardcoded overrides, or maybe just lowercase them all?

I think lowercasing them all makes sense 👍 Btw. will this resolve this issue I found in the backlog since we'll show all related metadata to the transaction?

@dgieselaar
Copy link
Member Author

@formgeist:

will this resolve this issue I found in the backlog since we'll show all related metadata to the transaction?

not yet, as error.exception is excluded (similar to span.stacktrace). Should we just exclude error.exception.stacktrace? @sqren

@formgeist
Copy link
Contributor

Should we just exclude error.exception.stacktrace?

Makes sense to exclude the stacktraces (I imagine they're the ones that are going to cause space issues).

@@ -48,7 +48,7 @@ type ValueTypeOfField<T> = T extends Record<string, string | number>

type MaybeArray<T> = T | T[];

type Fields = Exclude<Required<estypes.SearchRequest>['body']['fields'], undefined>;
type Fields = MaybeArray<Exclude<Required<estypes.SearchRequest>['body']['fields'], undefined>>;
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 we remove a custom type and use estypes. Fields instead? It's it became exported recently.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll give it a shot - previously I think that type was incorrect (e.g. it didn't support arrays or something similar)

Copy link
Member Author

@dgieselaar dgieselaar Sep 30, 2021

Choose a reason for hiding this comment

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

estypes.Fields is string | string[], but it can also be an array of objects, e.g. [{ field: '*', include_unmapped: true }]

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems it's already supported?

SearchRequest.body.fields?: (Field | DateField)[];

export type Field = 'second' | 'minute' | 'hour' | 'day' | 'date' | 'month';
export interface DateField {
  field: Field
  format?: string
  include_unmapped?: boolean
}

Copy link
Member Author

Choose a reason for hiding this comment

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

ah yeah, but that's not what is being exported estypes.Fields. I can remove the MaybeArray part though, that's not correct anyway. Thanks!

@sorenlouv
Copy link
Member

not yet, as error.exception is excluded (similar to span.stacktrace). Should we just exclude error.exception.stacktrace? @sqren

sgtm unless this is very noisy.

Copy link
Contributor

@smith smith left a comment

Choose a reason for hiding this comment

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

Code looks good. Only requesting changes because of the duplicate license header mentioned in a comment.

@@ -11,7 +11,7 @@ import { MemoryRouter } from 'react-router-dom';
import { MetadataTable } from '.';
import { MockApmPluginContextWrapper } from '../../../context/apm_plugin/mock_apm_plugin_context';
import { expectTextsInDocument } from '../../../utils/testHelpers';
import { SectionsWithRows } from './helper';
import { SectionDescriptor } from './types';
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
import { SectionDescriptor } from './types';
import type { SectionDescriptor } from './types';

it's just a test so doesn't matter for bundle size, but still nice to do.

Copy link
Member Author

Choose a reason for hiding this comment

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

++, I think type imports are removed for jest tests as well, which helps with performance (with jest rewriting all the import statements)

@@ -5,20 +5,49 @@
* 2.0.
*/

/*
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicate license header here.

Copy link
Member Author

Choose a reason for hiding this comment

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

sharp :)

@@ -37,6 +37,25 @@ export default function apmApiIntegrationTests(providerContext: FtrProviderConte
loadTestFile(require.resolve('./correlations/latency'));
});

<<<<<<< HEAD
Copy link
Contributor

Choose a reason for hiding this comment

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

oops

Copy link
Member Author

Choose a reason for hiding this comment

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

oops indeed

@smith
Copy link
Contributor

smith commented Sep 29, 2021

Typing in the search filtering box on that panel seems to be very slow, like it's tying up the main thread for a second each time I type a character. It's not making network requests, and this is not something new in this PR, but this might be a good opportunity to improve the performance if it's not too difficult.

@sorenlouv
Copy link
Member

Typing in the search filtering box on that panel seems to be very slow, like it's tying up the main thread for a second each time I type a character. It's not making network requests, and this is not something new in this PR, but this might be a good opportunity to improve the performance if it's not too difficult.

Can we add throttling to limit the number of updates?

},
});

return get(response.body.hits.hits[0]._source, `${processorEvent}.id`);
Copy link
Member

@sorenlouv sorenlouv Sep 29, 2021

Choose a reason for hiding this comment

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

Do we need get?

Suggested change
return get(response.body.hits.hits[0]._source, `${processorEvent}.id`);
return response.body.hits.hits[0]._source[processorEvent].id;

or if optional:

Suggested change
return get(response.body.hits.hits[0]._source, `${processorEvent}.id`);
return response.body.hits.hits[0]._source?.[processorEvent]?.id;

Copy link
Member Author

Choose a reason for hiding this comment

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

sure, ts will complain out of the box but I can add a type for _source.

Copy link
Contributor

@formgeist formgeist left a comment

Choose a reason for hiding this comment

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

Just a small comment on the section title capitalization.

Comment on lines 93 to 95
<EuiTitle size="xs">
<h6>{section.label}</h6>
</EuiTitle>
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we'd force lowercase capitalization for the section titles so we'd avoid the odd-cases like Http > http which is true to the raw formatting in the fieldnames. I think it'll make it easier to scan.
CleanShot 2021-09-30 at 09 15 08@2x

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, on my list!

@dgieselaar
Copy link
Member Author

@smith @sqren I can't reproduce the slowness, what specific place are you looking at (transaction metadata tab, transaction/span flyout, error metadata tab)?

Copy link
Contributor

@mshustov mshustov left a comment

Choose a reason for hiding this comment

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

ok for the core changes

@dgieselaar
Copy link
Member Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
apm 1178 1174 -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 2.7MB 2.7MB -1.1KB

History

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

@dgieselaar dgieselaar merged commit 79f841e into elastic:master Oct 5, 2021
@dgieselaar dgieselaar deleted the show-all-properties branch October 5, 2021 11:38
@kibanamachine
Copy link
Contributor

💔 Backport failed

Status Branch Result
7.x Commit could not be cherrypicked due to conflicts

To backport manually run:
node scripts/backport --pr 113221

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 113221 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 Oct 7, 2021
@kibanamachine
Copy link
Contributor

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

1 similar comment
@kibanamachine
Copy link
Contributor

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

dgieselaar added a commit to dgieselaar/kibana that referenced this pull request Oct 11, 2021
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	x-pack/plugins/apm/public/components/shared/MetadataTable/helper.ts
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Oct 12, 2021
dgieselaar added a commit that referenced this pull request Oct 12, 2021
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:fix Team:APM All issues that need APM UI Team support v7.16.0
Projects
None yet
8 participants