-
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] Display all properties by default in flyout #113221
Conversation
Pinging @elastic/apm-ui (Team:apm) |
@formgeist right now I'm capitalising all section labels. Previously we hardcoded some. So, what was previously |
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? |
not yet, as error.exception is excluded (similar to span.stacktrace). Should we just exclude error.exception.stacktrace? @sqren |
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>>; |
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't we remove a custom type and use estypes. Fields
instead? It's it became exported recently.
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'll give it a shot - previously I think that type was incorrect (e.g. it didn't support arrays or something similar)
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.
estypes.Fields is string | string[]
, but it can also be an array of objects, e.g. [{ field: '*', include_unmapped: true }]
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 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
}
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.
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!
sgtm unless this is very noisy. |
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.
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'; |
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.
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.
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 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. | |||
*/ | |||
|
|||
/* |
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.
Duplicate license header here.
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.
sharp :)
@@ -37,6 +37,25 @@ export default function apmApiIntegrationTests(providerContext: FtrProviderConte | |||
loadTestFile(require.resolve('./correlations/latency')); | |||
}); | |||
|
|||
<<<<<<< HEAD |
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.
oops
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.
oops indeed
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`); |
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.
Do we need get
?
return get(response.body.hits.hits[0]._source, `${processorEvent}.id`); | |
return response.body.hits.hits[0]._source[processorEvent].id; |
or if optional:
return get(response.body.hits.hits[0]._source, `${processorEvent}.id`); | |
return response.body.hits.hits[0]._source?.[processorEvent]?.id; |
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.
sure, ts will complain out of the box but I can add a type for _source.
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.
Just a small comment on the section title capitalization.
<EuiTitle size="xs"> | ||
<h6>{section.label}</h6> | ||
</EuiTitle> |
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 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.
yes, on my list!
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.
ok for the core changes
x-pack/plugins/apm/public/components/shared/MetadataTable/SpanMetadata/index.tsx
Show resolved
Hide resolved
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
💔 Backport failed
To backport manually run: |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
1 similar comment
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Co-authored-by: Kibana Machine <[email protected]> # Conflicts: # x-pack/plugins/apm/public/components/shared/MetadataTable/helper.ts
Co-authored-by: Kibana Machine <[email protected]>
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.