Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
adb4955
Add customisation for virtual columns and add the 1st virtual column
achyutjhunjhunwala Dec 20, 2023
30d3433
Revert changes to tests
achyutjhunjhunwala Dec 20, 2023
d3d01f4
Merge branch 'main' into add-content-virtual-column
achyutjhunjhunwala Dec 20, 2023
b9db844
Fix log level colors and visibility
achyutjhunjhunwala Dec 20, 2023
76254a0
Merge branch 'main' into add-content-virtual-column
achyutjhunjhunwala Dec 21, 2023
6ee989b
Add JSON formatting for content cells
achyutjhunjhunwala Dec 21, 2023
c96a7e7
Fix checktype issue
achyutjhunjhunwala Dec 21, 2023
6d8f135
Fix Logs explorer failing tests
achyutjhunjhunwala Dec 21, 2023
5a5548d
Fix snapshots for data-table
achyutjhunjhunwala Dec 21, 2023
e756a84
Merge branch 'main' into add-content-virtual-column
achyutjhunjhunwala Dec 21, 2023
1f85fb5
Fix more tests
achyutjhunjhunwala Dec 21, 2023
95f648d
Fix type issue
achyutjhunjhunwala Dec 21, 2023
ff0b0e1
Fix limits for the package
achyutjhunjhunwala Dec 21, 2023
3a78262
Merge branch 'main' into add-content-virtual-column
achyutjhunjhunwala Dec 27, 2023
9604f8c
Add serverless tests
achyutjhunjhunwala Dec 27, 2023
75fd98e
Add stateful tests
achyutjhunjhunwala Dec 27, 2023
e39d2f6
Merge branch 'main' into add-content-virtual-column
achyutjhunjhunwala Dec 27, 2023
2b9350e
Fix tests and added dynamic import to make the bundle smaller
achyutjhunjhunwala Dec 28, 2023
42dc9a9
Fix silly mistake
achyutjhunjhunwala Dec 28, 2023
77e2b9b
Merge branch 'main' into add-content-virtual-column
achyutjhunjhunwala Dec 28, 2023
64f3bde
Fixing more type issues
achyutjhunjhunwala Dec 28, 2023
4705c4a
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Dec 28, 2023
298f013
Add logic to handle Cell Actions
achyutjhunjhunwala Jan 2, 2024
f870e80
Merge branch 'main' into add-content-virtual-column
achyutjhunjhunwala Jan 2, 2024
5ff4af7
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Jan 2, 2024
be71049
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Jan 2, 2024
45ae5ce
Fix the stupidest and the most time consuming error
achyutjhunjhunwala Jan 2, 2024
64fec7b
Fix string literal issue
achyutjhunjhunwala Jan 2, 2024
026735a
Add cell action tests
achyutjhunjhunwala Jan 3, 2024
e5c9ed0
Merge branch 'main' into add-content-virtual-column
achyutjhunjhunwala Jan 3, 2024
71f4654
Fix flyout tests broken due to change in data-test-subj
achyutjhunjhunwala Jan 3, 2024
10a09e7
Fix review comments from DD Team
achyutjhunjhunwala Jan 3, 2024
f54c583
Fix review comments except 1 around Flyout Message
achyutjhunjhunwala Jan 4, 2024
01f8d72
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Jan 4, 2024
2e5c476
Set content column at the end
achyutjhunjhunwala Jan 4, 2024
c133c68
Fix flyout message rendering logic
achyutjhunjhunwala Jan 4, 2024
92decb8
Merge branch 'main' into add-content-virtual-column
achyutjhunjhunwala Jan 4, 2024
e0ba286
Merge branch 'main' into add-content-virtual-column
achyutjhunjhunwala Jan 5, 2024
96fdb69
Merge branch 'main' into add-content-virtual-column
achyutjhunjhunwala Jan 5, 2024
b98a299
Fix further feedback comments
achyutjhunjhunwala Jan 5, 2024
4965a7c
Fix broken Unit tests
achyutjhunjhunwala Jan 5, 2024
c4c2fd5
Merge branch 'main' into add-content-virtual-column
achyutjhunjhunwala Jan 5, 2024
51592c3
Merge branch 'main' into add-content-virtual-column
achyutjhunjhunwala Jan 5, 2024
d7fc432
Fix discover teams review feedback
achyutjhunjhunwala Jan 8, 2024
e63ecfa
Merge branch 'main' into add-content-virtual-column
achyutjhunjhunwala Jan 8, 2024
0d59148
Fixed design issues post discussion
achyutjhunjhunwala Jan 8, 2024
31d894d
Merge branch 'main' into add-content-virtual-column
achyutjhunjhunwala Jan 8, 2024
757d81a
Merge branch 'main' into add-content-virtual-column
achyutjhunjhunwala Jan 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/kbn-apm-synthtrace-client/src/lib/logs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export type LogDocument = Fields &
'data_stream.type': string;
'data_stream.dataset': string;
message?: string;
'error.message'?: string;
'event.original'?: string;
'event.dataset': string;
'log.level'?: string;
'host.name'?: string;
Expand Down
128 changes: 126 additions & 2 deletions packages/kbn-apm-synthtrace/src/scenarios/simple_logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const scenario: Scenario<LogDocument> = async (runOptions) => {
.interval('1m')
.rate(1)
.generator((timestamp) => {
return Array(20)
return Array(3)
.fill(0)
.map(() => {
const index = Math.floor(Math.random() * 3);
Expand All @@ -63,9 +63,133 @@ const scenario: Scenario<LogDocument> = async (runOptions) => {
});
});

const logsWithNoLogLevel = range
.interval('1m')
.rate(1)
.generator((timestamp) => {
return Array(3)
.fill(0)
.map(() => {
const index = Math.floor(Math.random() * 3);
return log
.create()
.service(SERVICE_NAMES[index])
.defaults({
'trace.id': generateShortId(),
'error.message': MESSAGE_LOG_LEVELS[index].message,
'agent.name': 'synth-agent',
'orchestrator.cluster.name': CLUSTER[index].clusterName,
'orchestrator.cluster.id': CLUSTER[index].clusterId,
'orchestrator.resource.id': generateShortId(),
'cloud.provider': CLOUD_PROVIDERS[Math.floor(Math.random() * 3)],
'cloud.region': CLOUD_REGION[index],
'cloud.availability_zone': `${CLOUD_REGION[index]}a`,
'cloud.project.id': generateShortId(),
'cloud.instance.id': generateShortId(),
'log.file.path': `/logs/${generateLongId()}/error.txt`,
})
.timestamp(timestamp);
});
});

const logsWithErrorMessage = range
.interval('1m')
.rate(1)
.generator((timestamp) => {
return Array(3)
.fill(0)
.map(() => {
const index = Math.floor(Math.random() * 3);
return log
.create()
.logLevel(MESSAGE_LOG_LEVELS[index].level)
.service(SERVICE_NAMES[index])
.defaults({
'trace.id': generateShortId(),
'error.message': MESSAGE_LOG_LEVELS[index].message,
'agent.name': 'synth-agent',
'orchestrator.cluster.name': CLUSTER[index].clusterName,
'orchestrator.cluster.id': CLUSTER[index].clusterId,
'orchestrator.resource.id': generateShortId(),
'cloud.provider': CLOUD_PROVIDERS[Math.floor(Math.random() * 3)],
'cloud.region': CLOUD_REGION[index],
'cloud.availability_zone': `${CLOUD_REGION[index]}a`,
'cloud.project.id': generateShortId(),
'cloud.instance.id': generateShortId(),
'log.file.path': `/logs/${generateLongId()}/error.txt`,
})
.timestamp(timestamp);
});
});

const logsWithEventMessage = range
.interval('1m')
.rate(1)
.generator((timestamp) => {
return Array(3)
.fill(0)
.map(() => {
const index = Math.floor(Math.random() * 3);
return log
.create()
.logLevel(MESSAGE_LOG_LEVELS[index].level)
.service(SERVICE_NAMES[index])
.defaults({
'trace.id': generateShortId(),
'event.original': MESSAGE_LOG_LEVELS[index].message,
'agent.name': 'synth-agent',
'orchestrator.cluster.name': CLUSTER[index].clusterName,
'orchestrator.cluster.id': CLUSTER[index].clusterId,
'orchestrator.resource.id': generateShortId(),
'cloud.provider': CLOUD_PROVIDERS[Math.floor(Math.random() * 3)],
'cloud.region': CLOUD_REGION[index],
'cloud.availability_zone': `${CLOUD_REGION[index]}a`,
'cloud.project.id': generateShortId(),
'cloud.instance.id': generateShortId(),
'log.file.path': `/logs/${generateLongId()}/error.txt`,
})
.timestamp(timestamp);
});
});

const logsWithNoMessage = range
.interval('1m')
.rate(1)
.generator((timestamp) => {
return Array(3)
.fill(0)
.map(() => {
const index = Math.floor(Math.random() * 3);
return log
.create()
.logLevel(MESSAGE_LOG_LEVELS[index].level)
.service(SERVICE_NAMES[index])
.defaults({
'trace.id': generateShortId(),
'agent.name': 'synth-agent',
'orchestrator.cluster.name': CLUSTER[index].clusterName,
'orchestrator.cluster.id': CLUSTER[index].clusterId,
'orchestrator.resource.id': generateShortId(),
'cloud.provider': CLOUD_PROVIDERS[Math.floor(Math.random() * 3)],
'cloud.region': CLOUD_REGION[index],
'cloud.availability_zone': `${CLOUD_REGION[index]}a`,
'cloud.project.id': generateShortId(),
'cloud.instance.id': generateShortId(),
'log.file.path': `/logs/${generateLongId()}/error.txt`,
})
.timestamp(timestamp);
});
});

return withClient(
logsEsClient,
logger.perf('generating_logs', () => logs)
logger.perf('generating_logs', () => [
logs,
logsWithNoLogLevel,
logsWithErrorMessage,
logsWithEventMessage,
logsWithNoMessage,
])
);
},
};
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ pageLoadAssetSize:
kibanaUsageCollection: 16463
kibanaUtils: 79713
kubernetesSecurity: 77234
lens: 43000
lens: 57135
licenseManagement: 41817
licensing: 29004
links: 44490
lists: 22900
logExplorer: 54342
logExplorer: 44977
logsShared: 281060
logstash: 53548
management: 46112
Expand Down
9 changes: 3 additions & 6 deletions packages/kbn-unified-data-table/src/components/data_table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
EuiDataGridInMemory,
EuiDataGridControlColumn,
EuiDataGridCustomBodyProps,
EuiDataGridCellValueElementProps,
EuiDataGridCustomToolbarProps,
EuiDataGridToolBarVisibilityOptions,
EuiDataGridToolBarVisibilityDisplaySelectorOptions,
Expand All @@ -47,10 +46,11 @@ import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public';
import type { ThemeServiceStart } from '@kbn/react-kibana-context-common';
import type { DataPublicPluginStart } from '@kbn/data-plugin/public';
import type { DocViewFilterFn } from '@kbn/unified-doc-viewer/types';
import type {
import {
UnifiedDataTableSettings,
ValueToStringConverter,
DataTableColumnTypes,
CustomCellRenderer,
} from '../types';
import { getDisplayedColumns } from '../utils/columns';
import { convertValueToString } from '../utils/convert_value_to_string';
Expand Down Expand Up @@ -324,10 +324,7 @@ export interface UnifiedDataTableProps {
/**
* An optional settings for a specified fields rendering like links. Applied only for the listed fields rendering.
*/
externalCustomRenderers?: Record<
string,
(props: EuiDataGridCellValueElementProps) => React.ReactNode
>;
externalCustomRenderers?: CustomCellRenderer;
/**
* Name of the UnifiedDataTable consumer component or application
*/
Expand Down
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.
*/

import React from 'react';

export const DataTablePopoverCellValue = ({ children }: { children: React.ReactNode }) => {
return <span className="unifiedDataTable__cellPopoverValue eui-textBreakWord">{children}</span>;
};

// eslint-disable-next-line import/no-default-export
export default DataTablePopoverCellValue;
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* 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 { dataViewMock } from '@kbn/discover-utils/src/__mocks__';
import { FieldFormatsStart } from '@kbn/field-formats-plugin/public';
import { mountWithIntl } from '@kbn/test-jest-helpers';
import React from 'react';
import SourceDocument from './source_document';
import type { EsHitRecord } from '@kbn/discover-utils/src/types';
import { buildDataTableRecord } from '@kbn/discover-utils';

const mockServices = {
fieldFormats: {
getDefaultInstance: jest.fn(() => ({ convert: (value: unknown) => (value ? value : '-') })),
},
};

const rowsSource: EsHitRecord[] = [
{
_id: '1',
_index: 'test',
_score: 1,
_source: { bytes: 100, extension: '.gz' },
highlight: {
extension: ['@kibana-highlighted-field.gz@/kibana-highlighted-field'],
},
},
];

const build = (hit: EsHitRecord) => buildDataTableRecord(hit, dataViewMock);

describe('Unified data table source document cell rendering', function () {
it('renders a description list for source type documents', () => {
const rows = rowsSource.map(build);

const component = mountWithIntl(
<SourceDocument
useTopLevelObjectColumns={false}
row={rows[0]}
dataView={dataViewMock}
columnId="_source"
fieldFormats={mockServices.fieldFormats as unknown as FieldFormatsStart}
shouldShowFieldHandler={() => false}
maxEntries={100}
isPlainRecord={true}
/>
);
expect(component.html()).toMatchInlineSnapshot(
`"<dl class=\\"euiDescriptionList unifiedDataTable__descriptionList unifiedDataTable__cellValue css-id58dh-euiDescriptionList-inline-left\\" data-test-subj=\\"discoverCellDescriptionList\\" data-type=\\"inline\\"><dt class=\\"euiDescriptionList__title unifiedDataTable__descriptionListTitle css-1fizlic-euiDescriptionList__title-inline-compressed\\">_index</dt><dd class=\\"euiDescriptionList__description unifiedDataTable__descriptionListDescription css-11rdew2-euiDescriptionList__description-inline-compressed\\">test</dd><dt class=\\"euiDescriptionList__title unifiedDataTable__descriptionListTitle css-1fizlic-euiDescriptionList__title-inline-compressed\\">_score</dt><dd class=\\"euiDescriptionList__description unifiedDataTable__descriptionListDescription css-11rdew2-euiDescriptionList__description-inline-compressed\\">1</dd></dl>"`
);
});
});
Loading