Skip to content

Commit 291d6ca

Browse files
achyutjhunjhunwalakibanamachine
authored andcommitted
[Logs UX] [One Discover] Add logic to render custom recommended fields (#228038)
## Summary closes elastic/logs-dev#256 closes #192556 closes #198562 As part of this PR, we are adding `Recommended Fields` section in Discover. - These fields are statically present for certain Data Source profiles in Discover - The fields would only appear in the list if they are present in the documents. Meaning if a search/filter would impact what appears here. ## Logs Context <img width="1666" height="724" alt="image" src="https://github.com/user-attachments/assets/8c7a4633-0ba5-4f6f-8f65-a8127196f08b" /> ## Traces Context <img width="757" height="335" alt="image" src="https://github.com/user-attachments/assets/46e3ddba-f982-4043-85f0-aff7aaa04dda" /> ## Some things are still pending - [x] Get PM confirmation on Profiles to target with fields - [x] Add FTR tests - [x] Make pipeline green --------- Co-authored-by: kibanamachine <[email protected]>
1 parent 81c9a6c commit 291d6ca

File tree

29 files changed

+1217
-17
lines changed

29 files changed

+1217
-17
lines changed

src/platform/packages/shared/kbn-apm-synthtrace-client/src/lib/logs/index.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export type LogDocument = Fields &
2929
'log.file.path'?: string;
3030
'service.name'?: string;
3131
'service.environment'?: string;
32+
'service.version'?: string;
3233
'data_stream.namespace': string;
3334
'data_stream.type': string;
3435
'data_stream.dataset': string;
@@ -93,6 +94,25 @@ export type LogDocument = Fields &
9394
'orchestrator.resource.name'?: string;
9495
tags?: string | string[];
9596
'user_agent.name'?: string;
97+
'orchestrator.type'?: string;
98+
'orchestrator.resource.type'?: string;
99+
'container.image.name'?: string;
100+
'container.image.tag'?: string;
101+
'container.runtime'?: string;
102+
'host.os.platform'?: string;
103+
'host.os.name'?: string;
104+
'host.os.version'?: string;
105+
'host.architecture'?: string;
106+
'cloud.instance.name'?: string;
107+
'kubernetes.container.image'?: string;
108+
'kubernetes.container.image_id'?: string;
109+
'kubernetes.node.name'?: string;
110+
'kubernetes.node.uid'?: string;
111+
'kubernetes.labels.app'?: string;
112+
'kubernetes.labels.version'?: string;
113+
'kubernetes.labels.tier'?: string;
114+
'kubernetes.annotations.deployment'?: string;
115+
'process.pid'?: number;
96116
}>;
97117

98118
class Log extends Serializable<LogDocument> {

src/platform/packages/shared/kbn-apm-synthtrace/src/scenarios/apache_logs.ts

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,40 @@ const scenario: Scenario<LogDocument> = async (runOptions) => {
8686
});
8787
});
8888

89+
// error logs
90+
const errorLogs = range
91+
.interval('1m')
92+
.rate(10)
93+
.generator((timestamp) => {
94+
return Array(3)
95+
.fill(0)
96+
.map(() => {
97+
const logsData = constructApacheLogData();
98+
99+
return log
100+
.create({ isLogsDb })
101+
.message(
102+
`ERROR: ${logsData['client.ip']} encountered server error on path ${logsData['url.path']}`
103+
)
104+
.dataset('apache.error')
105+
.logLevel('error')
106+
.defaults({
107+
...logsData,
108+
'event.category': 'application',
109+
'event.type': 'error',
110+
'event.outcome': 'failure',
111+
})
112+
.timestamp(timestamp);
113+
});
114+
});
115+
89116
return withClient(
90117
logsEsClient,
91-
logger.perf('generating_apache_logs', () => [normalAccessLogs, attackSimulationLogs])
118+
logger.perf('generating_apache_logs', () => [
119+
normalAccessLogs,
120+
attackSimulationLogs,
121+
errorLogs,
122+
])
92123
);
93124
},
94125
};

0 commit comments

Comments
 (0)