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] Remove additional "No data" message and re-ordering charts #75399

Merged
merged 19 commits into from
Sep 1, 2020

Conversation

cauemarcondes
Copy link
Contributor

@cauemarcondes cauemarcondes commented Aug 19, 2020

closes #74834
closes #74850

Screenshot 2020-08-25 at 14 01 02

Screenshot 2020-08-25 at 14 01 44

@cauemarcondes cauemarcondes requested a review from a team as a code owner August 19, 2020 08:47
@botelastic botelastic bot added the Team:APM All issues that need APM UI Team support label Aug 19, 2020
@elasticmachine
Copy link
Contributor

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

@formgeist
Copy link
Contributor

@cauemarcondes Do you think it's possible that we can include this issue in this PR as well? #74850

@cauemarcondes
Copy link
Contributor Author

@cauemarcondes Do you think it's possible that we can include this issue in this PR as well? #74850

Yes, will do it.

@formgeist
Copy link
Contributor

@cauemarcondes I'm not seeing the example that you shared. The "Time spent.." chart has no x-axis values and it's not aligned in the middle as the screenshot would indicate.

Screenshot 2020-08-19 at 10 59 33

I'm just picking a time range that I know has no data to return.

@cauemarcondes
Copy link
Contributor Author

I'm just picking a time range that I know has no data to return.

That's weird, can you share the URL? Have you pulled to get the latest changes?

@formgeist
Copy link
Contributor

That's weird, can you share the URL? Have you pulled to get the latest changes?

OK, must've messed in my pull - now it looks as described 👍

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.

LGTM

@cauemarcondes cauemarcondes changed the title [APM] Time spent by span type chart: Remove additional "No data" message since the expand/collapse toggle is not used [APM] Remove additional "No data" message and re-ordering charts Aug 19, 2020
@cauemarcondes
Copy link
Contributor Author

Do you think it's possible that we can include this issue in this PR as well? #74850

@formgeist I have just pushed a new version with the charts re-ordered.

@formgeist
Copy link
Contributor

@formgeist I have just pushed a new version with the charts re-ordered.

Thanks - I noticed that the charts have been rearranged on the RUM services, which features an additional set of charts (map + page load distribution). I think we'd want to keep the original position of these at the bottom.

Before

Screenshot 2020-08-19 at 11 40 25

Currently in this PR

Screenshot 2020-08-19 at 11 32 22

Proposed layout

Screenshot 2020-08-19 at 11 49 45

@cauemarcondes
Copy link
Contributor Author

I noticed that the charts have been rearranged on the RUM services, which features an additional set of charts (map + page load distribution). I think we'd want to keep the original position of these at the bottom.

good catch.

@cauemarcondes
Copy link
Contributor Author

@formgeist
Screenshot 2020-08-19 at 13 10 15

@formgeist
Copy link
Contributor

@cauemarcondes LGTM 👍

@cauemarcondes
Copy link
Contributor Author

@elasticmachine merge upstream

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.

LGTM, but we should check what happens when there is a large number of KPIs (e.g. >8)

Copy link
Member

@sorenlouv sorenlouv left a comment

Choose a reason for hiding this comment

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

lgtm

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.

LGTM - I look forward to hearing any feedback from users who might have found the large KPIs useful. I think the consistent look for the charts works much better with this layout.

@formgeist
Copy link
Contributor

Once this goes in, I would like to open a new issue to solve some of the responsive layout enhancements to allow for narrower screen sizes to be able to appropriately read the charts. I think we can solve this after the fact, if time permits.

@cauemarcondes
Copy link
Contributor Author

@elasticmachine merge upstream

<TransactionBreakdownGraph
timeseries={timeseries.map((serie) => ({
...serie,
legendValue: asPercent(serie.legendValue, 1),
Copy link
Member

Choose a reason for hiding this comment

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

Any reason for overwriting series here, and not where it's defined?

const timeseries = kpis.map((kpi) => ({
title: kpi.name,
color: kpi.color,
type: 'areaStacked',
data: timeseriesPerSubtype[kpi.name],
hideLegend: true,
}));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

asPercent is defined in /public and I think the server doesn't have to know how the UI is going to show the value, it should only provide the value. I have my concerns about color, type and hideLegend, maybe they should all be removed from the server and be defined only in the client.

Copy link
Contributor

Choose a reason for hiding this comment

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

See #70161 in the backlog.

Copy link
Member

@sorenlouv sorenlouv Aug 26, 2020

Choose a reason for hiding this comment

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

I think the server doesn't have to know how the UI is going to show the value, it should only provide the value.

It depends. Are there any drawbacks to defining it on the server? I see clear drawbacks in defining the chart config across multiple files.
That being said, if it's too much of a hassle because it'll require you to move asPercent and its dependencies to the server I'm fine with leaving it as-is.

@smith Regarding #70161: I'd be surprised if we don't have a way to access the advanced settings from the server.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your input @sqren, the only drawback I can see here is that I'd have to move the asPercent to a common place. But if it makes sense the server to send the value already formatted then I wouldn't think it as a drawback but as an improvement. My question is does it make sense sending the value already formatted from the server? For what I've seen we never send any formatted value from the server, we always leave this responsibility to the client.

FYI: I'm not against moving the asPercent, I only want to keep consistency across all APIs we've got.

Copy link
Member

Choose a reason for hiding this comment

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

@smith: why? (Other than it being the convention)

Copy link
Contributor

Choose a reason for hiding this comment

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

On a technical level, some explanation is in #70161. If a users are using different themes and the API includes the colors of the lines the API would have to return different responses based on the theme.

If the presentational elements are coupled with the chart data, changing the presentation becomes more difficult.

Copy link
Member

Choose a reason for hiding this comment

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

For theming then it makes sense, although I can imagine that can be supported on the server as well. Personally I'm not swayed by "presentational data belongs on the client". IME, server-side code is more predictable and testable, and it's nice to have it in one place.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well, for now then I'll move the asPercent to the common directory and return the value already formatted from the server. We can continue discussing on Nathan's issue #70161.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good @cauemarcondes 👍

@cauemarcondes
Copy link
Contributor Author

@elasticmachine merge upstream

@cauemarcondes
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

async chunks size

id value diff baseline
apm 4.7MB -5.4KB 4.7MB

distributable file count

id value diff baseline
total 45456 +1 45455

History

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

@cauemarcondes cauemarcondes merged commit bf7b478 into elastic:master Sep 1, 2020
@cauemarcondes cauemarcondes deleted the apm-chart-remove-msg branch September 1, 2020 11:38
cauemarcondes added a commit to cauemarcondes/kibana that referenced this pull request Sep 1, 2020
…stic#75399)

* removing extra message

* adding x-axis values when no data is available

* reordering charts

* fixing internationalization

* fixing transaction RUM agent order

* addressing PR comment

* removing kpis list and show it in the chart legend instead

* fixing API test

* moving asPercent to the common directory

* fixing api test

* fixing unit test

* removing unused prop

* fixing unit test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
cauemarcondes added a commit that referenced this pull request Sep 1, 2020
) (#76364)

* removing extra message

* adding x-axis values when no data is available

* reordering charts

* fixing internationalization

* fixing transaction RUM agent order

* addressing PR comment

* removing kpis list and show it in the chart legend instead

* fixing API test

* moving asPercent to the common directory

* fixing api test

* fixing unit test

* removing unused prop

* fixing unit test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:enhancement Team:APM All issues that need APM UI Team support v7.10.0
Projects
None yet
7 participants