Skip to content

Commit

Permalink
[APM] Uses doc link service instead of ElasticDocsLink for linking dr…
Browse files Browse the repository at this point in the history
…opped transaction spans (#110964)
  • Loading branch information
szabosteve authored Sep 6, 2021
1 parent b97afb2 commit 705fe22
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ readonly links: {
readonly apm: {
readonly kibanaSettings: string;
readonly supportedServiceMaps: string;
readonly droppedTransactionSpans: string;
readonly upgrading: string;
readonly metaData: string;
};
Expand Down
2 changes: 2 additions & 0 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class DocLinksService {
apm: {
kibanaSettings: `${KIBANA_DOCS}apm-settings-in-kibana.html`,
supportedServiceMaps: `${KIBANA_DOCS}service-maps.html#service-maps-supported`,
droppedTransactionSpans: `${APM_DOCS}get-started/${DOC_LINK_VERSION}/transaction-spans.html#dropped-spans`,
upgrading: `${APM_DOCS}server/${DOC_LINK_VERSION}/upgrading.html`,
metaData: `${APM_DOCS}get-started/${DOC_LINK_VERSION}/metadata.html`,
},
Expand Down Expand Up @@ -461,6 +462,7 @@ export interface DocLinksStart {
readonly apm: {
readonly kibanaSettings: string;
readonly supportedServiceMaps: string;
readonly droppedTransactionSpans: string;
readonly upgrading: string;
readonly metaData: string;
};
Expand Down
1 change: 1 addition & 0 deletions src/core/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ export interface DocLinksStart {
readonly apm: {
readonly kibanaSettings: string;
readonly supportedServiceMaps: string;
readonly droppedTransactionSpans: string;
readonly upgrading: string;
readonly metaData: string;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@
* 2.0.
*/

import { EuiCallOut, EuiHorizontalRule } from '@elastic/eui';
import { EuiCallOut, EuiHorizontalRule, EuiLink } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React from 'react';
import { Transaction } from '../../../../../../../../typings/es_schemas/ui/transaction';
import { ElasticDocsLink } from '../../../../../../shared/Links/ElasticDocsLink';
import { useApmPluginContext } from '../../../../../../../context/apm_plugin/use_apm_plugin_context';

export function DroppedSpansWarning({
transactionDoc,
}: {
transactionDoc: Transaction;
}) {
const { docLinks } = useApmPluginContext().core;
const dropped = transactionDoc.transaction.span_count?.dropped;
if (!dropped) {
return null;
Expand All @@ -32,18 +33,14 @@ export function DroppedSpansWarning({
values: { dropped },
}
)}{' '}
<ElasticDocsLink
section="/apm/get-started"
path="/transaction-spans.html#dropped-spans"
target="_blank"
>
<EuiLink href={docLinks.links.apm.droppedTransactionSpans}>
{i18n.translate(
'xpack.apm.transactionDetails.transFlyout.callout.learnMoreAboutDroppedSpansLinkText',
{
defaultMessage: 'Learn more about dropped spans.',
}
)}
</ElasticDocsLink>
</EuiLink>
</EuiCallOut>
<EuiHorizontalRule />
</React.Fragment>
Expand Down

0 comments on commit 705fe22

Please sign in to comment.