Skip to content

Commit

Permalink
Merge branch 'master' into test/add-to-dashboard-modal-actual
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Feb 4, 2021
2 parents 2b5bb2f + 9e7e1e1 commit e7acb97
Show file tree
Hide file tree
Showing 137 changed files with 1,575 additions and 1,037 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ readonly links: {
readonly installation: string;
readonly configuration: string;
readonly elasticsearchOutput: string;
readonly elasticsearchModule: string;
readonly startup: string;
readonly exportedFields: string;
};
Expand All @@ -29,6 +30,10 @@ readonly links: {
};
readonly metricbeat: {
readonly base: string;
readonly configure: string;
readonly httpEndpoint: string;
readonly install: string;
readonly start: string;
};
readonly enterpriseSearch: {
readonly base: string;
Expand Down
13 changes: 13 additions & 0 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export class DocLinksService {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}`,
installation: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/filebeat-installation-configuration.html`,
configuration: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/configuring-howto-filebeat.html`,
elasticsearchModule: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/filebeat-module-elasticsearch.html`,
elasticsearchOutput: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/elasticsearch-output.html`,
startup: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/filebeat-starting.html`,
exportedFields: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}/exported-fields.html`,
Expand All @@ -53,6 +54,10 @@ export class DocLinksService {
},
metricbeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/metricbeat/${DOC_LINK_VERSION}`,
configure: `${ELASTIC_WEBSITE_URL}guide/en/beats/metricbeat/${DOC_LINK_VERSION}/configuring-howto-metricbeat.html`,
httpEndpoint: `${ELASTIC_WEBSITE_URL}guide/en/beats/metricbeat/${DOC_LINK_VERSION}/http-endpoint.html`,
install: `${ELASTIC_WEBSITE_URL}guide/en/beats/metricbeat/${DOC_LINK_VERSION}/metricbeat-installation-configuration.html`,
start: `${ELASTIC_WEBSITE_URL}guide/en/beats/metricbeat/${DOC_LINK_VERSION}/metricbeat-starting.html`,
},
heartbeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/heartbeat/${DOC_LINK_VERSION}`,
Expand Down Expand Up @@ -193,8 +198,11 @@ export class DocLinksService {
alertsKibanaDiskThreshold: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kibana-alerts.html#kibana-alerts-disk-usage-threshold`,
alertsKibanaJvmThreshold: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kibana-alerts.html#kibana-alerts-jvm-memory-threshold`,
alertsKibanaMissingData: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kibana-alerts.html#kibana-alerts-missing-monitoring-data`,
metricbeatBlog: `${ELASTIC_WEBSITE_URL}blog/external-collection-for-elastic-stack-monitoring-is-now-available-via-metricbeat`,
monitorElasticsearch: `${ELASTICSEARCH_DOCS}configuring-metricbeat.html`,
monitorKibana: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/monitoring-metricbeat.html`,
monitorLogstash: `${ELASTIC_WEBSITE_URL}guide/en/logstash/${DOC_LINK_VERSION}/monitoring-with-metricbeat.html`,
troubleshootKibana: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/monitor-troubleshooting.html`,
},
security: {
apiKeyServiceSettings: `${ELASTICSEARCH_DOCS}security-settings.html#api-key-service-settings`,
Expand Down Expand Up @@ -257,6 +265,7 @@ export interface DocLinksStart {
readonly installation: string;
readonly configuration: string;
readonly elasticsearchOutput: string;
readonly elasticsearchModule: string;
readonly startup: string;
readonly exportedFields: string;
};
Expand All @@ -265,6 +274,10 @@ export interface DocLinksStart {
};
readonly metricbeat: {
readonly base: string;
readonly configure: string;
readonly httpEndpoint: string;
readonly install: string;
readonly start: string;
};
readonly enterpriseSearch: {
readonly base: string;
Expand Down
5 changes: 5 additions & 0 deletions src/core/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ export interface DocLinksStart {
readonly installation: string;
readonly configuration: string;
readonly elasticsearchOutput: string;
readonly elasticsearchModule: string;
readonly startup: string;
readonly exportedFields: string;
};
Expand All @@ -482,6 +483,10 @@ export interface DocLinksStart {
};
readonly metricbeat: {
readonly base: string;
readonly configure: string;
readonly httpEndpoint: string;
readonly install: string;
readonly start: string;
};
readonly enterpriseSearch: {
readonly base: string;
Expand Down
17 changes: 0 additions & 17 deletions x-pack/plugins/apm/common/projections.ts

This file was deleted.

2 changes: 1 addition & 1 deletion x-pack/plugins/apm/public/components/app/Home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { useTraceOverviewHref } from '../../shared/Links/apm/TraceOverviewLink';
import { MainTabs } from '../../shared/main_tabs';
import { ServiceMap } from '../ServiceMap';
import { ServiceInventory } from '../service_inventory';
import { TraceOverview } from '../TraceOverview';
import { TraceOverview } from '../trace_overview';

interface Tab {
key: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { AnomalyDetection } from '../../Settings/anomaly_detection';
import { ApmIndices } from '../../Settings/ApmIndices';
import { CustomizeUI } from '../../Settings/CustomizeUI';
import { TraceLink } from '../../TraceLink';
import { TransactionDetails } from '../../TransactionDetails';
import { TransactionDetails } from '../../transaction_details';
import {
CreateAgentConfigurationRouteHandler,
EditAgentConfigurationRouteHandler,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React from 'react';
import { EuiFlexGrid, EuiFlexItem, EuiBadge } from '@elastic/eui';
import styled from 'styled-components';
import { i18n } from '@kbn/i18n';
import { unit, px, truncate } from '../../../../style/variables';
import { unit, px, truncate } from '../../../../../style/variables';

const BadgeText = styled.div`
display: inline-block;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
import { i18n } from '@kbn/i18n';
import styled from 'styled-components';
import { FilterBadgeList } from './FilterBadgeList';
import { unit, px } from '../../../../style/variables';
import { unit, px } from '../../../../../style/variables';
import { FilterTitleButton } from './FilterTitleButton';

const Popover = styled((EuiPopover as unknown) as FunctionComponent).attrs(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ import {
import { i18n } from '@kbn/i18n';
import styled from 'styled-components';
import { Filter } from './Filter';
import { useLocalUIFilters } from '../../../hooks/useLocalUIFilters';
import { Projection } from '../../../../common/projections';
import { LocalUIFilterName } from '../../../../common/ui_filter';
import { useLocalUIFilters } from '../hooks/useLocalUIFilters';
import { LocalUIFilterName } from '../../../../../common/ui_filter';

interface Props {
projection: Projection;
filterNames: LocalUIFilterName[];
params?: Record<string, string | number | boolean | undefined>;
showCount?: boolean;
Expand All @@ -33,7 +31,6 @@ const ButtonWrapper = styled.div`
`;

function LocalUIFilters({
projection,
params,
filterNames,
children,
Expand All @@ -42,7 +39,6 @@ function LocalUIFilters({
}: Props) {
const { filters, setFilterValue, clearValues } = useLocalUIFilters({
filterNames,
projection,
params,
shouldFetch,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@

import { omit } from 'lodash';
import { useHistory } from 'react-router-dom';
import { Projection } from '../../common/projections';
import { pickKeys } from '../../common/utils/pick_keys';
import { LocalUIFilterName } from '../../../../../common/ui_filter';
import { pickKeys } from '../../../../../common/utils/pick_keys';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { LocalUIFiltersAPIResponse } from '../../server/lib/ui_filters/local_ui_filters';
import { LocalUIFiltersAPIResponse } from '../../../../../server/lib/ui_filters/local_ui_filters';
import {
localUIFilters,
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
} from '../../server/lib/ui_filters/local_ui_filters/config';
import { fromQuery, toQuery } from '../components/shared/Links/url_helpers';
import { removeUndefinedProps } from '../context/url_params_context/helpers';
import { useFetcher } from './use_fetcher';
import { useUrlParams } from '../context/url_params_context/use_url_params';
import { LocalUIFilterName } from '../../common/ui_filter';
} from '../../../../../server/lib/ui_filters/local_ui_filters/config';
import {
fromQuery,
toQuery,
} from '../../../../components/shared/Links/url_helpers';
import { removeUndefinedProps } from '../../../../context/url_params_context/helpers';
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
import { useFetcher } from '../../../../hooks/use_fetcher';

const getInitialData = (
filterNames: LocalUIFilterName[]
Expand All @@ -31,12 +33,10 @@ const getInitialData = (
};

export function useLocalUIFilters({
projection,
filterNames,
params,
shouldFetch,
}: {
projection: Projection;
filterNames: LocalUIFilterName[];
params?: Record<string, string | number | boolean | undefined>;
shouldFetch: boolean;
Expand Down Expand Up @@ -72,7 +72,7 @@ export function useLocalUIFilters({
(callApmApi) => {
if (shouldFetch && urlParams.start && urlParams.end) {
return callApmApi({
endpoint: `GET /api/apm/ui_filters/local_filters/${projection}` as const,
endpoint: `GET /api/apm/ui_filters/local_filters/rumOverview`,
params: {
query: {
uiFilters: JSON.stringify(uiFilters),
Expand All @@ -87,7 +87,6 @@ export function useLocalUIFilters({
}
},
[
projection,
uiFilters,
urlParams.start,
urlParams.end,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
*/

import { useMemo } from 'react';
import { callApi } from '../services/rest/callApi';
import { useApmPluginContext } from '../context/apm_plugin/use_apm_plugin_context';
import { FetchOptions } from '../../common/fetch_options';
import { callApi } from '../../../../services/rest/callApi';
import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context';
import { FetchOptions } from '../../../../../common/fetch_options';

export function useCallApi() {
const { http } = useApmPluginContext().core;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
* 2.0.
*/

import React, { useMemo } from 'react';
import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui';
import React, { useMemo } from 'react';
import { useTrackPageview } from '../../../../../observability/public';
import { Projection } from '../../../../common/projections';
import { LocalUIFilters } from './LocalUIFilters';
import { RumDashboard } from './RumDashboard';

import { LocalUIFilters } from '../../shared/LocalUIFilters';
import { URLFilter } from './URLFilter';

export function RumOverview() {
Expand All @@ -21,7 +19,6 @@ export function RumOverview() {
const localUIFiltersConfig = useMemo(() => {
const config: React.ComponentProps<typeof LocalUIFilters> = {
filterNames: ['location', 'device', 'os', 'browser'],
projection: Projection.rumOverview,
};

return config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,26 @@

import {
EuiFlexGroup,
EuiFlexItem,
EuiPage,
EuiPanel,
EuiSpacer,
EuiTitle,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React, { useMemo } from 'react';
import React from 'react';
import { useTrackPageview } from '../../../../../observability/public';
import { Projection } from '../../../../common/projections';
import { useFetcher } from '../../../hooks/use_fetcher';
import { useUrlParams } from '../../../context/url_params_context/use_url_params';
import { LocalUIFilters } from '../../shared/LocalUIFilters';
import { useErrorGroupDistributionFetcher } from '../../../hooks/use_error_group_distribution_fetcher';
import { useFetcher } from '../../../hooks/use_fetcher';
import { SearchBar } from '../../shared/search_bar';
import { ErrorDistribution } from '../ErrorGroupDetails/Distribution';
import { ErrorGroupList } from './List';
import { useErrorGroupDistributionFetcher } from '../../../hooks/use_error_group_distribution_fetcher';

interface ErrorGroupOverviewProps {
serviceName: string;
}

function ErrorGroupOverview({ serviceName }: ErrorGroupOverviewProps) {
export function ErrorGroupOverview({ serviceName }: ErrorGroupOverviewProps) {
const { urlParams, uiFilters } = useUrlParams();
const { start, end, sortField, sortDirection } = urlParams;
const { errorDistributionData } = useErrorGroupDistributionFetcher({
Expand Down Expand Up @@ -68,18 +65,6 @@ function ErrorGroupOverview({ serviceName }: ErrorGroupOverviewProps) {
});
useTrackPageview({ app: 'apm', path: 'error_group_overview', delay: 15000 });

const localUIFiltersConfig = useMemo(() => {
const config: React.ComponentProps<typeof LocalUIFilters> = {
filterNames: ['host', 'containerId', 'podName', 'serviceVersion'],
params: {
serviceName,
},
projection: Projection.errorGroups,
};

return config;
}, [serviceName]);

if (!errorDistributionData || !errorGroupListData) {
return null;
}
Expand All @@ -88,41 +73,34 @@ function ErrorGroupOverview({ serviceName }: ErrorGroupOverviewProps) {
<>
<SearchBar />
<EuiPage>
<EuiFlexGroup>
<EuiFlexItem grow={1}>
<LocalUIFilters {...localUIFiltersConfig} />
</EuiFlexItem>
<EuiFlexItem grow={7}>
<EuiPanel>
<ErrorDistribution
distribution={errorDistributionData}
title={i18n.translate(
'xpack.apm.serviceDetails.metrics.errorOccurrencesChartTitle',
{
defaultMessage: 'Error occurrences',
}
)}
/>
</EuiPanel>
<EuiFlexGroup direction="column" gutterSize="s">
<EuiPanel>
<ErrorDistribution
distribution={errorDistributionData}
title={i18n.translate(
'xpack.apm.serviceDetails.metrics.errorOccurrencesChartTitle',
{
defaultMessage: 'Error occurrences',
}
)}
/>
</EuiPanel>

<EuiSpacer size="s" />
<EuiSpacer size="s" />

<EuiPanel>
<EuiTitle size="xs">
<h3>Errors</h3>
</EuiTitle>
<EuiSpacer size="s" />
<EuiPanel>
<EuiTitle size="xs">
<h3>Errors</h3>
</EuiTitle>
<EuiSpacer size="s" />

<ErrorGroupList
items={errorGroupListData}
serviceName={serviceName}
/>
</EuiPanel>
</EuiFlexItem>
<ErrorGroupList
items={errorGroupListData}
serviceName={serviceName}
/>
</EuiPanel>
</EuiFlexGroup>
</EuiPage>
</>
);
}

export { ErrorGroupOverview };
Loading

0 comments on commit e7acb97

Please sign in to comment.