-
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] Handle other values popup when correlated value is not in top 10 #118069
Conversation
Pinging @elastic/ml-ui (:ml) |
Pinging @elastic/apm-ui (Team:apm) |
)} | ||
|
||
{topValueStats.topValuesSampleSize !== undefined && ( | ||
<Fragment> |
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 can just use <>
. You only need to import Fragment
if you'll need to give it a key
.
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.
Updated here 58d8bcc
<EuiHorizontalRule margin="s" /> | ||
<EuiSpacer size="s" /> | ||
<EuiText size="xs"> | ||
<FormattedMessage |
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.
Most places in APM we just use i18n.translate
directly instead of using the FormattedMessage
component.
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.
Updated here 58d8bcc
Noticed the following: I'm not sure if the results here are correct. The field/value shows up in the table, that's lets me assume there must be some data, there's also a corresponding histogram in the chart, see the tooltip. Nonetheless, the query for the tooltip doesn't find any results. To reproduce, this happens with the |
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 added a few small suggestions for the code. It would be really great if we could already add an API integration test for the additional API endpoint as part of this PR.
@@ -184,6 +184,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { | |||
body: { | |||
...getOptions(), | |||
fieldsToSample: [...fieldsToSample], | |||
samplerShardSize: 5000, |
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 uses a different size than the runtime code. Should we change this to 10000 and also use SAMPLER_SHARD_SIZE
from x-pack/plugins/apm/common/correlations/constants.ts
?
@@ -195,6 +195,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { | |||
body: { | |||
...getOptions(), | |||
fieldsToSample: [...fieldsToSample], | |||
samplerShardSize: 5000, |
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 uses a different size than the runtime code. Should we change this to 10000 and also use SAMPLER_SHARD_SIZE
from x-pack/plugins/apm/common/correlations/constants.ts
?
@@ -20,7 +20,7 @@ const params = { | |||
includeFrozen: false, | |||
environment: ENVIRONMENT_ALL.value, | |||
kuery: '', | |||
samplerShardSize: 5000, | |||
samplerShardSize: 10000, |
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 use SAMPLER_SHARD_SIZE
from x-pack/plugins/apm/common/correlations/constants.ts
?
@@ -76,7 +69,7 @@ describe('field_stats', () => { | |||
}, | |||
}, | |||
}, | |||
sampler: { shard_size: 5000 }, | |||
sampler: { shard_size: 10000 }, |
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 use SAMPLER_SHARD_SIZE
from x-pack/plugins/apm/common/correlations/constants.ts
?
@@ -88,7 +81,7 @@ describe('field_stats', () => { | |||
|
|||
const expectedAggs = { | |||
sample: { | |||
sampler: { shard_size: 5000 }, | |||
sampler: { shard_size: 10000 }, |
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 use SAMPLER_SHARD_SIZE
from x-pack/plugins/apm/common/correlations/constants.ts
?
@@ -105,7 +98,7 @@ describe('field_stats', () => { | |||
|
|||
const expectedAggs = { | |||
sample: { | |||
sampler: { shard_size: 5000 }, | |||
sampler: { shard_size: 10000 }, |
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 use SAMPLER_SHARD_SIZE
from x-pack/plugins/apm/common/correlations/constants.ts
?
@qn895 This might be a later enhancement, but I wonder if the popover should show a loading spinner if the results are still waiting to be completed. Right now, the top 10 list is loaded, but the selected term might come in after because it's outside the top 10. Here's an example of that behavior; |
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 👍 Added a small comment about possibly adding a loading state to the popover to indicate when it's still fetching results once the top 10 is loaded. And a smaller suggestion on changing the text color of the "outside top 10" message.
{Array.isArray(fieldValueStats?.topValues) && ( | ||
<> | ||
<EuiHorizontalRule margin="s" /> | ||
<EuiText size="xs"> |
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.
<EuiText size="xs"> | |
<EuiText size="xs" color="subdued"> |
Lowering the contrast of this message since it's just a help text label for the result.
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.
Or looking at the EUI 41.0.0 upgrade PR, should color="text"
be used rather than subdued
?
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.
Sorry - you're right @formgeist, the EUI 41.0.0 upgrade only changes it to text
for EuiButtonIcon
.
As commented by @walterra in #118069 (comment), if the calculations / queries are correct for this sort of situation, we should adjust the text in the popover. Maybe here the top label should say |
I thought that was described by the "Calculated from sample of x documents", so we don't have to also describe it, but perhaps we really need to repeat it just to make sure it's understood. |
41ccdf0
to
e5e0650
Compare
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.
Latest changes LGTM
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Async chunks
Public APIs missing exports
History
To update your PR or re-run it, just comment with: cc @qn895 |
elastic#118069) * [ML] Add stats for field value not in top 10 * [ML] Fix tests * [ML] Add message * [ML] Reverse label, remove Fragment, switch to i18n * Fix sample shard size import, subdued text * Fix sample shard size import, subdued text * Move routes after refactor * Add loading spinner * Fix sampler shard size Co-authored-by: Kibana Machine <[email protected]>
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
#118069) (#120680) * [ML] Add stats for field value not in top 10 * [ML] Fix tests * [ML] Add message * [ML] Reverse label, remove Fragment, switch to i18n * Fix sample shard size import, subdued text * Fix sample shard size import, subdued text * Move routes after refactor * Add loading spinner * Fix sampler shard size Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Quynh Nguyen <[email protected]>
elastic#118069) * [ML] Add stats for field value not in top 10 * [ML] Fix tests * [ML] Add message * [ML] Reverse label, remove Fragment, switch to i18n * Fix sample shard size import, subdued text * Fix sample shard size import, subdued text * Move routes after refactor * Add loading spinner * Fix sampler shard size Co-authored-by: Kibana Machine <[email protected]>
Summary
This PR shows the percentage/stats for the the selected item in addition to the top 10 values. If the value is not in the top 10 values, an additional query is made to calculate the percentage for the field name/field value.
It also removes the percentiles agg in the numeric fields because we don't need it.
Screen.Recording.2021-12-06.at.09.46.04.mov
Checklist
Delete any items that are not applicable to this PR.