forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[APM] Add table search to services, transactions and errors (elastic#…
…174490) Closes: elastic#127036 This adds the ability to easily search for data in tables. The search will be performed server side if there are more results than initially returned by Elasticsearch. If all results were returned the search is performed client side to provide a more snappy experience. The feature is guarded by a feature flag (disabled by default) and only available for services, transactions and errors table. # Transactions ![quick-filtering](https://github.com/elastic/kibana/assets/209966/20684b88-a103-4000-a012-ee6e35479b44) # Errors ![error3](https://github.com/elastic/kibana/assets/209966/c7f09dd9-24a5-482a-ae72-4c4477f65d3a) **Dependencies:** - elastic#173973 - elastic#174746 - elastic#174750 --------- Co-authored-by: Caue Marcondes <caue.marcondes@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
0ecba9b
commit 4e6c910
Showing
65 changed files
with
1,778 additions
and
1,520 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
42 changes: 42 additions & 0 deletions
42
packages/kbn-apm-synthtrace/src/scenarios/helpers/exception_types.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,42 @@ | ||
/* | ||
* 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 const exceptionTypes = [ | ||
'ProgrammingError', | ||
'ProtocolError', | ||
'RangeError', | ||
'ReadTimeout', | ||
'ReadTimeoutError', | ||
'ReferenceError', | ||
'RemoteDisconnected', | ||
'RequestAbortedError', | ||
'ResponseError (action_request_validation_exception)', | ||
'ResponseError (illegal_argument_exception)', | ||
'ResponseError (index_not_found_exception)', | ||
'ResponseError (index_template_missing_exception)', | ||
'ResponseError (resource_already_exists_exception)', | ||
'ResponseError (resource_not_found_exception)', | ||
'ResponseError (search_phase_execution_exception)', | ||
'ResponseError (security_exception)', | ||
'ResponseError (transport_serialization_exception)', | ||
'ResponseError (version_conflict_engine_exception)', | ||
'ResponseError (x_content_parse_exception)', | ||
'ResponseError', | ||
'SIGTRAP', | ||
'SocketError', | ||
'SpawnError', | ||
'SyntaxError', | ||
'SyscallError', | ||
'TimeoutError', | ||
'TimeoutError', | ||
'TypeError', | ||
]; | ||
|
||
export function getExceptionTypeForIndex(index: number) { | ||
return exceptionTypes[index % exceptionTypes.length]; | ||
} |
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
73 changes: 73 additions & 0 deletions
73
packages/kbn-apm-synthtrace/src/scenarios/many_dependencies.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,73 @@ | ||
/* | ||
* 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 { ApmFields, Instance } from '@kbn/apm-synthtrace-client'; | ||
import { service } from '@kbn/apm-synthtrace-client/src/lib/apm/service'; | ||
import { random, times } from 'lodash'; | ||
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 NUMBER_OF_DEPENDENCIES_PER_SERVICE = 2000; | ||
const NUMBER_OF_SERVICES = 1; | ||
|
||
const scenario: Scenario<ApmFields> = async (runOptions: RunOptions) => { | ||
return { | ||
generate: ({ range, clients: { apmEsClient } }) => { | ||
const instances = times(NUMBER_OF_SERVICES).map((index) => | ||
service({ | ||
name: `synthtrace-high-cardinality-${index}`, | ||
environment: ENVIRONMENT, | ||
agentName: 'java', | ||
}).instance(`java-instance-${index}`) | ||
); | ||
|
||
const instanceDependencies = (instance: Instance, id: string) => { | ||
const throughput = random(1, 60); | ||
const childLatency = random(10, 100_000); | ||
const parentLatency = childLatency + random(10, 10_000); | ||
|
||
const failureRate = random(0, 100); | ||
|
||
return range.ratePerMinute(throughput).generator((timestamp) => { | ||
const child = instance | ||
.span({ | ||
spanName: 'GET apm-*/_search', | ||
spanType: 'db', | ||
spanSubtype: 'elasticsearch', | ||
}) | ||
.destination(`elasticsearch/${id}`) | ||
.timestamp(timestamp) | ||
.duration(childLatency); | ||
|
||
const span = instance | ||
.transaction({ transactionName: 'GET /java' }) | ||
.timestamp(timestamp) | ||
.duration(parentLatency) | ||
.success() | ||
.children(Math.random() * 100 > failureRate ? child.success() : child.failure()); | ||
|
||
return span; | ||
}); | ||
}; | ||
|
||
return withClient( | ||
apmEsClient, | ||
instances.flatMap((instance, i) => | ||
times(NUMBER_OF_DEPENDENCIES_PER_SERVICE) | ||
.map((j) => instanceDependencies(instance, `${i + 1}.${j + 1}`)) | ||
.flat() | ||
) | ||
); | ||
}, | ||
}; | ||
}; | ||
|
||
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
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
67 changes: 0 additions & 67 deletions
67
packages/kbn-apm-synthtrace/src/scenarios/service_many_dependencies.ts
This file was deleted.
Oops, something went wrong.
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.