-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Logs Explorer] Add support for log generation in synthtrace #170107
Merged
achyutjhunjhunwala
merged 34 commits into
elastic:main
from
achyutjhunjhunwala:add-support-for-logs-in-synthtrace
Nov 16, 2023
Merged
Changes from 29 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
30860d6
Add support for log generation in synthtrace
achyutjhunjhunwala c47db39
Adds Synthtrace support to serverless tests
achyutjhunjhunwala cc507c3
Fix lint issue
achyutjhunjhunwala d940554
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine c39a4fd
Add support to index log data via CLI
achyutjhunjhunwala cff58f1
Merge branch 'main' into add-support-for-logs-in-synthtrace
achyutjhunjhunwala 3a2ef9a
Fix unrelated checktype issue
achyutjhunjhunwala f5d3313
Fix datastream regex
achyutjhunjhunwala 0331a59
Merge branch 'main' into add-support-for-logs-in-synthtrace
achyutjhunjhunwala 1bc3995
Update synthtrace documentation
achyutjhunjhunwala aa36d3e
Add Logs UX as the co-owner of the package
achyutjhunjhunwala 83964f8
[CI] Auto-commit changed files from 'node scripts/generate codeowners'
kibanamachine 616f224
IMPROVE log instance creation logic and renamed client
achyutjhunjhunwala 4b527f7
Make scenario files aware of client
achyutjhunjhunwala b6eb187
Update README.md
achyutjhunjhunwala ac35eb1
Update README.md
achyutjhunjhunwala 57d2d80
Merge branch 'main' into add-support-for-logs-in-synthtrace
achyutjhunjhunwala 8690722
Update Synthtrace scenario with robust data
achyutjhunjhunwala 2f99579
Fix tests
achyutjhunjhunwala 840cfb3
Fix generateId logic to save CPU
achyutjhunjhunwala 20dae5a
Merge branch 'main' into add-support-for-logs-in-synthtrace
achyutjhunjhunwala dcfafe2
Add logic to generate multiple type of data using synthtrace
achyutjhunjhunwala 617941b
Fix all scenario files
achyutjhunjhunwala 7cf6fa1
Fix typo
achyutjhunjhunwala ebfc3f9
Merge branch 'main' into add-support-for-logs-in-synthtrace
achyutjhunjhunwala 135cfe1
Remove code comment
achyutjhunjhunwala c773422
Merge branch 'main' into add-support-for-logs-in-synthtrace
achyutjhunjhunwala 7702861
Merge branch 'main' into add-support-for-logs-in-synthtrace
mistic 4b9553a
Update packages/kbn-apm-synthtrace/README.md
achyutjhunjhunwala 6134699
Fix final review comments
achyutjhunjhunwala fd786ec
Fix README.md
achyutjhunjhunwala c28c48c
Merge branch 'main' into add-support-for-logs-in-synthtrace
achyutjhunjhunwala 0f099c9
reusing streams rather than creating them on every batch
achyutjhunjhunwala 009bdda
Merge branch 'main' into add-support-for-logs-in-synthtrace
achyutjhunjhunwala File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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,77 @@ | ||
/* | ||
* 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 LogDocument = Fields & | ||
Partial<{ | ||
achyutjhunjhunwala marked this conversation as resolved.
Show resolved
Hide resolved
|
||
'input.type': string; | ||
'log.file.path'?: string; | ||
'service.name'?: string; | ||
'data_stream.namespace': string; | ||
'data_stream.type': string; | ||
'data_stream.dataset': string; | ||
message?: string; | ||
'event.dataset': string; | ||
'log.level'?: string; | ||
'host.name'?: string; | ||
'trace.id'?: string; | ||
'agent.name'?: string; | ||
'orchestrator.cluster.name'?: string; | ||
'orchestrator.cluster.id'?: string; | ||
'orchestrator.resource.id'?: string; | ||
'cloud.provider'?: string; | ||
'cloud.region'?: string; | ||
'cloud.availability_zone'?: string; | ||
'cloud.project.id'?: string; | ||
'cloud.instance.id'?: string; | ||
}>; | ||
|
||
class Log extends Serializable<LogDocument> { | ||
service(name: string) { | ||
this.fields['service.name'] = name; | ||
return this; | ||
} | ||
|
||
namespace(value: string) { | ||
this.fields['data_stream.namespace'] = value; | ||
return this; | ||
} | ||
|
||
dataset(value: string) { | ||
this.fields['data_stream.dataset'] = value; | ||
this.fields['event.dataset'] = value; | ||
return this; | ||
} | ||
|
||
logLevel(level: string) { | ||
this.fields['log.level'] = level; | ||
return this; | ||
} | ||
|
||
message(message: string) { | ||
this.fields.message = message; | ||
return this; | ||
} | ||
} | ||
|
||
function create(): Log { | ||
return new Log({ | ||
achyutjhunjhunwala marked this conversation as resolved.
Show resolved
Hide resolved
|
||
'input.type': 'logs', | ||
'data_stream.namespace': 'default', | ||
'data_stream.type': 'logs', | ||
'data_stream.dataset': 'synth', | ||
'event.dataset': 'synth', | ||
'host.name': 'synth-host', | ||
}); | ||
} | ||
|
||
export const log = { | ||
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
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
31 changes: 31 additions & 0 deletions
31
packages/kbn-apm-synthtrace/src/cli/utils/get_logs_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,31 @@ | ||
/* | ||
* 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 { LogsSynthtraceEsClient } from '../../lib/logs/logs_synthtrace_es_client'; | ||
import { Logger } from '../../lib/utils/create_logger'; | ||
import { RunOptions } from './parse_run_cli_flags'; | ||
|
||
export function getLogsEsClient({ | ||
achyutjhunjhunwala marked this conversation as resolved.
Show resolved
Hide resolved
|
||
target, | ||
logger, | ||
concurrency, | ||
}: Pick<RunOptions, 'concurrency'> & { | ||
target: string; | ||
logger: Logger; | ||
}) { | ||
const client = new Client({ | ||
node: target, | ||
}); | ||
|
||
return new LogsSynthtraceEsClient({ | ||
client, | ||
logger, | ||
concurrency, | ||
}); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC, multiple codeowners means multiple approvals. do we want this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH, i want to keep myself in loop for future changes to this repo. Hence added my current team, also I can pull you in when a complicated code requires review as you are not in any of the current owner teams😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am also fine removing the
@elastic/obs-ux-infra_services-team