* [APM] Handle correlations view with missing field names (#93443) * fixes spelling Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
4eff7a0709
commit
931b54f636
|
@ -63,10 +63,11 @@ export function ErrorCorrelations({ onClose }: Props) {
|
|||
`apm.correlations.errors.fields:${serviceName}`,
|
||||
defaultFieldNames
|
||||
);
|
||||
const hasFieldNames = fieldNames.length > 0;
|
||||
|
||||
const { data, status } = useFetcher(
|
||||
(callApmApi) => {
|
||||
if (start && end) {
|
||||
if (start && end && hasFieldNames) {
|
||||
return callApmApi({
|
||||
endpoint: 'GET /api/apm/correlations/failed_transactions',
|
||||
params: {
|
||||
|
@ -93,6 +94,7 @@ export function ErrorCorrelations({ onClose }: Props) {
|
|||
transactionName,
|
||||
transactionType,
|
||||
fieldNames,
|
||||
hasFieldNames,
|
||||
]
|
||||
);
|
||||
|
||||
|
@ -123,7 +125,7 @@ export function ErrorCorrelations({ onClose }: Props) {
|
|||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<ErrorTimeseriesChart
|
||||
data={data}
|
||||
data={hasFieldNames ? data : undefined}
|
||||
status={status}
|
||||
selectedSignificantTerm={selectedSignificantTerm}
|
||||
/>
|
||||
|
@ -134,7 +136,7 @@ export function ErrorCorrelations({ onClose }: Props) {
|
|||
'xpack.apm.correlations.error.percentageColumnName',
|
||||
{ defaultMessage: '% of failed transactions' }
|
||||
)}
|
||||
significantTerms={data?.significantTerms}
|
||||
significantTerms={hasFieldNames ? data?.significantTerms : []}
|
||||
status={status}
|
||||
setSelectedSignificantTerm={setSelectedSignificantTerm}
|
||||
onFilter={onClose}
|
||||
|
|
|
@ -61,6 +61,8 @@ export function LatencyCorrelations({ onClose }: Props) {
|
|||
`apm.correlations.latency.fields:${serviceName}`,
|
||||
defaultFieldNames
|
||||
);
|
||||
const hasFieldNames = fieldNames.length > 0;
|
||||
|
||||
const [
|
||||
durationPercentile,
|
||||
setDurationPercentile,
|
||||
|
@ -71,7 +73,7 @@ export function LatencyCorrelations({ onClose }: Props) {
|
|||
|
||||
const { data, status } = useFetcher(
|
||||
(callApmApi) => {
|
||||
if (start && end) {
|
||||
if (start && end && hasFieldNames) {
|
||||
return callApmApi({
|
||||
endpoint: 'GET /api/apm/correlations/slow_transactions',
|
||||
params: {
|
||||
|
@ -100,6 +102,7 @@ export function LatencyCorrelations({ onClose }: Props) {
|
|||
transactionType,
|
||||
durationPercentile,
|
||||
fieldNames,
|
||||
hasFieldNames,
|
||||
]
|
||||
);
|
||||
|
||||
|
@ -131,7 +134,7 @@ export function LatencyCorrelations({ onClose }: Props) {
|
|||
</h4>
|
||||
</EuiTitle>
|
||||
<LatencyDistributionChart
|
||||
data={data}
|
||||
data={hasFieldNames ? data : undefined}
|
||||
status={status}
|
||||
selectedSignificantTerm={selectedSignificantTerm}
|
||||
/>
|
||||
|
@ -144,7 +147,7 @@ export function LatencyCorrelations({ onClose }: Props) {
|
|||
'xpack.apm.correlations.latency.percentageColumnName',
|
||||
{ defaultMessage: '% of slow transactions' }
|
||||
)}
|
||||
significantTerms={data?.significantTerms}
|
||||
significantTerms={hasFieldNames ? data?.significantTerms : []}
|
||||
status={status}
|
||||
setSelectedSignificantTerm={setSelectedSignificantTerm}
|
||||
onFilter={onClose}
|
||||
|
|
Loading…
Reference in a new issue