-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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] Migrate tx latency chart and group stats to rollups/service metrics #153162
Changes from 5 commits
01bc00b
2c4d36c
aafd31d
c41f5d5
f75200a
c792043
074d14d
ae59097
115e2f6
b4f5d26
40c4721
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -17,3 +17,7 @@ export type ApmServiceTransactionDocumentType = | |||||||||||||||
| ApmDocumentType.ServiceTransactionMetric | ||||||||||||||||
| ApmDocumentType.TransactionMetric | ||||||||||||||||
| ApmDocumentType.TransactionEvent; | ||||||||||||||||
|
||||||||||||||||
export type ApmTransactionDocumentType = | ||||||||||||||||
| ApmDocumentType.TransactionMetric | ||||||||||||||||
| ApmDocumentType.TransactionEvent; | ||||||||||||||||
Comment on lines
+21
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about service transaction metric?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In case we add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, it's about making sure that the metric contains certain data. ie, service-instance specific data (like host) will not be available on transaction metrics. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,36 +5,35 @@ | |
* 2.0. | ||
*/ | ||
|
||
import React, { useEffect, useState } from 'react'; | ||
import { EuiFlexGroup } from '@elastic/eui'; | ||
import { EuiFlexItem } from '@elastic/eui'; | ||
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
import { formatAlertEvaluationValue } from '@kbn/observability-plugin/public'; | ||
import { | ||
ALERT_DURATION, | ||
ALERT_END, | ||
ALERT_RULE_UUID, | ||
ALERT_EVALUATION_THRESHOLD, | ||
ALERT_RULE_TYPE_ID, | ||
ALERT_EVALUATION_VALUE, | ||
ALERT_RULE_TYPE_ID, | ||
ALERT_RULE_UUID, | ||
} from '@kbn/rule-data-utils'; | ||
import moment from 'moment'; | ||
import { formatAlertEvaluationValue } from '@kbn/observability-plugin/public'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
import React, { useEffect, useMemo, useState } from 'react'; | ||
import { useKibana } from '@kbn/kibana-react-plugin/public'; | ||
import { SERVICE_ENVIRONMENT } from '../../../../../common/es_fields/apm'; | ||
import { ChartPointerEventContextProvider } from '../../../../context/chart_pointer_event/chart_pointer_event_context'; | ||
import { TimeRangeMetadataContextProvider } from '../../../../context/time_range_metadata/time_range_metadata_context'; | ||
import { useTimeRange } from '../../../../hooks/use_time_range'; | ||
import { getComparisonChartTheme } from '../../../shared/time_comparison/get_comparison_chart_theme'; | ||
import { ChartPointerEventContextProvider } from '../../../../context/chart_pointer_event/chart_pointer_event_context'; | ||
|
||
import FailedTransactionChart from './failed_transaction_chart'; | ||
import { getAggsTypeFromRule } from './helpers'; | ||
import { LatencyAlertsHistoryChart } from './latency_alerts_history_chart'; | ||
import LatencyChart from './latency_chart/latency_chart'; | ||
import ThroughputChart from './throughput_chart'; | ||
import { | ||
AlertDetailsAppSectionProps, | ||
SERVICE_NAME, | ||
TRANSACTION_TYPE, | ||
} from './types'; | ||
import { getAggsTypeFromRule } from './helpers'; | ||
import { LatencyAlertsHistoryChart } from './latency_alerts_history_chart'; | ||
|
||
import { SERVICE_ENVIRONMENT } from '../../../../../common/es_fields/apm'; | ||
import FailedTransactionChart from './failed_transaction_chart'; | ||
import LatencyChart from './latency_chart/latency_chart'; | ||
import ThroughputChart from './throughput_chart'; | ||
|
||
export function AlertDetailsAppSection({ | ||
rule, | ||
|
@@ -133,61 +132,80 @@ export function AlertDetailsAppSection({ | |
const transactionType = alert.fields[TRANSACTION_TYPE]; | ||
const comparisonChartTheme = getComparisonChartTheme(); | ||
|
||
const { | ||
services: { uiSettings }, | ||
} = useKibana(); | ||
|
||
const historicalRange = useMemo(() => { | ||
return { | ||
start: moment().subtract(30, 'days').toISOString(), | ||
end: moment().toISOString(), | ||
}; | ||
}, []); | ||
|
||
return ( | ||
<EuiFlexGroup direction="column" gutterSize="s"> | ||
<ChartPointerEventContextProvider> | ||
<EuiFlexItem> | ||
<LatencyChart | ||
alert={alert} | ||
transactionType={transactionType} | ||
serviceName={serviceName} | ||
environment={environment} | ||
start={start} | ||
end={end} | ||
comparisonChartTheme={comparisonChartTheme} | ||
timeZone={timeZone} | ||
latencyAggregationType={latencyAggregationType} | ||
comparisonEnabled={comparisonEnabled} | ||
offset={offset} | ||
setLatencyMaxY={setLatencyMaxY} | ||
/> | ||
<EuiFlexGroup direction="row" gutterSize="s"> | ||
<ThroughputChart | ||
<TimeRangeMetadataContextProvider | ||
start={start} | ||
end={end} | ||
kuery="" | ||
useSpanName={false} | ||
uiSettings={uiSettings!} | ||
> | ||
<ChartPointerEventContextProvider> | ||
<EuiFlexItem> | ||
<LatencyChart | ||
alert={alert} | ||
transactionType={transactionType} | ||
serviceName={serviceName} | ||
environment={environment} | ||
start={start} | ||
end={end} | ||
comparisonChartTheme={comparisonChartTheme} | ||
timeZone={timeZone} | ||
latencyAggregationType={latencyAggregationType} | ||
comparisonEnabled={comparisonEnabled} | ||
latencyMaxY={latencyMaxY} | ||
offset={offset} | ||
timeZone={timeZone} | ||
setLatencyMaxY={setLatencyMaxY} | ||
/> | ||
<FailedTransactionChart | ||
transactionType={transactionType} | ||
<EuiFlexGroup direction="row" gutterSize="s"> | ||
<ThroughputChart | ||
transactionType={transactionType} | ||
serviceName={serviceName} | ||
environment={environment} | ||
start={start} | ||
end={end} | ||
comparisonChartTheme={comparisonChartTheme} | ||
comparisonEnabled={comparisonEnabled} | ||
latencyMaxY={latencyMaxY} | ||
offset={offset} | ||
timeZone={timeZone} | ||
/> | ||
<FailedTransactionChart | ||
transactionType={transactionType} | ||
serviceName={serviceName} | ||
environment={environment} | ||
start={start} | ||
end={end} | ||
comparisonChartTheme={comparisonChartTheme} | ||
timeZone={timeZone} | ||
/> | ||
</EuiFlexGroup> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<LatencyAlertsHistoryChart | ||
ruleId={alert.fields[ALERT_RULE_UUID]} | ||
serviceName={serviceName} | ||
start={historicalRange.start} | ||
end={historicalRange.end} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this fix related to this this PR and the move to service transaction metrics? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's a cosmetic change, it doesn't change the behaviour of the component. |
||
transactionType={transactionType} | ||
latencyAggregationType={latencyAggregationType} | ||
environment={environment} | ||
start={start} | ||
end={end} | ||
comparisonChartTheme={comparisonChartTheme} | ||
timeZone={timeZone} | ||
/> | ||
</EuiFlexGroup> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<LatencyAlertsHistoryChart | ||
ruleId={alert.fields[ALERT_RULE_UUID]} | ||
serviceName={serviceName} | ||
start={start} | ||
end={end} | ||
transactionType={transactionType} | ||
latencyAggregationType={latencyAggregationType} | ||
environment={environment} | ||
timeZone={timeZone} | ||
/> | ||
</EuiFlexItem> | ||
</ChartPointerEventContextProvider> | ||
</EuiFlexItem> | ||
</ChartPointerEventContextProvider> | ||
</TimeRangeMetadataContextProvider> | ||
</EuiFlexGroup> | ||
); | ||
} | ||
|
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.
Is this intended?
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.
Yeah, no need for it to be required.