Skip to content

Commit f3eca5c

Browse files
Merge branch 'master' into licence-management/new_layout
2 parents 99d0014 + 17e264e commit f3eca5c

63 files changed

Lines changed: 696 additions & 575 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

x-pack/plugins/apm/public/components/app/service_inventory/ServiceList/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { fontSizes, px, truncate, unit } from '../../../../style/variables';
2929
import { ManagedTable, ITableColumn } from '../../../shared/ManagedTable';
3030
import { EnvironmentBadge } from '../../../shared/EnvironmentBadge';
3131
import { ServiceOrTransactionsOverviewLink } from '../../../shared/Links/apm/service_transactions_overview_link';
32-
import { AgentIcon } from '../../../shared/AgentIcon';
32+
import { AgentIcon } from '../../../shared/agent_icon';
3333
import { HealthBadge } from './HealthBadge';
3434
import { ServiceListMetric } from './ServiceListMetric';
3535

x-pack/plugins/apm/public/components/app/service_map/__stories__/Cytoscape.stories.tsx

Lines changed: 0 additions & 227 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55
* 2.0.
66
*/
77

8-
import { EuiCard, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
98
import cytoscape from 'cytoscape';
109
import React, { ComponentType } from 'react';
1110
import { EuiThemeProvider } from '../../../../../../../../src/plugins/kibana_react/common';
1211
import { Cytoscape } from '../Cytoscape';
13-
import { iconForNode } from '../icons';
1412
import { Centerer } from './centerer';
1513

1614
export default {
@@ -70,231 +68,6 @@ export function Example() {
7068
);
7169
}
7270

73-
export function NodeIcons() {
74-
const cy = cytoscape();
75-
const elements = [
76-
{ data: { id: 'default' } },
77-
{
78-
data: {
79-
id: 'aws',
80-
'span.type': 'aws',
81-
'span.subtype': 'servicename',
82-
},
83-
},
84-
{ data: { id: 'cache', 'span.type': 'cache' } },
85-
{ data: { id: 'database', 'span.type': 'db' } },
86-
{
87-
data: {
88-
id: 'cassandra',
89-
'span.type': 'db',
90-
'span.subtype': 'cassandra',
91-
},
92-
},
93-
{
94-
data: {
95-
id: 'elasticsearch',
96-
'span.type': 'db',
97-
'span.subtype': 'elasticsearch',
98-
},
99-
},
100-
{
101-
data: {
102-
id: 'mongodb',
103-
'span.type': 'db',
104-
'span.subtype': 'mongodb',
105-
},
106-
},
107-
{
108-
data: {
109-
id: 'mysql',
110-
'span.type': 'db',
111-
'span.subtype': 'mysql',
112-
},
113-
},
114-
{
115-
data: {
116-
id: 'postgresql',
117-
'span.type': 'db',
118-
'span.subtype': 'postgresql',
119-
},
120-
},
121-
{
122-
data: {
123-
id: 'redis',
124-
'span.type': 'db',
125-
'span.subtype': 'redis',
126-
},
127-
},
128-
{ data: { id: 'external', 'span.type': 'external' } },
129-
{ data: { id: 'ext', 'span.type': 'ext' } },
130-
{
131-
data: {
132-
id: 'graphql',
133-
'span.type': 'external',
134-
'span.subtype': 'graphql',
135-
},
136-
},
137-
{
138-
data: {
139-
id: 'grpc',
140-
'span.type': 'external',
141-
'span.subtype': 'grpc',
142-
},
143-
},
144-
{
145-
data: {
146-
id: 'websocket',
147-
'span.type': 'external',
148-
'span.subtype': 'websocket',
149-
},
150-
},
151-
{ data: { id: 'messaging', 'span.type': 'messaging' } },
152-
{
153-
data: {
154-
id: 'jms',
155-
'span.type': 'messaging',
156-
'span.subtype': 'jms',
157-
},
158-
},
159-
{
160-
data: {
161-
id: 'kafka',
162-
'span.type': 'messaging',
163-
'span.subtype': 'kafka',
164-
},
165-
},
166-
{ data: { id: 'template', 'span.type': 'template' } },
167-
{
168-
data: {
169-
id: 'handlebars',
170-
'span.type': 'template',
171-
'span.subtype': 'handlebars',
172-
},
173-
},
174-
{
175-
data: {
176-
id: 'dotnet',
177-
'service.name': 'dotnet service',
178-
'agent.name': 'dotnet',
179-
},
180-
},
181-
{
182-
data: {
183-
id: 'dotNet',
184-
'service.name': 'dotNet service',
185-
'agent.name': 'dotNet',
186-
},
187-
},
188-
{
189-
data: {
190-
id: 'erlang',
191-
'service.name': 'erlang service',
192-
'agent.name': 'erlang',
193-
},
194-
},
195-
{
196-
data: {
197-
id: 'go',
198-
'service.name': 'go service',
199-
'agent.name': 'go',
200-
},
201-
},
202-
{
203-
data: {
204-
id: 'java',
205-
'service.name': 'java service',
206-
'agent.name': 'java',
207-
},
208-
},
209-
{
210-
data: {
211-
id: 'RUM (js-base)',
212-
'service.name': 'RUM service',
213-
'agent.name': 'js-base',
214-
},
215-
},
216-
{
217-
data: {
218-
id: 'RUM (rum-js)',
219-
'service.name': 'RUM service',
220-
'agent.name': 'rum-js',
221-
},
222-
},
223-
{
224-
data: {
225-
id: 'nodejs',
226-
'service.name': 'nodejs service',
227-
'agent.name': 'nodejs',
228-
},
229-
},
230-
{
231-
data: {
232-
id: 'ocaml',
233-
'service.name': 'ocaml service',
234-
'agent.name': 'ocaml',
235-
},
236-
},
237-
{
238-
data: {
239-
id: 'opentelemetry',
240-
'service.name': 'OpenTelemetry service',
241-
'agent.name': 'otlp',
242-
},
243-
},
244-
{
245-
data: {
246-
id: 'php',
247-
'service.name': 'php service',
248-
'agent.name': 'php',
249-
},
250-
},
251-
{
252-
data: {
253-
id: 'python',
254-
'service.name': 'python service',
255-
'agent.name': 'python',
256-
},
257-
},
258-
{
259-
data: {
260-
id: 'ruby',
261-
'service.name': 'ruby service',
262-
'agent.name': 'ruby',
263-
},
264-
},
265-
];
266-
cy.add(elements);
267-
268-
return (
269-
<EuiFlexGroup gutterSize="l" wrap={true}>
270-
{cy.nodes().map((node) => (
271-
<EuiFlexItem key={node.data('id')}>
272-
<EuiCard
273-
description={
274-
<code style={{ textAlign: 'left', whiteSpace: 'nowrap' }}>
275-
agent.name: {node.data('agent.name') || 'undefined'}
276-
<br />
277-
span.type: {node.data('span.type') || 'undefined'}
278-
<br />
279-
span.subtype: {node.data('span.subtype') || 'undefined'}
280-
</code>
281-
}
282-
icon={
283-
<img
284-
alt={node.data('label')}
285-
src={iconForNode(node)}
286-
height={80}
287-
width={80}
288-
/>
289-
}
290-
title={node.data('id')}
291-
/>
292-
</EuiFlexItem>
293-
))}
294-
</EuiFlexGroup>
295-
);
296-
}
297-
29871
export function NodeHealthStatus() {
29972
const elements = [
30073
{

x-pack/plugins/apm/public/components/app/service_map/icons.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
SPAN_SUBTYPE,
1212
SPAN_TYPE,
1313
} from '../../../../common/elasticsearch_fieldnames';
14-
import { getAgentIcon } from '../../shared/AgentIcon/get_agent_icon';
14+
import { getAgentIcon } from '../../shared/agent_icon/get_agent_icon';
1515
import { getSpanIcon } from '../../shared/span_icon/get_span_icon';
1616

1717
export function iconForNode(node: cytoscape.NodeSingular) {

x-pack/plugins/apm/public/components/app/service_overview/service_overview_dependencies_table/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import { ServiceDependencyItem } from '../../../../../server/lib/services/get_se
2828
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
2929
import { FETCH_STATUS, useFetcher } from '../../../../hooks/use_fetcher';
3030
import { px, unit } from '../../../../style/variables';
31-
import { AgentIcon } from '../../../shared/AgentIcon';
31+
import { AgentIcon } from '../../../shared/agent_icon';
3232
import { SparkPlot } from '../../../shared/charts/spark_plot';
3333
import { ImpactBar } from '../../../shared/ImpactBar';
3434
import { ServiceMapLink } from '../../../shared/Links/apm/ServiceMapLink';

x-pack/plugins/apm/public/components/app/service_overview/service_overview_instances_table/intance_details.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { FETCH_STATUS } from '../../../../hooks/use_fetcher';
2929
import { useTheme } from '../../../../hooks/use_theme';
3030
import { APIReturnType } from '../../../../services/rest/createCallApmApi';
3131
import { pct } from '../../../../style/variables';
32-
import { getAgentIcon } from '../../../shared/AgentIcon/get_agent_icon';
32+
import { getAgentIcon } from '../../../shared/agent_icon/get_agent_icon';
3333
import { KeyValueFilterList } from '../../../shared/key_value_filter_list';
3434
import { pushNewItemToKueryBar } from '../../../shared/KueryBar/utils';
3535
import { getCloudIcon, getContainerIcon } from '../../../shared/service_icons';
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0; you may not use this file except in compliance with the Elastic License
5+
* 2.0.
6+
*/
7+
8+
import {
9+
EuiCard,
10+
EuiFlexGroup,
11+
EuiImage,
12+
EuiFlexItem,
13+
EuiSpacer,
14+
EuiToolTip,
15+
EuiCodeBlock,
16+
} from '@elastic/eui';
17+
import React, { ComponentType } from 'react';
18+
import { AgentIcon } from './index';
19+
import { EuiThemeProvider } from '../../../../../../../src/plugins/kibana_react/common';
20+
import { AGENT_NAMES } from '../../../../common/agent_name';
21+
import { getAgentIcon } from './get_agent_icon';
22+
import { useTheme } from '../../../hooks/use_theme';
23+
24+
export default {
25+
title: 'shared/icons',
26+
component: AgentIcon,
27+
decorators: [
28+
(Story: ComponentType) => (
29+
<EuiThemeProvider>
30+
<Story />
31+
</EuiThemeProvider>
32+
),
33+
],
34+
};
35+
36+
export function AgentIcons() {
37+
const theme = useTheme();
38+
39+
return (
40+
<>
41+
<EuiCodeBlock language="html" isCopyable paddingSize="m">
42+
{'<AgentIcon agentName="dotnet" />'}
43+
</EuiCodeBlock>
44+
45+
<EuiSpacer />
46+
47+
<EuiFlexGroup gutterSize="l" wrap={true}>
48+
{AGENT_NAMES.map((agentName) => {
49+
return (
50+
<EuiFlexItem key={agentName} grow={false}>
51+
<EuiCard
52+
icon={
53+
<>
54+
<p>
55+
<EuiToolTip
56+
position="top"
57+
content="Icon rendered with `EuiImage`"
58+
>
59+
<EuiImage
60+
size="s"
61+
hasShadow
62+
alt={agentName}
63+
src={getAgentIcon(agentName, theme.darkMode)}
64+
/>
65+
</EuiToolTip>
66+
</p>
67+
</>
68+
}
69+
title={agentName}
70+
description={
71+
<div>
72+
<EuiToolTip
73+
position="bottom"
74+
content="Icon rendered with `AgentIcon`"
75+
>
76+
<AgentIcon agentName={agentName} />
77+
</EuiToolTip>
78+
</div>
79+
}
80+
/>
81+
</EuiFlexItem>
82+
);
83+
})}
84+
</EuiFlexGroup>
85+
</>
86+
);
87+
}

x-pack/plugins/apm/public/components/shared/AgentIcon/get_agent_icon.test.ts renamed to x-pack/plugins/apm/public/components/shared/agent_icon/get_agent_icon.test.ts

File renamed without changes.

x-pack/plugins/apm/public/components/shared/AgentIcon/get_agent_icon.ts renamed to x-pack/plugins/apm/public/components/shared/agent_icon/get_agent_icon.ts

File renamed without changes.

x-pack/plugins/apm/public/components/shared/AgentIcon/icons/dot-net.svg renamed to x-pack/plugins/apm/public/components/shared/agent_icon/icons/dot-net.svg

File renamed without changes.

x-pack/plugins/apm/public/components/shared/AgentIcon/icons/erlang.svg renamed to x-pack/plugins/apm/public/components/shared/agent_icon/icons/erlang.svg

File renamed without changes.

0 commit comments

Comments
 (0)