[APM] Remove check for infra data (#142835) (#142973)

(cherry picked from commit b3cfd9743d)

Co-authored-by: Søren Louv-Jansen <soren.louv@elastic.co>
This commit is contained in:
Kibana Machine 2022-10-10 06:44:34 -06:00 committed by GitHub
parent 6a5f4d36af
commit d15ff8d8c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 35 deletions

View file

@ -5,13 +5,10 @@
* 2.0.
*/
import { isEmpty } from 'lodash';
import { EuiLoadingSpinner, EuiEmptyPrompt } from '@elastic/eui';
import React, { useMemo } from 'react';
import { i18n } from '@kbn/i18n';
import React from 'react';
import moment from 'moment';
import { LogStream } from '@kbn/infra-plugin/public';
import { FETCH_STATUS, useFetcher } from '../../../hooks/use_fetcher';
import { useFetcher } from '../../../hooks/use_fetcher';
import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context';
import { APIReturnType } from '../../../services/rest/create_call_apm_api';
@ -32,7 +29,7 @@ export function ServiceLogs() {
const { start, end } = useTimeRange({ rangeFrom, rangeTo });
const { data, status } = useFetcher(
const { data } = useFetcher(
(callApmApi) => {
if (start && end) {
return callApmApi(
@ -54,32 +51,6 @@ export function ServiceLogs() {
[environment, kuery, serviceName, start, end]
);
const noInfrastructureData = useMemo(() => {
return isEmpty(data?.containerIds) && isEmpty(data?.hostNames);
}, [data]);
if (status === FETCH_STATUS.LOADING) {
return (
<div style={{ textAlign: 'center' }}>
<EuiLoadingSpinner size="m" />
</div>
);
}
if (status === FETCH_STATUS.SUCCESS && noInfrastructureData) {
return (
<EuiEmptyPrompt
title={
<h2>
{i18n.translate('xpack.apm.serviceLogs.noInfrastructureMessage', {
defaultMessage: 'There are no log messages to display.',
})}
</h2>
}
/>
);
}
return (
<LogStream
logView={{ type: 'log-view-reference', logViewId: 'default' }}

View file

@ -7198,7 +7198,6 @@
"xpack.apm.serviceIcons.serviceDetails.service.frameworkLabel": "Nom du framework",
"xpack.apm.serviceIcons.serviceDetails.service.runtimeLabel": "Nom et version de l'exécution",
"xpack.apm.serviceIcons.serviceDetails.service.versionLabel": "Version du service",
"xpack.apm.serviceLogs.noInfrastructureMessage": "Il n'y a aucun message de log à afficher.",
"xpack.apm.serviceMap.anomalyDetectionPopoverDisabled": "Affichez les indicateurs d'intégrité du service en activant la détection des anomalies dans les paramètres APM.",
"xpack.apm.serviceMap.anomalyDetectionPopoverLink": "Afficher les anomalies",
"xpack.apm.serviceMap.anomalyDetectionPopoverNoData": "Nous n'avons pas trouvé de score d'anomalie dans la plage temporelle sélectionnée. Consultez les détails dans l'explorateur d'anomalies.",

View file

@ -7185,7 +7185,6 @@
"xpack.apm.serviceIcons.serviceDetails.service.frameworkLabel": "フレームワーク名",
"xpack.apm.serviceIcons.serviceDetails.service.runtimeLabel": "ランタイム名・バージョン",
"xpack.apm.serviceIcons.serviceDetails.service.versionLabel": "サービスバージョン",
"xpack.apm.serviceLogs.noInfrastructureMessage": "表示するログメッセージがありません。",
"xpack.apm.serviceMap.anomalyDetectionPopoverDisabled": "APM 設定で異常検知を有効にすると、サービス正常性インジケーターが表示されます。",
"xpack.apm.serviceMap.anomalyDetectionPopoverLink": "異常を表示",
"xpack.apm.serviceMap.anomalyDetectionPopoverNoData": "選択した時間範囲で、異常スコアを検出できませんでした。異常エクスプローラーで詳細を確認してください。",

View file

@ -7199,7 +7199,6 @@
"xpack.apm.serviceIcons.serviceDetails.service.frameworkLabel": "框架名称",
"xpack.apm.serviceIcons.serviceDetails.service.runtimeLabel": "运行时名称和版本",
"xpack.apm.serviceIcons.serviceDetails.service.versionLabel": "服务版本",
"xpack.apm.serviceLogs.noInfrastructureMessage": "没有可显示的日志消息。",
"xpack.apm.serviceMap.anomalyDetectionPopoverDisabled": "通过在 APM 设置中启用异常检测来显示服务运行状况指标。",
"xpack.apm.serviceMap.anomalyDetectionPopoverLink": "查看异常",
"xpack.apm.serviceMap.anomalyDetectionPopoverNoData": "在选定时间范围内找不到异常分数。请在 Anomaly Explorer 中查看详情。",