Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions x-pack/plugins/apm/common/constants.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/

import { get } from 'lodash';
import { Span } from '../typings/Span';
import { Transaction } from '../typings/Transaction';
import { Span } from '../typings/es_schemas/Span';
import { Transaction } from '../typings/es_schemas/Transaction';
import * as constants from './constants';

describe('Transaction v1:', () => {
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -919,8 +919,7 @@
"version": "7.0.0-alpha1"
}
},
"occurrencesCount": 18,
"groupId": "c00e245c2fbebaf178fc31eeb2bb0250"
"occurrencesCount": 18
},
"status": "SUCCESS"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ function DetailView({ errorGroup, urlParams, location }) {
return null;
}

const { serviceName } = urlParams;
const stickyProperties = [
{
fieldName: '@timestamp',
Expand Down Expand Up @@ -129,7 +128,6 @@ function DetailView({ errorGroup, urlParams, location }) {
const tabs = getTabs(context, logStackframes);
const currentTab = getCurrentTab(tabs, urlParams.detailTab);
const occurencesCount = errorGroup.data.occurrencesCount;
const groupId = errorGroup.data.groupId;
const agentName = get(errorGroup.data.error, SERVICE_AGENT_NAME);

return (
Expand All @@ -143,8 +141,7 @@ function DetailView({ errorGroup, urlParams, location }) {
Error occurrence
</HeaderMedium>
<DiscoverErrorButton
serviceName={serviceName}
groupId={groupId}
error={errorGroup.data.error}
kuery={urlParams.kuery}
>
<EuiButtonEmpty iconType="discoverApp">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from '@elastic/eui';
import React from 'react';
import { KibanaLink } from 'x-pack/plugins/apm/public/utils/url';
import { Transaction } from 'x-pack/plugins/apm/typings/Transaction';
import { Transaction } from 'x-pack/plugins/apm/typings/es_schemas/Transaction';
import { DiscoverTransactionButton } from '../../../shared/DiscoverButtons/DiscoverTransactionButton';

function getInfraMetricsQuery(transaction: Transaction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
TRANSACTION_RESULT,
USER_ID
} from '../../../../../common/constants';
import { Transaction } from '../../../../../typings/Transaction';
import { Transaction } from '../../../../../typings/es_schemas/Transaction';
import { asPercent, asTime } from '../../../../utils/formatters';
// @ts-ignore
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import { capitalize, first, get } from 'lodash';
import React from 'react';
import styled from 'styled-components';
import { Transaction } from '../../../../../typings/Transaction';
import { Transaction } from '../../../../../typings/es_schemas/Transaction';
import { IUrlParams } from '../../../../store/urlParams';
import { px, units } from '../../../../style/variables';
import { fromQuery, history, toQuery } from '../../../../utils/url';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { EuiSpacer, EuiTab, EuiTabs } from '@elastic/eui';
import { capitalize, first, get } from 'lodash';
import React from 'react';
import { Transaction } from '../../../../../typings/Transaction';
import { Transaction } from '../../../../../typings/es_schemas/Transaction';
import { IUrlParams } from '../../../../store/urlParams';
// @ts-ignore
import { fromQuery, history, toQuery } from '../../../../utils/url';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { StickyProperties } from 'x-pack/plugins/apm/public/components/shared/StickyProperties';
import { TransactionLink } from 'x-pack/plugins/apm/public/components/shared/TransactionLink';
import { KibanaLink } from 'x-pack/plugins/apm/public/utils/url';
import { Transaction } from 'x-pack/plugins/apm/typings/Transaction';
import { Transaction } from 'x-pack/plugins/apm/typings/es_schemas/Transaction';

interface Props {
transaction?: Transaction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { xcode } from 'react-syntax-highlighter/dist/styles';
import sql from 'react-syntax-highlighter/dist/languages/sql';

import { EuiTitle } from '@elastic/eui';
import { DbContext } from '../../../../../../../../typings/Span';
import { DbContext } from '../../../../../../../../typings/es_schemas/Span';

registerLanguage('sql', sql);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
} from '../../../../../../../style/variables';

import { EuiTitle } from '@elastic/eui';
import { HttpContext } from '../../../../../../../../typings/Span';
import { HttpContext } from '../../../../../../../../typings/es_schemas/Span';

const DatabaseStatement = styled.div`
margin-top: ${px(unit)};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
SPAN_NAME,
SPAN_TYPE
} from 'x-pack/plugins/apm/common/constants';
import { Span } from '../../../../../../../../typings/Span';
import { Span } from '../../../../../../../../typings/es_schemas/Span';
import { asMillis, asPercent } from '../../../../../../../utils/formatters';
import { StickyProperties } from '../../../../../../shared/StickyProperties';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import { HttpContext } from './HttpContext';
import { StickySpanProperties } from './StickySpanProperties';

import { DiscoverSpanButton } from 'x-pack/plugins/apm/public/components/shared/DiscoverButtons/DiscoverSpanButton';
import { Transaction } from 'x-pack/plugins/apm/typings/Transaction';
import { Span } from '../../../../../../../../typings/Span';
import { Transaction } from 'x-pack/plugins/apm/typings/es_schemas/Transaction';
import { Span } from '../../../../../../../../typings/es_schemas/Span';
import { FlyoutTopLevelProperties } from '../FlyoutTopLevelProperties';

const StackTraceContainer = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import styled from 'styled-components';
import { DiscoverTransactionButton } from 'x-pack/plugins/apm/public/components/shared/DiscoverButtons/DiscoverTransactionButton';
import { IUrlParams } from 'x-pack/plugins/apm/public/store/urlParams';
import { APM_AGENT_DROPPED_SPANS_DOCS } from 'x-pack/plugins/apm/public/utils/documentation/agents';
import { Transaction } from 'x-pack/plugins/apm/typings/Transaction';
import { Transaction } from 'x-pack/plugins/apm/typings/es_schemas/Transaction';
import { StickyTransactionProperties } from '../../../StickyTransactionProperties';
import { TransactionPropertiesTableForFlyout } from '../../../TransactionPropertiesTableForFlyout';
import { FlyoutTopLevelProperties } from '../FlyoutTopLevelProperties';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/

import { groupBy } from 'lodash';
import { Span } from 'x-pack/plugins/apm/typings/Span';
import { Transaction } from 'x-pack/plugins/apm/typings/Transaction';
import { Span } from 'x-pack/plugins/apm/typings/es_schemas/Span';
import { Transaction } from 'x-pack/plugins/apm/typings/es_schemas/Transaction';
import {
getClockSkew,
getWaterfallItems,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import {
zipObject
} from 'lodash';
import { colors } from 'x-pack/plugins/apm/public/style/variables';
import { Span } from '../../../../../../../../typings/Span';
import { Transaction } from '../../../../../../../../typings/Transaction';
import { Span } from '../../../../../../../../typings/es_schemas/Span';
import { Transaction } from '../../../../../../../../typings/es_schemas/Transaction';

export interface IWaterfallIndex {
[key: string]: IWaterfallItem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { Transaction } from 'x-pack/plugins/apm/typings/Transaction';
import { Transaction } from 'x-pack/plugins/apm/typings/es_schemas/Transaction';
import { getAgentMarks } from './get_agent_marks';

describe('getAgentMarks', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { sortBy } from 'lodash';
import { Transaction } from 'x-pack/plugins/apm/typings/Transaction';
import { Transaction } from 'x-pack/plugins/apm/typings/es_schemas/Transaction';

export interface AgentMark {
name: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
TRACE_ID,
TRANSACTION_ID
} from '../../../../../../common/constants';
import { Transaction } from '../../../../../../typings/Transaction';
import { Transaction } from '../../../../../../typings/es_schemas/Transaction';

import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/eui';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
EuiToolTip
} from '@elastic/eui';
import React from 'react';
import { Transaction as ITransaction } from '../../../../../typings/Transaction';
import { Transaction as ITransaction } from '../../../../../typings/es_schemas/Transaction';
import { IUrlParams } from '../../../../store/urlParams';
import { DiscoverTransactionButton } from '../../../shared/DiscoverButtons/DiscoverTransactionButton';
import { TransactionLink } from '../../../shared/TransactionLink';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import python from 'react-syntax-highlighter/dist/languages/python';
import ruby from 'react-syntax-highlighter/dist/languages/ruby';
// @ts-ignore
import { registerLanguage } from 'react-syntax-highlighter/dist/light';
import { Stackframe } from '../../../../typings/APMDoc';
import { Stackframe } from '../../../../typings/es_schemas/APMDoc';
import { FrameHeading } from '../Stacktrace/FrameHeading';
// @ts-ignore
import { Context } from './Context';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ import {
ERROR_GROUP_ID,
SERVICE_NAME
} from 'x-pack/plugins/apm/common/constants';
import { APMError } from 'x-pack/plugins/apm/typings/es_schemas/Error';
import { DiscoverButton } from './DiscoverButton';

function getDiscoverQuery(serviceName: string, groupId: string, kuery: string) {
function getDiscoverQuery(error: APMError, kuery: string) {
const serviceName = error.context.service.name;
const groupId = error.error.grouping_key;
let query = `${SERVICE_NAME}:"${serviceName}" AND ${ERROR_GROUP_ID}:"${groupId}"`;
if (kuery) {
query = ` AND ${kuery}`;
Expand All @@ -30,13 +33,12 @@ function getDiscoverQuery(serviceName: string, groupId: string, kuery: string) {
}

export const DiscoverErrorButton: React.SFC<{
readonly serviceName: string;
readonly groupId: string;
readonly error: APMError;
readonly kuery: string;
}> = ({ serviceName, groupId, kuery, children }) => {
}> = ({ error, kuery, children }) => {
return (
<DiscoverButton
query={getDiscoverQuery(serviceName, groupId, kuery)}
query={getDiscoverQuery(error, kuery)}
children={children}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import React from 'react';
import { SPAN_HEX_ID, SPAN_ID } from 'x-pack/plugins/apm/common/constants';
import { Span } from 'x-pack/plugins/apm/typings/Span';
import { Span } from 'x-pack/plugins/apm/typings/es_schemas/Span';
import { DiscoverButton } from './DiscoverButton';

function getDiscoverQuery(span: Span) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
TRACE_ID,
TRANSACTION_ID
} from 'x-pack/plugins/apm/common/constants';
import { Transaction } from 'x-pack/plugins/apm/typings/Transaction';
import { Transaction } from 'x-pack/plugins/apm/typings/es_schemas/Transaction';
import { DiscoverButton } from './DiscoverButton';

function getDiscoverQuery(transaction: Transaction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { get } from 'lodash';
import React, { Fragment } from 'react';
import styled from 'styled-components';
import { Stackframe } from '../../../../typings/APMDoc';
import { Stackframe } from '../../../../typings/es_schemas/APMDoc';
import { colors, fontFamilyCode, px, units } from '../../../style/variables';

const FileDetails = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { EuiLink } from '@elastic/eui';
import React from 'react';
import styled from 'styled-components';
import { Stackframe } from '../../../../typings/APMDoc';
import { Stackframe } from 'x-pack/plugins/apm/typings/es_schemas/APMDoc';
import { px, units } from '../../../style/variables';
import { CodePreview } from '../../shared/CodePreview';
// @ts-ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { Stackframe } from '../../../../../typings/APMDoc';
import { Stackframe } from '../../../../../typings/es_schemas/APMDoc';
import { getGroupedStackframes, hasSourceLines } from '../stacktraceUtils';
import stacktracesMock from './stacktraces.json';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { EuiTitle } from '@elastic/eui';
import { isEmpty } from 'lodash';
import React, { PureComponent } from 'react';
import { Stackframe } from '../../../../typings/APMDoc';
import { Stackframe } from '../../../../typings/es_schemas/APMDoc';
import { CodePreview } from '../../shared/CodePreview';
import { EmptyMessage } from '../../shared/EmptyMessage';
// @ts-ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { get, isEmpty } from 'lodash';
import { Stackframe } from '../../../../typings/APMDoc';
import { Stackframe } from 'x-pack/plugins/apm/typings/es_schemas/APMDoc';

interface StackframesGroup {
isLibraryFrame: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import React from 'react';
import { Transaction } from '../../../typings/Transaction';
import { Transaction } from '../../../typings/es_schemas/Transaction';
import { KibanaLink, legacyEncodeURIComponent } from '../../utils/url';

interface TransactionLinkProps {
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/apm/public/services/rest/apm/apm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { Span } from 'x-pack/plugins/apm/typings/Span';
import { Transaction } from 'x-pack/plugins/apm/typings/Transaction';
import { Span } from 'x-pack/plugins/apm/typings/es_schemas/Span';
import { Transaction } from 'x-pack/plugins/apm/typings/es_schemas/Transaction';
import { convertKueryToEsQuery, getAPMIndexPatternForKuery } from '../../kuery';

export async function getEncodedEsQuery(kuery?: string) {
Expand Down
16 changes: 6 additions & 10 deletions x-pack/plugins/apm/public/services/rest/apm/error_groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { camelizeKeys } from 'humps';
import { ErrorDistributionAPIResponse } from 'x-pack/plugins/apm/server/lib/errors/distribution/get_distribution';
import { ErrorGroupAPIResponse } from 'x-pack/plugins/apm/server/lib/errors/get_error_group';
import { ErrorGroupListAPIResponse } from 'x-pack/plugins/apm/server/lib/errors/get_error_groups';
import { IUrlParams } from '../../../store/urlParams';
import { callApi } from '../callApi';
import { getEncodedEsQuery } from './apm';
Expand All @@ -24,7 +26,7 @@ export async function loadErrorGroupList({
sortField,
sortDirection
}: ErrorGroupListParams) {
return callApi({
return callApi<ErrorGroupListAPIResponse>({
pathname: `/api/apm/services/${serviceName}/errors`,
query: {
start,
Expand All @@ -44,8 +46,7 @@ export async function loadErrorGroupDetails({
kuery,
errorGroupId
}: IUrlParams) {
// TODO: add types when error section is converted to ts
const res = await callApi<any>(
return callApi<ErrorGroupAPIResponse>(
{
pathname: `/api/apm/services/${serviceName}/errors/${errorGroupId}`,
query: {
Expand All @@ -58,11 +59,6 @@ export async function loadErrorGroupDetails({
camelcase: false
}
);
const camelizedRes: any = camelizeKeys(res);
if (res.error.context) {
camelizedRes.error.context = res.error.context;
}
return camelizedRes;
}

export async function loadErrorDistribution({
Expand All @@ -72,7 +68,7 @@ export async function loadErrorDistribution({
kuery,
errorGroupId
}: IUrlParams) {
return callApi({
return callApi<ErrorDistributionAPIResponse>({
pathname: `/api/apm/services/${serviceName}/errors/${errorGroupId}/distribution`,
query: {
start,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { TransactionAPIResponse } from 'x-pack/plugins/apm/server/lib/transactions/get_transaction';
import { SpanListAPIResponse } from 'x-pack/plugins/apm/server/lib/transactions/spans/get_spans';
import { Span } from 'x-pack/plugins/apm/typings/Span';
import { Span } from 'x-pack/plugins/apm/typings/es_schemas/Span';
import { IUrlParams } from '../../../store/urlParams';
import { callApi } from '../callApi';
import { addVersion, getEncodedEsQuery } from './apm';
Expand Down
Loading