Skip to content

Commit

Permalink
[APM] Remove check for infra data (elastic#142835)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenlouv authored Oct 10, 2022
1 parent 0518a74 commit b3cfd97
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 35 deletions.
35 changes: 3 additions & 32 deletions x-pack/plugins/apm/public/components/app/service_logs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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(
Expand All @@ -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' }}
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -7565,7 +7565,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.",
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -7552,7 +7552,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": "選択した時間範囲で、異常スコアを検出できませんでした。異常エクスプローラーで詳細を確認してください。",
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -7569,7 +7569,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 中查看详情。",
Expand Down

0 comments on commit b3cfd97

Please sign in to comment.