Skip to content

Commit

Permalink
[APM] New icons for azure and aws architecture (elastic#146406)
Browse files Browse the repository at this point in the history
## Summary

This PR is focusing on closing two tickets elastic#143503 and elastic#143421. There
are a bunch of new icons for AWS and Azure architecture that are being
added and would be visualized as a dependency.

There is also a synthrace scenario added in this PR, which would allow
for a better review of how it would look like. We can use this scenario
for testing more things in the future.




![image](https://user-images.githubusercontent.com/13353203/204303766-ded68f88-d968-4690-bc9e-378638ac155c.png)


![image](https://user-images.githubusercontent.com/13353203/204303800-4c587f3e-9b10-4b45-8e25-f1d1ed85afcd.png)


![image](https://user-images.githubusercontent.com/13353203/204303819-22a35b49-6d62-40be-97b3-5e292571b39b.png)


![image](https://user-images.githubusercontent.com/13353203/204303844-ce465b22-a838-469a-a32e-db18f00acc0a.png)

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
boriskirov and kibanamachine authored Nov 30, 2022
1 parent 858abb8 commit 8382355
Show file tree
Hide file tree
Showing 13 changed files with 404 additions and 11 deletions.
194 changes: 194 additions & 0 deletions packages/kbn-apm-synthtrace/src/scenarios/cloud_services_icons.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { apm, timerange } from '../..';
import { ApmFields } from '../lib/apm/apm_fields';
import { Instance } from '../lib/apm/instance';
import { Scenario } from '../cli/scenario';
import { getLogger } from '../cli/utils/get_common_services';
import { RunOptions } from '../cli/utils/parse_run_cli_flags';
import { getSynthtraceEnvironment } from '../lib/utils/get_synthtrace_environment';

const ENVIRONMENT = getSynthtraceEnvironment(__filename);

const scenario: Scenario<ApmFields> = async (runOptions: RunOptions) => {
const logger = getLogger(runOptions);

const { numServices = 3 } = runOptions.scenarioOpts || {};

return {
generate: ({ from, to }) => {
const range = timerange(from, to);

const transactionName = 'Azure-AWS-Transaction';

const successfulTimestamps = range.ratePerMinute(60);

const instances = [...Array(numServices).keys()].map((index) =>
apm
.service({ name: `synth-java-${index}`, environment: ENVIRONMENT, agentName: 'java' })
.instance('instance')
);
const instanceSpans = (instance: Instance) => {
const successfulTraceEvents = successfulTimestamps.generator((timestamp) =>
instance
.transaction({ transactionName })
.timestamp(timestamp)
.duration(1000)
.success()
.children(
instance
.span({
spanName: 'AWS DynamoDB',
spanType: 'db',
spanSubtype: 'dynamodb',
'service.target.type': 'dynamodb',
'span.destination.service.resource': 'dynamodb',
})
.duration(50)
.success()
.timestamp(timestamp),
instance
.span({
spanName: 'AWS SQS',
spanType: 'messaging',
spanSubtype: 'sqs',
'service.target.type': 'sqs',
'service.target.name': 'queueA',
'span.destination.service.resource': 'sqs/queueA',
})
.duration(50)
.success()
.timestamp(timestamp + 50),
instance
.span({
spanName: 'AWS SQS',
spanType: 'messaging',
spanSubtype: 'sqs',
'service.target.type': 'sqs',
'service.target.name': 'queueB',
'span.destination.service.resource': 'sqs/queueB',
})
.duration(50)
.success()
.timestamp(timestamp + 100),
instance
.span({
spanName: 'AWS SNS',
spanType: 'messaging',
spanSubtype: 'sns',
'service.target.type': 'sns',
'span.destination.service.resource': 'sns',
})
.duration(50)
.success()
.timestamp(timestamp + 150),
instance
.span({
spanName: 'AWS S3',
spanType: 'storage',
spanSubtype: 's3',
'service.target.type': 's3',
'service.target.name': 'bucketA',
'span.destination.service.resource': 's3/bucketA',
})
.duration(50)
.success()
.timestamp(timestamp + 200),
instance
.span({
spanName: 'AWS S3',
spanType: 'storage',
spanSubtype: 's3',
'service.target.type': 's3',
'service.target.name': 'bucketB',
'span.destination.service.resource': 's3/bucketB',
})
.duration(50)
.success()
.timestamp(timestamp + 250),
instance
.span({
spanName: 'Azure CosmosDB',
spanType: 'db',
spanSubtype: 'cosmosdb',
'service.target.type': 'cosmosdb',
'span.destination.service.resource': 'cosmosdb',
})
.duration(50)
.success()
.timestamp(timestamp + 300),
instance
.span({
spanName: 'Azure Queue',
spanType: 'messaging',
spanSubtype: 'azurequeue',
'service.target.type': 'azurequeue',
'span.destination.service.resource': 'azurequeue',
})
.duration(50)
.success()
.timestamp(timestamp + 350),
instance
.span({
spanName: 'Azure Service Bus',
spanType: 'messaging',
spanSubtype: 'azureservicebus',
'service.target.type': 'azureservicebus',
'span.destination.service.resource': 'azureservicebus',
})
.duration(50)
.success()
.timestamp(timestamp + 400),
instance
.span({
spanName: 'Azure Blob',
spanType: 'storage',
spanSubtype: 'azureblob',
'service.target.type': 'azureblob',
'span.destination.service.resource': 'azureblob',
})
.duration(50)
.success()
.timestamp(timestamp + 450),
instance
.span({
spanName: 'Azure File',
spanType: 'storage',
spanSubtype: 'azurefile',
'service.target.type': 'azurefile',
'span.destination.service.resource': 'azurefile',
})
.duration(50)
.success()
.timestamp(timestamp + 500),
instance
.span({
spanName: 'Azure Table',
spanType: 'storage',
spanSubtype: 'azuretable',
'service.target.type': 'azuretable',
'span.destination.service.resource': 'azuretable',
})
.duration(50)
.success()
.timestamp(timestamp + 550)
)
);

return successfulTraceEvents;
};

return instances
.map((instance) => logger.perf('generating_apm_events', () => instanceSpans(instance)))
.reduce((p, c) => p.merge(c));
},
};
};

export default scenario;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import { maybe } from '../../../../common/utils/maybe';
import awsIcon from './icons/aws.svg';
import azureIcon from './icons/azure.svg';
import cassandraIcon from './icons/cassandra.svg';
import databaseIcon from './icons/database.svg';
import defaultIcon from './icons/default.svg';
Expand All @@ -24,6 +23,16 @@ import postgresqlIcon from './icons/postgresql.svg';
import redisIcon from './icons/redis.svg';
import websocketIcon from './icons/websocket.svg';
import javaIcon from '../agent_icon/icons/java.svg';
import dynamodbIcon from './icons/dynamo_db.svg';
import sThreeIcon from './icons/s3.svg';
import snsIcon from './icons/sns.svg';
import sqsIcon from './icons/sqs.svg';
import cosmosDbIcon from './icons/cosmos_db.svg';
import blobStorageIcon from './icons/blob_storage.svg';
import fileShareStorageIcon from './icons/file_share_storage.svg';
import serviceBusIcon from './icons/service_bus.svg';
import storageQueueIcon from './icons/storage_queue.svg';
import tableStorageIcon from './icons/table_storage.svg';

const defaultSpanTypeIcons: { [key: string]: string } = {
cache: databaseIcon,
Expand All @@ -43,8 +52,8 @@ export const spanTypeIcons: {
cache: { redis: redisIcon },
db: {
cassandra: cassandraIcon,
cosmosdb: azureIcon,
dynamodb: awsIcon,
cosmosdb: cosmosDbIcon,
dynamodb: dynamodbIcon,
elasticsearch: elasticsearchIcon,
mongodb: mongodbIcon,
mysql: mysqlIcon,
Expand All @@ -57,18 +66,18 @@ export const spanTypeIcons: {
websocket: websocketIcon,
},
messaging: {
azurequeue: azureIcon,
azureservicebus: azureIcon,
azurequeue: storageQueueIcon,
azureservicebus: serviceBusIcon,
jms: javaIcon,
kafka: kafkaIcon,
sns: awsIcon,
sqs: awsIcon,
sns: snsIcon,
sqs: sqsIcon,
},
storage: {
azureblob: azureIcon,
azurefile: azureIcon,
azuretable: azureIcon,
s3: awsIcon,
azureblob: blobStorageIcon,
azurefile: fileShareStorageIcon,
azuretable: tableStorageIcon,
s3: sThreeIcon,
},
template: {
handlebars: handlebarsIcon,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8382355

Please sign in to comment.