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

[ML] Display advanced mode toggle for the APM failed transactions table #114363

Merged
merged 9 commits into from
Oct 14, 2021

Conversation

qn895
Copy link
Member

@qn895 qn895 commented Oct 7, 2021

Summary

This PR adds a new toggle for the APM Failed transactions table to show the additional statistics. Previously, this was coupled with the Inspect ES query setting in the advanced setting.

Screen Shot 2021-10-07 at 16 00 57

Screen Shot 2021-10-07 at 16 01 06

Screen Shot 2021-10-07 at 16 07 15

Changes include:

  • The advanced statistics mode will be off by default
  • State is saved in LocalStorage which means the user will most likely have the view persist if they've chosen to switch it on
  • The mode will only enable the additional data columns to the table.
  • Removed the current p-value "tooltip" upon hovering a table row
  • The Logs content will still only show when the "Inspect ES queries" feature flag is enabled.

Checklist

Delete any items that are not applicable to this PR.

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.

UX looks good to me 👍

paddingLeft: euiTheme.eui.paddingSizes.s,
}}
>
<EuiSwitch
Copy link
Contributor

Choose a reason for hiding this comment

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

@qn895 @formgeist is there any value in hiding the switch when no correlations are found?

image

Copy link
Contributor

Choose a reason for hiding this comment

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

@peteharverson I think the result would be that the switch would come and go which can be confusing too

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

Tested and LGTM.

Not changed in this PR, but just wondered if the p-value column would benefit from an info tooltip?

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

Just one minor comment on the text, but otherwise tested and LGTM

'xpack.apm.correlations.failedTransactions.correlationsTable.pValueDescription',
{
defaultMessage:
'The chance of seeing at least this count of field name & field value for failed transactions given its prevalence in successful transactions.',
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit - I don't think we normally use the ampersand & in text, so I'd replace it with and.

Copy link
Contributor

Choose a reason for hiding this comment

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

If I understand the context correctly, I would change seeing to something else. I left a suggestion, please take or leave it.

Suggested change
'The chance of seeing at least this count of field name & field value for failed transactions given its prevalence in successful transactions.',
'The chance of getting at least this amount of field name and value for failed transactions given its prevalence in successful transactions.',

Copy link
Contributor

@szabosteve szabosteve left a comment

Choose a reason for hiding this comment

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

I left one suggestion, otherwise UI text LGTM!

'xpack.apm.correlations.failedTransactions.correlationsTable.pValueDescription',
{
defaultMessage:
'The chance of seeing at least this count of field name & field value for failed transactions given its prevalence in successful transactions.',
Copy link
Contributor

Choose a reason for hiding this comment

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

If I understand the context correctly, I would change seeing to something else. I left a suggestion, please take or leave it.

Suggested change
'The chance of seeing at least this count of field name & field value for failed transactions given its prevalence in successful transactions.',
'The chance of getting at least this amount of field name and value for failed transactions given its prevalence in successful transactions.',

@qn895 qn895 marked this pull request as ready for review October 12, 2021 21:08
@qn895 qn895 requested a review from a team as a code owner October 12, 2021 21:08
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@@ -4912,6 +4912,16 @@
"visTypeMetric.colorModes.backgroundOptionLabel": "背景",
"visTypeMetric.colorModes.labelsOptionLabel": "ラベル",
"visTypeMetric.colorModes.noneOptionLabel": "なし",
"visTypeMetric.metricDescription": "計算結果を単独の数字として表示します。",
Copy link
Member

Choose a reason for hiding this comment

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

I assume this is here because some labels were resorted, but it might make sense to undo the changes in these files to prevent merge conflicts (for you or others).

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed here 8477e29

@botelastic botelastic bot added the Team:APM All issues that need APM UI Team support label Oct 13, 2021
@elasticmachine
Copy link
Contributor

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

)}
checked={showStats}
onChange={(e) => setShowStats(!showStats)}
compressed={true}
Copy link
Member

Choose a reason for hiding this comment

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

you can leave out ={true} here and just use compressed

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated here 8477e29

}
)}
checked={showStats}
onChange={(e) => setShowStats(!showStats)}
Copy link
Member

Choose a reason for hiding this comment

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

can you use a callback here? i.e. setShowState(prevShowStats => !prevShowStats). See https://reactjs.org/docs/hooks-reference.html#functional-updates

Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately setShowStats is using useLocalStorage and not useState so this callback doesn't work here. We can modify useLocalStorage to support this behavior but I think that's outside the scope of this PR.

Copy link
Member

@dgieselaar dgieselaar left a comment

Choose a reason for hiding this comment

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

Looks good, just a few nits. Thanks!

@qn895
Copy link
Member Author

qn895 commented Oct 14, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

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.0KB

History

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

cc @qn895

@qn895 qn895 added the auto-backport Deprecated - use backport:version if exact versions are needed label Oct 14, 2021
@qn895 qn895 merged commit 35da323 into elastic:master Oct 14, 2021
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Oct 14, 2021
…le (elastic#114363)

* Add new toggle

* [ML] Add tooltip for p value

* [ML] Add tooltip for p value

* Update tooltip

* Add callback, revert i18n, compressed

Co-authored-by: Kibana Machine <[email protected]>
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Oct 14, 2021
…le (#114363) (#115073)

* Add new toggle

* [ML] Add tooltip for p value

* [ML] Add tooltip for p value

* Update tooltip

* Add callback, revert i18n, compressed

Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Quynh Nguyen <[email protected]>
@qn895 qn895 deleted the ml-apm-toggle-button branch October 15, 2021 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:correlations apm:ml Integration between APM and ML auto-backport Deprecated - use backport:version if exact versions are needed :ml release_note:enhancement Team:APM All issues that need APM UI Team support v7.16.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants