-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into serverless-role-selector
- Loading branch information
Showing
189 changed files
with
1,941 additions
and
1,251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
153 changes: 153 additions & 0 deletions
153
packages/kbn-apm-synthtrace/src/scenarios/trace_with_orphan_items.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
/* | ||
* 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, ApmFields, httpExitSpan, Serializable } from '@kbn/apm-synthtrace-client'; | ||
import { Readable } from 'stream'; | ||
import { Scenario } from '../cli/scenario'; | ||
|
||
import { RunOptions } from '../cli/utils/parse_run_cli_flags'; | ||
import { getSynthtraceEnvironment } from '../lib/utils/get_synthtrace_environment'; | ||
import { withClient } from '../lib/utils/with_client'; | ||
|
||
const ENVIRONMENT = getSynthtraceEnvironment(__filename); | ||
|
||
const scenario: Scenario<ApmFields> = async (runOptions: RunOptions) => { | ||
return { | ||
generate: ({ range, clients: { apmEsClient } }) => { | ||
const transactionName = 'trace with orphans'; | ||
const successfulTimestamps = range.interval('1s').rate(3); | ||
|
||
const synthRum = apm | ||
.service({ name: 'synth-rum', environment: ENVIRONMENT, agentName: 'rum-js' }) | ||
.instance('my-instance'); | ||
const synthNode = apm | ||
.service({ name: 'synth-node', environment: ENVIRONMENT, agentName: 'nodejs' }) | ||
.instance('my-instance'); | ||
const synthGo = apm | ||
.service({ name: 'synth-go', environment: ENVIRONMENT, agentName: 'go' }) | ||
.instance('my-instance'); | ||
|
||
const traces = successfulTimestamps.generator((timestamp) => { | ||
// synth-rum | ||
return synthGo | ||
.transaction({ transactionName }) | ||
.duration(400) | ||
.timestamp(timestamp) | ||
.children( | ||
// synth-rum -> synth-node | ||
synthRum | ||
.span( | ||
httpExitSpan({ | ||
spanName: 'GET /api/products/top', | ||
destinationUrl: 'http://synth-node:3000', | ||
}) | ||
) | ||
.duration(300) | ||
.timestamp(timestamp) | ||
.children( | ||
synthRum | ||
.transaction({ transactionName: 'Child Transaction' }) | ||
.timestamp(timestamp) | ||
.duration(200) | ||
.children( | ||
synthGo | ||
.span({ spanName: 'custom_operation', spanType: 'custom' }) | ||
.timestamp(timestamp) | ||
.duration(100) | ||
.success() | ||
), | ||
// synth-node | ||
synthNode | ||
.transaction({ transactionName: 'Initial transaction in synth-node' }) | ||
.duration(300) | ||
.timestamp(timestamp) | ||
.children( | ||
synthNode | ||
// synth-node -> synth-go | ||
.span( | ||
httpExitSpan({ | ||
spanName: 'GET synth-go:3000', | ||
destinationUrl: 'http://synth-go:3000', | ||
}) | ||
) | ||
.timestamp(timestamp) | ||
.duration(400) | ||
|
||
.children( | ||
// synth-go | ||
synthGo | ||
.transaction({ transactionName: 'Child Transaction' }) | ||
.timestamp(timestamp) | ||
.duration(200) | ||
.children( | ||
synthGo | ||
.span({ spanName: 'custom_operation', spanType: 'custom' }) | ||
.timestamp(timestamp) | ||
.duration(100) | ||
.success(), | ||
synthGo | ||
.span({ spanName: 'custom_new_operation', spanType: 'custom' }) | ||
.timestamp(timestamp) | ||
.duration(100) | ||
.success() | ||
) | ||
) | ||
) | ||
) | ||
); | ||
}); | ||
|
||
const successfulTraceEvents = Array.from( | ||
successfulTimestamps.generator((timestamp) => | ||
synthNode | ||
.transaction({ transactionName: 'successful trace' }) | ||
.timestamp(timestamp) | ||
.duration(1000) | ||
.success() | ||
.children( | ||
synthNode | ||
.span({ | ||
spanName: 'GET apm-*/_search', | ||
spanType: 'db', | ||
spanSubtype: 'elasticsearch', | ||
}) | ||
.duration(1000) | ||
.success() | ||
.destination('elasticsearch') | ||
.timestamp(timestamp), | ||
synthNode | ||
.span({ spanName: 'custom_operation', spanType: 'custom' }) | ||
.duration(100) | ||
.success() | ||
.timestamp(timestamp) | ||
) | ||
) | ||
); | ||
|
||
const unserialized = Array.from(traces); | ||
|
||
const serialized = unserialized | ||
.flatMap((event) => event.serialize()) | ||
.filter((trace) => trace['transaction.name'] !== 'Child Transaction'); | ||
|
||
const unserializedChanged = serialized.map((event) => ({ | ||
fields: event, | ||
serialize: () => { | ||
return [event]; | ||
}, | ||
})) as Array<Serializable<ApmFields>>; | ||
|
||
return withClient( | ||
apmEsClient, | ||
Readable.from([...unserializedChanged, ...successfulTraceEvents]) | ||
); | ||
}, | ||
}; | ||
}; | ||
|
||
export default scenario; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export * from './src/constants'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
module.exports = require('@kbn/storybook').defaultConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# @kbn/custom-icons | ||
|
||
A utility package, `@kbn/custom-icons`, that provides components for rendering icons related to Elastic Agents, Cloud Providers and more. | ||
|
||
## Components | ||
|
||
### `<AgentIcon />` | ||
|
||
```jsx | ||
<AgentIcon agentName={agentName} /> | ||
``` | ||
|
||
This component renders an icon corresponding to the specified Elastic Agent name (`agentName`). | ||
|
||
#### Props | ||
|
||
- **`agentName`**: The name of the Elastic Agent for which the icon should be rendered. | ||
|
||
### `<CloudProviderIcon />` | ||
|
||
```jsx | ||
<CloudProviderIcon cloudProvider={cloudProvider} /> | ||
``` | ||
|
||
This component renders an icon associated with the specified Cloud Provider (`cloudProvider`). | ||
|
||
#### Props | ||
|
||
- **`cloudProvider`**: The name of the Cloud Provider for which the icon should be rendered. |
File renamed without changes
File renamed without changes
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* 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. | ||
*/ | ||
export { getAgentIcon } from './src/components/agent_icon/get_agent_icon'; | ||
export { getServerlessIcon } from './src/components/agent_icon/get_serverless_icon'; | ||
export { AgentIcon } from './src/components/agent_icon'; | ||
export type { AgentIconProps } from './src/components/agent_icon'; | ||
|
||
export { getCloudProviderIcon } from './src/components/cloud_provider_icon/get_cloud_provider_icon'; | ||
export type { CloudProvider } from './src/components/cloud_provider_icon/get_cloud_provider_icon'; | ||
export { CloudProviderIcon } from './src/components/cloud_provider_icon'; | ||
export type { CloudProviderIconProps } from './src/components/cloud_provider_icon'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
module.exports = { | ||
preset: '@kbn/test', | ||
rootDir: '../..', | ||
roots: ['<rootDir>/packages/kbn-custom-icons'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"type": "shared-common", | ||
"id": "@kbn/custom-icons", | ||
"owner": "@elastic/obs-ux-logs-team" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "@kbn/custom-icons", | ||
"private": true, | ||
"version": "1.0.0", | ||
"license": "SSPL-1.0 OR Elastic License 2.0", | ||
"sideEffects": false | ||
} |
Oops, something went wrong.