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] Transactions breakdown graph: Add breakdown KPI component #38658

Merged
merged 11 commits into from
Jun 28, 2019

Conversation

dgieselaar
Copy link
Member

@dgieselaar dgieselaar commented Jun 11, 2019

Closes #36445. (See linked ticket for user story.)

(Based off of #37360, that needs to be merged first for the diff to be accurate).

image
image

To test this, start the apm-integration-testing server with the following command:
./scripts/compose.py start master --with-opbeans-java --opbeans-java-agent-branch=pr/588/head --apm-server-build https://github.com/elastic/apm-server.git@master and delete the template for the metric index.

Definition of Done for APM UI

  • Flag and create issues of things that are left out
  • Before/after images or gif of UI changes
  • Release labels
  • Designer sign-off for UI related changes
  • PM approval for bigger, user-facing features

@dgieselaar dgieselaar requested a review from a team as a code owner June 11, 2019 14:50
@elasticmachine
Copy link
Contributor

💔 Build Failed

@dgieselaar dgieselaar requested review from ogupte and formgeist June 12, 2019 07:08
@dgieselaar dgieselaar force-pushed the transaction-breakdown branch from aa3673b to 96fcdc1 Compare June 12, 2019 09:50
@elasticmachine
Copy link
Contributor

💔 Build Failed

@dgieselaar dgieselaar force-pushed the transaction-breakdown branch from 96fcdc1 to 936ddeb Compare June 13, 2019 13:30
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💔 Build Failed

@dgieselaar dgieselaar force-pushed the transaction-breakdown branch from cfa8f96 to 562243d Compare June 19, 2019 07:35
@elasticmachine
Copy link
Contributor

💔 Build Failed

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.

@dgieselaar Just made some minor design tweak suggestions to the KPI display.

wrap={false}
>
<EuiFlexItem grow={false}>
<Dot color={color} />
Copy link
Contributor

Choose a reason for hiding this comment

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

You could replace this styled component with <EuiIcon type="dot" color={color} />

<EuiFlexItem grow={false}>
<Dot color={color} />
</EuiFlexItem>
<EuiFlexItem>
Copy link
Contributor

Choose a reason for hiding this comment

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

I reckon we need to add a min-width to this like: <EuiFlexItem style={{ minWidth: 110 }}>

}> = ({ percentage, count }) => {
return (
<EuiFlexGroup alignItems="center" gutterSize="s">
<EuiFlexItem>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it looks a little nicer if you add grow={false} to this item; `

@formgeist
Copy link
Contributor

@dgieselaar Remember, we should add this component, as well as the graph, to the Transaction group detail page as well.

02 - Trace detail (stats) collapsed

@dgieselaar dgieselaar force-pushed the transaction-breakdown branch from 562243d to 1fdd265 Compare June 20, 2019 09:48
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@dgieselaar
Copy link
Member Author

dgieselaar commented Jun 20, 2019

edit: see opening post for instructions.

@dgieselaar
Copy link
Member Author

@formgeist any suggestions for empty/loading/error states?

@formgeist
Copy link
Contributor

@dgieselaar Let me sketch some up 👍

@formgeist
Copy link
Contributor

@dgieselaar I've added an example of the empty state to the original design issue, see the description.

Wrt the loading state, I believe we generally have a horizontal loader and show the panels' empty states until the panels and data is available. This is obviously less than ideal if the loading is longer than a few hundred ms but I think we need to solve that in another larger context. I'd prefer showing the panel with its title and label cleanly until data is available keeping a minimum height. If possible wait with displaying the error message until no data is returned for the request. Thoughts?

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@dgieselaar dgieselaar force-pushed the transaction-breakdown branch from 1416ba0 to 4d32543 Compare June 21, 2019 09:02
@elasticmachine
Copy link
Contributor

💔 Build Failed

@dgieselaar dgieselaar force-pushed the transaction-breakdown branch from 4d32543 to 2483bfe Compare June 24, 2019 19:17
@elasticmachine
Copy link
Contributor

💔 Build Failed

@dgieselaar dgieselaar force-pushed the transaction-breakdown branch from 2483bfe to 551d640 Compare June 25, 2019 09:11
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@dgieselaar
Copy link
Member Author

@formgeist any advice on what kind of error message should be shown (and where)? In the message bar (not sure what it's called) or inline in the component? @ogupte are there any other examples of the UI handling network errors?

@formgeist
Copy link
Contributor

@dgieselaar Did you see the empty state example that I made last week? Is this what you're looking for?

@dgieselaar dgieselaar force-pushed the transaction-breakdown branch from 3cb9d0e to 028a3ad Compare June 27, 2019 10:12
@elasticmachine
Copy link
Contributor

💔 Build Failed

@dgieselaar dgieselaar requested review from ogupte and formgeist June 27, 2019 20:02
@dgieselaar
Copy link
Member Author

retest

</h3>
</EuiTitle>
</EuiFlexItem>
{!hideShowChartButton && (
Copy link
Contributor

Choose a reason for hiding this comment

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

We may want to use the ternary pattern in JSX composition just to be consistent:

{!hideShowChartButton ? (...) : null}

Copy link
Member Author

Choose a reason for hiding this comment

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

aye, fixed


const sumAllSelfTimes = resp.aggregations.sum_all_self_times.value || 0;

const breakdowns = flatten(
Copy link
Contributor

Choose a reason for hiding this comment

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

i think it's ok to use flatten. If we find that it really inflates the size of the kibana builds, then we can always optimize it as needed.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@dgieselaar
Copy link
Member Author

retest

@elasticmachine
Copy link
Contributor

💔 Build Failed

@dgieselaar
Copy link
Member Author

@formgeist I'm going to merge this if you don't mind, it will allow me to prepare the charts PR. Want to keep things moving a bit because of the feature freeze on Tuesday. If there's anything you'd like to improve we can pick it up in #39531.

@dgieselaar
Copy link
Member Author

retest

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@dgieselaar dgieselaar dismissed formgeist’s stale review June 28, 2019 15:21

Will address any further feedback in #39531.

@dgieselaar dgieselaar merged commit 3512463 into elastic:master Jun 28, 2019
@dgieselaar dgieselaar deleted the transaction-breakdown branch June 28, 2019 15:27
@formgeist
Copy link
Contributor

@dgieselaar Yeah, good call on merging this in 👍

dgieselaar added a commit to dgieselaar/kibana that referenced this pull request Jul 1, 2019
…tic#38658)

* [APM] Transactions breakdown graph: Add breakdown KPI component

Closes elastic#36445.

* Remove percentage, line wrapping, correct query

* Add transaction breakdown chart to transaction details page

* Move files into new plugin dir

* Add empty state; update labels

* Use new mapping

* Move urlParams to useTransactionBreakdown hook

* Fix types

* Only show empty state in TransactionBreakdown if previously data was rendered

* Restrict no of KPIs to 20

* Use ternary in render of TransactionBreakdownHeader for consistency
const { data, error, status } = useFetcher(
async () => {
if (serviceName && start && end) {
return callApi<TransactionBreakdownAPIResponse>({
Copy link
Member

Choose a reason for hiding this comment

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

We have a convention of keeping rest calls separately in services/rest. Any reason to not do that 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.

I think we previously discussed this shortly, whether this abstraction (of placing rest calls in a separate file) was worth it. I opted to give it a shot without one. Will we use the call without a hook? If we do use a separate file, do we need a separate file with the hook as well?


const hasHits = data && data.length > 0;

return receivedDataDuringLifetime ? (
Copy link
Member

@sorenlouv sorenlouv Jul 2, 2019

Choose a reason for hiding this comment

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

Bailing early would make this a bit easier to digest:

  if (!receivedDataDuringLifetime) {
    return null;
  }

(that would also be a small optimization if you moved it to the top although my primary motivation is readability)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[APM] Transactions breakdown graph: Add breakdown KPI component
5 participants