-
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 190343-failing-test-serverless-observability…
…-functional-testsx-packtest_serverlessfunctionaltest_suitesobservabilityobservability_logs_explorerdata_source_selectorts
- Loading branch information
Showing
316 changed files
with
1,797 additions
and
1,191 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
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
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
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
103 changes: 103 additions & 0 deletions
103
packages/kbn-apm-synthtrace-client/src/lib/synthetics/index.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,103 @@ | ||
/* | ||
* 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 { Fields } from '../entity'; | ||
import { Serializable } from '../serializable'; | ||
|
||
export type SyntheticsMonitorDocument = Fields & | ||
Partial<{ | ||
'data_stream.namespace': string; | ||
'data_stream.type': string; | ||
'data_stream.dataset': string; | ||
'monitor.id': string; | ||
'monitor.origin': string; | ||
'monitor.name': string; | ||
'monitor.type': string; | ||
'monitor.check_group': string; | ||
'monitor.timespan.lt': string; | ||
'monitor.timespan.gte': string; | ||
'monitor.duration.us'?: number; | ||
'monitor.ip'?: string; | ||
'monitor.project.name'?: string; | ||
'monitor.project.id'?: string; | ||
'monitor.fleet_managed'?: boolean; | ||
'monitor.status'?: string; | ||
'synthetics.type'?: string; | ||
'synthetics.step.index'?: number; | ||
'observer.os.name'?: string; | ||
'observer.product'?: string; | ||
}>; | ||
|
||
type MonitorDataStream = | ||
| 'http' | ||
| 'tcp' | ||
| 'icmp' | ||
| 'browser' | ||
| 'browser.screenshot' | ||
| 'browser.network'; | ||
|
||
class SyntheticsMonitor extends Serializable<SyntheticsMonitorDocument> { | ||
constructor(fields: SyntheticsMonitorDocument) { | ||
super({ | ||
...fields, | ||
}); | ||
} | ||
|
||
namespace(value: string) { | ||
this.fields['data_stream.namespace'] = value; | ||
return this; | ||
} | ||
|
||
dataset(value: MonitorDataStream) { | ||
this.fields['data_stream.dataset'] = value; | ||
|
||
if (value === 'browser.screenshot' || value === 'browser.network') { | ||
this.fields['monitor.type'] = 'browser'; | ||
return this; | ||
} | ||
|
||
this.fields['monitor.type'] = value; | ||
return this; | ||
} | ||
|
||
name(value: string) { | ||
this.fields['monitor.name'] = value; | ||
return this; | ||
} | ||
|
||
origin(value: string) { | ||
this.fields['monitor.origin'] = value; | ||
return this; | ||
} | ||
|
||
ip(value: string) { | ||
this.fields['monitor.ip'] = value; | ||
return this; | ||
} | ||
|
||
status(value: string) { | ||
this.fields['monitor.status'] = value; | ||
return this; | ||
} | ||
|
||
timestamp(time: number) { | ||
super.timestamp(time); | ||
return this; | ||
} | ||
} | ||
|
||
function create(): SyntheticsMonitor { | ||
return new SyntheticsMonitor({ | ||
'data_stream.namespace': 'default', | ||
'data_stream.type': 'synthetics', | ||
}).dataset('http'); | ||
} | ||
|
||
export const syntheticsMonitor = { | ||
create, | ||
}; |
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
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
33 changes: 33 additions & 0 deletions
33
packages/kbn-apm-synthtrace/src/cli/utils/get_synthetics_es_client.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,33 @@ | ||
/* | ||
* 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 { Client } from '@elastic/elasticsearch'; | ||
import { Logger } from '../../lib/utils/create_logger'; | ||
import { RunOptions } from './parse_run_cli_flags'; | ||
import { getEsClientTlsSettings } from './ssl'; | ||
import { SyntheticsSynthtraceEsClient } from '../../lib/synthetics/synthetics_synthtrace_es_client'; | ||
|
||
export function getSyntheticsEsClient({ | ||
target, | ||
logger, | ||
concurrency, | ||
}: Pick<RunOptions, 'concurrency'> & { | ||
target: string; | ||
logger: Logger; | ||
}) { | ||
const client = new Client({ | ||
node: target, | ||
tls: getEsClientTlsSettings(target), | ||
}); | ||
|
||
return new SyntheticsSynthtraceEsClient({ | ||
client, | ||
logger, | ||
concurrency, | ||
}); | ||
} |
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
Oops, something went wrong.