-
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
[ML] Show at least one correlation value and consolidate correlations columns #126683
[ML] Show at least one correlation value and consolidate correlations columns #126683
Conversation
{i18n.translate( | ||
'xpack.apm.correlations.failedTransactions.correlationsTable.impactLabel', | ||
{ | ||
defaultMessage: 'Impact', |
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.
Would be good to add an info tooltip for the Impact column, and one for the Score column on the failed transactions tab, if only to say what the range of values is.
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.
The "impact" seems pretty straight-forward to me and is already mentioned in the popover help for these pages, so IMO a tooltip there isn't necessary.
However, I think it makes sense to have a tooltip for "score". Can we base it on what we have
for "correlation"?:
kibana/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.tsx
Line 129 in 247d3a5
'The correlation score [0-1] of an attribute; the greater the score, the more an attribute increases latency.', |
For example: "The score [0-1] of an attribute; the greater the score, the more an attribute contributes to failed transactions." or "more likely it is that an attribute..."
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 abb1e2a
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.
Gave this a test against the apm-correlations-eden
and apm-correlations-antifraud-hist
data sets and overall looks good. I couldn't find any transactions which show fallback results in the failed transaction tab, but did for the Latency tab, and the consistent columns work well I think.
Pinging @elastic/ml-ui (:ml) |
Pinging @elastic/apm-ui (Team:apm) |
@elasticmachine merge upstream |
[{ fieldName, fieldValue }] | ||
); | ||
|
||
if (typeof fallbackResult === 'object' && fallbackResult !== null) { |
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.
afaict from the type annotation fallbackResult
is LatencyCorrelation | undefined
. In other words: it's either an object, or it's undefined
. In that case, isn't this enough?
if (typeof fallbackResult === 'object' && fallbackResult !== null) { | |
if (fallbackResult) { |
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 9f57ca3
|
||
if (typeof fallbackResult === 'object' && fallbackResult !== null) { | ||
fallbackResult = { | ||
...(fallbackResult as LatencyCorrelation), |
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 shouldn't be necessary. The if
clause should act as a typeguard and narrow the type from optional to LatencyCorrelation
...(fallbackResult as LatencyCorrelation), | |
...fallbackResult, |
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 9f57ca3
fulfilled.forEach((d: LatencyCorrelation | undefined) => { | ||
if (d === undefined) return; | ||
if (Array.isArray(d.histogram)) { | ||
latencyCorrelations.push(d); | ||
} else { | ||
if (!fallbackResult) { | ||
fallbackResult = d; | ||
} else { | ||
if ( | ||
d.ksTest > fallbackResult.ksTest && | ||
d.correlation > fallbackResult.correlation | ||
) { | ||
fallbackResult = d; | ||
} | ||
} | ||
} | ||
}); |
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.
Any possibility of rewriting this to using filter
and map
? Immutable code is often easier to reason about and less error prone.
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 9f57ca3
setResponse({ | ||
...responseUpdate, | ||
fallbackResult, | ||
loaded: LOADED_DONE, | ||
isRunning: false, | ||
}); |
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.
Now that we are no longer using kibana search strategies, would it be possible to use useFetcher
for loading data or is that still blocked by something?
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.
As discussed in Slack, since this might be out of scope of the PR, let's table this for now and revisit in the future for a better implementation.
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 few comments. Overall lgtm
…umns-with-fallback-results
…://github.com/qn895/kibana into apm-consolidate-columns-with-fallback-results
…umns-with-fallback-results
💔 Build FailedFailed CI StepsMetrics [docs]Async chunks
Unknown metric groupsESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @qn895 |
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.
Tested latest changes and LGTM
…umns-with-fallback-results
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: cc @qn895 |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Summary
This PR updates it so that it will show at least one fall back correlation value when no other significant correlation is found. These will show up as 'Very low'
It also adds an impact column to the Latency tab, as well as converting the progress bar in Failed transactions tab to showing numerical value. This makes it consistent across both tabs.
### 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:
For maintainers