Skip to content

Commit

Permalink
[APM] Change dropped spans link (#27981)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenlouv authored Jan 9, 2019
1 parent a40806e commit 68a7cbd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import React from 'react';
import styled from 'styled-components';
import { TransactionActionMenu } from 'x-pack/plugins/apm/public/components/shared/TransactionActionMenu/TransactionActionMenu';
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 { DROPPED_SPANS_DOCS } from 'x-pack/plugins/apm/public/utils/documentation/apm-get-started';
import { Transaction } from 'x-pack/plugins/apm/typings/es_schemas/Transaction';
import { StickyTransactionProperties } from '../../../StickyTransactionProperties';
import { TransactionPropertiesTableForFlyout } from '../../../TransactionPropertiesTableForFlyout';
Expand Down Expand Up @@ -71,20 +71,14 @@ function DroppedSpansWarning({
return null;
}

const url =
APM_AGENT_DROPPED_SPANS_DOCS[transactionDoc.context.service.agent.name];

const docsLink = url ? (
<EuiLink href={url} target="_blank">
Learn more.
</EuiLink>
) : null;

return (
<React.Fragment>
<EuiCallOut size="s">
The APM agent that reported this transaction dropped {dropped} spans or
more based on its configuration. {docsLink}
more based on its configuration.{' '}
<EuiLink href={DROPPED_SPANS_DOCS} target="_blank">
Learn more about dropped spans.
</EuiLink>
</EuiCallOut>
<EuiHorizontalRule />
</React.Fragment>
Expand Down
5 changes: 0 additions & 5 deletions x-pack/plugins/apm/public/utils/documentation/agents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ interface AgentNamedValues {
[agentName: string]: string;
}

export const APM_AGENT_DROPPED_SPANS_DOCS: AgentNamedValues = {
nodejs: `${AGENT_URL_ROOT}/nodejs/1.x/agent-api.html#transaction-max-spans`,
python: `${AGENT_URL_ROOT}/python/2.x/configuration.html#config-transaction-max-spans`
};

const APM_AGENT_FEATURE_DOCS: {
[featureName: string]: AgentNamedValues;
} = {
Expand Down
11 changes: 11 additions & 0 deletions x-pack/plugins/apm/public/utils/documentation/apm-get-started.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

// @ts-ignore
import { metadata } from 'ui/metadata';
const STACK_VERSION = metadata.branch;

export const DROPPED_SPANS_DOCS = `https://www.elastic.co/guide/en/apm/get-started/${STACK_VERSION}/transaction-spans.html#dropped-spans`;

0 comments on commit 68a7cbd

Please sign in to comment.