Skip to content
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

[Infrastructure UI] Replace Lens table with EUI table and own api #142871

Merged
merged 30 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f309f35
remove lens, add snapshot api
neptunian Oct 6, 2022
3b99bb5
merge
neptunian Oct 6, 2022
fc545f6
add no data
neptunian Oct 6, 2022
26710d6
Add cpu type
jennypavlova Oct 10, 2022
5a212ca
[WIP] Add eui basic table and columns
jennypavlova Oct 11, 2022
4d47a82
[WIP] Add cpu cores and os
jennypavlova Oct 12, 2022
20719b5
[WIP] Mapping data to the eui basic table format
jennypavlova Oct 12, 2022
392e035
Add Memory Total
jennypavlova Oct 13, 2022
d1b432d
Refactor host mapping and add types
jennypavlova Oct 13, 2022
72f9d8c
Scale up memory usage percentage
jennypavlova Oct 14, 2022
a20a278
Make os optional in the model
jennypavlova Oct 14, 2022
5309f1f
Text cells formatting
jennypavlova Oct 14, 2022
b5e6432
Change os.type to os.name
jennypavlova Oct 14, 2022
b54de0e
Move snapshot nodes mapping to a hook and test it
jennypavlova Oct 14, 2022
4153f3b
Add translation
jennypavlova Oct 14, 2022
5ae30be
Add fixed range and cleanup
jennypavlova Oct 14, 2022
13f8677
Merge branch 'main' into example-snapshot-table
jennypavlova Oct 18, 2022
9ab9f8a
Fix diskLatency field name
jennypavlova Oct 18, 2022
191a3d0
Merge branch 'main' into example-snapshot-table
jennypavlova Oct 18, 2022
263ee4d
Remove not existing showQueryBar prop from SearchBar and set time ran…
jennypavlova Oct 18, 2022
4ecda79
Merge branch 'main' into example-snapshot-table
jennypavlova Oct 18, 2022
f68a313
Use last path
jennypavlova Oct 20, 2022
0d07ca1
Test last path change
jennypavlova Oct 20, 2022
e1f58f1
Type imports
jennypavlova Oct 20, 2022
662c7ae
Change the way lastPath.os is set
jennypavlova Oct 20, 2022
a4bd9a5
Type import
jennypavlova Oct 20, 2022
d493a03
Merge branch 'main' into example-snapshot-table
jennypavlova Oct 20, 2022
36a30da
Merge branch 'main' into example-snapshot-table
jennypavlova Oct 20, 2022
1a29df3
Merge branch 'main' into example-snapshot-table
jennypavlova Oct 20, 2022
3423b70
Merge branch 'main' into example-snapshot-table
jennypavlova Oct 24, 2022
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
3 changes: 3 additions & 0 deletions x-pack/plugins/infra/common/http_api/snapshot_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export const SnapshotNodePathRT = rt.intersection([
rt.partial({
ip: rt.union([rt.string, rt.null]),
}),
rt.partial({
os: rt.union([rt.string, rt.null]),
}),
]);

const SnapshotNodeMetricOptionalRT = rt.partial({
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/infra/common/inventory_models/host/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const host: InventoryModel = {
fields: {
id: 'host.name',
name: 'host.name',
os: 'host.os.name',
ip: 'host.ip',
},
metrics,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
*/

import { cpu } from './snapshot/cpu';
import { cpuCores } from './snapshot/cpu_cores';
import { count } from '../../shared/metrics/snapshot/count';
import { load } from './snapshot/load';
import { logRate } from './snapshot/log_rate';
import { memory } from './snapshot/memory';
import { memoryTotal } from './snapshot/memory_total';
import { rx } from './snapshot/rx';
import { tx } from './snapshot/tx';

Expand All @@ -33,7 +35,7 @@ import { hostDockerInfo } from './tsvb/host_docker_info';

import { InventoryMetrics } from '../../types';

const exposedHostSnapshotMetrics = { cpu, load, logRate, memory, rx, tx };
const exposedHostSnapshotMetrics = { cpu, load, logRate, memory, rx, tx, cpuCores, memoryTotal };
// not sure why this is the only model with "count"
const hostSnapshotMetrics = { count, ...exposedHostSnapshotMetrics };

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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { MetricsUIAggregation } from '../../../types';

export const cpuCores: MetricsUIAggregation = {
cpuCores: {
max: {
field: 'system.cpu.cores',
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { MetricsUIAggregation } from '../../../types';

export const memoryTotal: MetricsUIAggregation = {
memory_total: {
avg: {
jennypavlova marked this conversation as resolved.
Show resolved Hide resolved
field: 'system.memory.total',
},
},
memoryTotal: {
bucket_script: {
buckets_path: {
memoryTotal: 'memory_total',
},
script: {
source: 'params.memoryTotal / 1000000', // Convert to MB
lang: 'painless',
},
gap_policy: 'skip',
},
},
};
3 changes: 3 additions & 0 deletions x-pack/plugins/infra/common/inventory_models/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,10 @@ export type MetricsUIAggregation = rt.TypeOf<typeof MetricsUIAggregationRT>;
export const SnapshotMetricTypeKeys = {
count: null,
cpu: null,
cpuCores: null,
load: null,
memory: null,
memoryTotal: null,
tx: null,
rx: null,
logRate: null,
Expand Down Expand Up @@ -382,6 +384,7 @@ export interface InventoryModel {
fields: {
id: string;
name: string;
os?: string;
ip?: string;
};
crosslinkSupport: {
Expand Down
3 changes: 1 addition & 2 deletions x-pack/plugins/infra/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
"triggersActionsUi",
"observability",
"ruleRegistry",
"unifiedSearch",
"lens"
Copy link
Contributor Author

@neptunian neptunian Oct 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might want to leave this for now as we are thinking to use Lens Embeddables for other things. or we can remove it and just add it back later.

"unifiedSearch"
],
"optionalPlugins": ["ml", "home", "embeddable", "osquery"],
"server": true,
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/infra/public/apps/metrics_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export const renderApp = (
return () => {
core.chrome.docTitle.reset();
ReactDOM.unmountComponentAtNode(element);
plugins.data.search.session.clear();
};
};

Expand Down
Loading