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] Alerting: Show preview as chart of threshold #84080

Merged
merged 28 commits into from
Dec 14, 2020

Conversation

cauemarcondes
Copy link
Contributor

closes #77313

@smith smith marked this pull request as ready for review December 9, 2020 21:37
@smith smith requested a review from a team as a code owner December 9, 2020 21:37

// Make the maximum Y value either the actual max or 20% more than the threshold
const values = data.map((d) => d.y ?? 0);
const yMax = Math.max(Math.max(...values), threshold * 1.2);
Copy link
Contributor

Choose a reason for hiding this comment

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

could be simplified to Math.max(...values, threshold * 1.2);

@botelastic botelastic bot added the Team:APM All issues that need APM UI Team support label Dec 9, 2020
@elasticmachine
Copy link
Contributor

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

const thresholdOpacity = 0.3;
const timestamps = data.map((d) => d.x);
const xMin = moment.utc(getMax(timestamps)).valueOf();
const xMax = moment.utc(getMin(timestamps)).valueOf();
Copy link
Contributor

@ogupte ogupte Dec 9, 2020

Choose a reason for hiding this comment

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

Is moment needed? it seems like getMax(timestamps) & getMin(timestamps) would be sufficient.

@@ -14,7 +14,7 @@ import { i18n } from '@kbn/i18n';
import React, { useState } from 'react';
import { IBasePath } from '../../../../../../src/core/public';
import { AlertType } from '../../../common/alert_types';
import { AlertingFlyout } from '../../components/alerting/AlertingFlyout';
import { AlertingFlyout } from '../../components/alerting/alerting_flyout';
Copy link
Member

Choose a reason for hiding this comment

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

👍


import datemath from '@elastic/datemath';

export function windowToTimeRange(windowSize: number, windowUnit: string) {
Copy link
Member

Choose a reason for hiding this comment

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

windowToTimeRange seems a little vague. WDYT about getAbsoluteTimeRange?

Suggested change
export function windowToTimeRange(windowSize: number, windowUnit: string) {
export function getAbsoluteTimeRange(windowSize: number, windowUnit: string) {

const chartPreview = (
<ChartPreview
data={data}
yTickFormat={(d: any) => asPercent(d, 1)}
Copy link
Member

Choose a reason for hiding this comment

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

Can we narrow the type?

Suggested change
yTickFormat={(d: any) => asPercent(d, 1)}
yTickFormat={(d: number) => asPercent(d, 1)}

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed. It's taking a y value so probably number | null is better.

bool: {
filter: [
{ range: rangeFilter(start, end) },
,
Copy link
Member

Choose a reason for hiding this comment

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

extra comma?

@smith smith self-assigned this Dec 10, 2020
@smith
Copy link
Contributor

smith commented Dec 14, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
apm 1726 1728 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
apm 5.4MB 5.4MB +57.8KB

Distributable file count

id before after diff
default 47129 47893 +764

History

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

import { useEnvironmentsFetcher } from '../../../hooks/use_environments_fetcher';
import { callApmApi } from '../../../services/rest/createCallApmApi';
import { getResponseTimeTickFormatter } from '../../shared/charts/transaction_charts/helper';
import { useFormatter } from '../../shared/charts/transaction_charts/use_formatter';
Copy link
Contributor

Choose a reason for hiding this comment

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

@tylersmalley
Copy link
Contributor

Reverting this PR, will post updates shortly.

tylersmalley pushed a commit that referenced this pull request Dec 14, 2020
@tylersmalley
Copy link
Contributor

Reverted due to failure in master.

master: d909a96
7.x Closed PR: #85819

There was a conflict with a line added to this PR that referenced a file removed in a PR merged an hour prior. #84080 (comment)

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

Successfully merging this pull request may close these issues.

[APM] Alerting: Show preview as chart of threshold
7 participants