Skip to content

Commit

Permalink
Merge branch 'main' into 165812-infra-ui-rename-disk-usage-charts
Browse files Browse the repository at this point in the history
  • Loading branch information
jennypavlova authored Sep 7, 2023
2 parents c99026e + 5d69a3e commit a4136be
Show file tree
Hide file tree
Showing 40 changed files with 1,129 additions and 220 deletions.
1 change: 1 addition & 0 deletions config/serverless.es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ xpack.observability.enabled: false
xpack.securitySolution.enabled: false
xpack.serverless.observability.enabled: false
xpack.uptime.enabled: false
xpack.legacy_uptime.enabled: false
enterpriseSearch.enabled: false
monitoring.ui.enabled: false
xpack.fleet.enabled: false
Expand Down
4 changes: 3 additions & 1 deletion config/serverless.oblt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
enterpriseSearch.enabled: false
xpack.cloudSecurityPosture.enabled: false
xpack.securitySolution.enabled: false
xpack.uptime.enabled: false
xpack.legacy_uptime.enabled: false

## Enable the Serverless Observability plugin
xpack.serverless.observability.enabled: true
Expand All @@ -24,7 +26,7 @@ xpack.fleet.agentIdVerificationEnabled: false
xpack.apm.serverlessOnboarding: true

# Fleet specific configuration
xpack.fleet.internal.capabilities: ['apm', 'uptime', 'observability']
xpack.fleet.internal.capabilities: ['apm', 'observability']

## Required for force installation of APM Package
xpack.fleet.packages:
Expand Down
1 change: 1 addition & 0 deletions config/serverless.security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ enterpriseSearch.enabled: false
xpack.apm.enabled: false
xpack.observability.enabled: false
xpack.uptime.enabled: false
xpack.legacy_uptime.enabled: false

## Enable the Security Solution Serverless plugin
xpack.securitySolutionServerless.enabled: true
Expand Down
14 changes: 14 additions & 0 deletions x-pack/plugins/infra/public/common/visualizations/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ import {
memoryUsed,
memoryFreeExcludingCache,
memoryCache,
nginxActiveConnections,
nginxRequestRate,
nginxRequestsPerConnection,
nginxSuccessStatusCodes,
nginxRedirectStatusCodes,
nginxClientErrorStatusCodes,
nginxServerErrorStatusCodes,
rx,
tx,
hostCount,
Expand Down Expand Up @@ -63,6 +70,13 @@ export const hostLensFormulas = {
memoryUsed,
memoryFreeExcludingCache,
memoryCache,
nginxActiveConnections,
nginxRequestRate,
nginxRequestsPerConnection,
nginxSuccessStatusCodes,
nginxRedirectStatusCodes,
nginxClientErrorStatusCodes,
nginxServerErrorStatusCodes,
rx,
tx,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* 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 {
nginxActiveConnections,
nginxRequestRate,
nginxRequestsPerConnection,
nginxResponseStatusCodes,
} from '../metric_charts/nginx';
import type { XYConfig } from '../metric_charts/types';

export const nginxStubstatusCharts: XYConfig[] = [
nginxActiveConnections,
nginxRequestRate,
nginxRequestsPerConnection,
];

export const nginxAccessCharts: XYConfig[] = [nginxResponseStatusCodes];
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@

import { hostMetricCharts, hostMetricChartsFullPage } from './host/host_metric_charts';
import { hostKPICharts, KPIChartProps } from './host/host_kpi_charts';
import { nginxAccessCharts, nginxStubstatusCharts } from './host/nginx_charts';

export { type KPIChartProps };
export const assetDetailsDashboards = {
host: { hostMetricCharts, hostMetricChartsFullPage, hostKPICharts },
nginxDashboard: { nginxStubstatusCharts, nginxAccessCharts },
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
* 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 { i18n } from '@kbn/i18n';
import { hostLensFormulas } from '../../../../constants';
import { XY_OVERRIDES } from '../../constants';
import type { XYConfig } from './types';

export const nginxRequestRate: XYConfig = {
id: 'RequestRate',
title: i18n.translate('xpack.infra.assetDetails.metricsCharts.nginx.requestRate', {
defaultMessage: 'Request Rate',
}),

layers: [
{
data: [hostLensFormulas.nginxRequestRate],
type: 'visualization',
},
],
dataViewOrigin: 'metrics',
};

export const nginxActiveConnections: XYConfig = {
id: 'ActiveConnections',
title: i18n.translate('xpack.infra.assetDetails.metricsCharts.nginx.activeConnections', {
defaultMessage: 'Active Connections',
}),

layers: [
{
data: [hostLensFormulas.nginxActiveConnections],
type: 'visualization',
},
],
dataViewOrigin: 'metrics',
};

export const nginxRequestsPerConnection: XYConfig = {
id: 'RequestsPerConnection',
title: i18n.translate('xpack.infra.assetDetails.metricsCharts.nginx.requestsPerConnection', {
defaultMessage: 'Requests Per Connection',
}),

layers: [
{
data: [hostLensFormulas.nginxRequestsPerConnection],
type: 'visualization',
},
],
dataViewOrigin: 'metrics',
};

export const nginxResponseStatusCodes: XYConfig = {
id: 'ResponseStatusCodes',
title: i18n.translate('xpack.infra.assetDetails.metricsCharts.nginx.responseStatusCodes', {
defaultMessage: 'Response Status Codes',
}),

layers: [
{
data: [
hostLensFormulas.nginxSuccessStatusCodes,
hostLensFormulas.nginxRedirectStatusCodes,
hostLensFormulas.nginxClientErrorStatusCodes,
hostLensFormulas.nginxServerErrorStatusCodes,
],
options: {
seriesType: 'area',
},
type: 'visualization',
},
],
overrides: {
settings: XY_OVERRIDES.settings,
},
dataViewOrigin: 'metrics',
};
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,12 @@ export { memoryFree } from './memory_free';
export { memoryUsed } from './memory_used';
export { memoryFreeExcludingCache } from './memory_free_excluding_cache';
export { memoryCache } from './memory_cache';
export { nginxRequestRate } from './nginx_request_rate';
export { nginxActiveConnections } from './nginx_active_connections';
export { nginxRequestsPerConnection } from './nginx_requests_per_connection';
export { nginxSuccessStatusCodes } from './nginx_success_status_codes';
export { nginxRedirectStatusCodes } from './nginx_redirect_status_codes';
export { nginxClientErrorStatusCodes } from './nginx_client_error_status_codes';
export { nginxServerErrorStatusCodes } from './nginx_server_error_status_codes';
export { rx } from './rx';
export { tx } from './tx';
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* 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 type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';

export const nginxActiveConnections: FormulaValueConfig = {
label: 'Active Connections',
value: 'average(nginx.stubstatus.active)',
format: {
id: 'number',
params: {
decimals: 0,
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* 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 type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
import { defaultPalette, Color } from '../../../../../../common/color_palette';

export const nginxClientErrorStatusCodes: FormulaValueConfig = {
label: '400-499',
value: `count(kql='http.response.status_code >= 400 and http.response.status_code <= 499')`,
format: {
id: 'number',
params: {
decimals: 0,
},
},
color: defaultPalette[Color.color5],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* 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 type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
import { defaultPalette, Color } from '../../../../../../common/color_palette';

export const nginxRedirectStatusCodes: FormulaValueConfig = {
label: '300-399',
value: `count(kql='http.response.status_code >= 300 and http.response.status_code <= 399')`,
format: {
id: 'number',
params: {
decimals: 0,
},
},
color: defaultPalette[Color.color0],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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 type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';

export const nginxRequestRate: FormulaValueConfig = {
label: 'Request Rate',
value: 'differences(max(nginx.stubstatus.requests))',
format: {
id: 'number',
params: {
decimals: 0,
},
},
timeScale: 's',
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* 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 type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';

export const nginxRequestsPerConnection: FormulaValueConfig = {
label: 'Requests Per Connection',
value: 'max(nginx.stubstatus.requests) / max(nginx.stubstatus.handled)',
format: {
id: 'number',
params: {
decimals: 0,
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* 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 type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
import { defaultPalette, Color } from '../../../../../../common/color_palette';

export const nginxServerErrorStatusCodes: FormulaValueConfig = {
label: '500-599',
value: `count(kql='http.response.status_code >= 500 and http.response.status_code <= 599')`,
format: {
id: 'number',
params: {
decimals: 0,
},
},
color: defaultPalette[Color.color1],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* 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 type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';
import { defaultPalette, Color } from '../../../../../../common/color_palette';

export const nginxSuccessStatusCodes: FormulaValueConfig = {
label: '200-299',
value: `count(kql='http.response.status_code >= 200 and http.response.status_code <= 299')`,
format: {
id: 'number',
params: {
decimals: 0,
},
},
color: defaultPalette[Color.color2],
};
Loading

0 comments on commit a4136be

Please sign in to comment.