Cleanup of field_names folder (#161838)

## Summary

This is a cleanup PR that moves Synthetics fields from the Observability
app to the Observability Shared app.
This commit is contained in:
Coen Warmer 2023-07-18 15:25:58 +02:00 committed by GitHub
parent a1090ed1e4
commit af4a047006
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 23 additions and 111 deletions

View file

@ -1,11 +0,0 @@
/*
* 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.
*/
export const SYSTEM_CPU_PERCENTAGE_FIELD = 'system.cpu.total.norm.pct';
export const SYSTEM_MEMORY_PERCENTAGE_FIELD = 'system.memory.used.pct';
export const DOCKER_CPU_PERCENTAGE_FIELD = 'docker.cpu.total.pct';
export const K8S_POD_CPU_PERCENTAGE_FIELD = 'kubernetes.pod.cpu.usage.node.pct';

View file

@ -5,15 +5,4 @@
* 2.0.
*/
export {
NETWORK_TIMINGS_FIELDS,
SYNTHETICS_BLOCKED_TIMINGS,
SYNTHETICS_CONNECT_TIMINGS,
SYNTHETICS_DNS_TIMINGS,
SYNTHETICS_RECEIVE_TIMINGS,
SYNTHETICS_SEND_TIMINGS,
SYNTHETICS_SSL_TIMINGS,
SYNTHETICS_STEP_DURATION,
SYNTHETICS_TOTAL_TIMINGS,
SYNTHETICS_WAIT_TIMINGS,
} from './field_names/synthetics';
export {};

View file

@ -3,12 +3,7 @@
"compilerOptions": {
"outDir": "target/types"
},
"include": [
"common/**/*",
"public/**/*",
"public/**/*.json",
"../../../typings/**/*"
],
"include": ["common/**/*", "public/**/*", "public/**/*.json", "../../../typings/**/*"],
"kbn_references": [
"@kbn/core",
"@kbn/data-plugin",

View file

@ -1,10 +0,0 @@
/*
* 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 { DOCUMENT_FIELD_NAME } from '@kbn/lens-plugin/common';
export const LOG_RATE = DOCUMENT_FIELD_NAME;

View file

@ -1,14 +0,0 @@
/*
* 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.
*/
export const SYSTEM_CPU_PERCENTAGE_FIELD = 'system.cpu.total.norm.pct';
export const SYSTEM_MEMORY_PERCENTAGE_FIELD = 'system.memory.used.pct';
export const DOCKER_CPU_PERCENTAGE_FIELD = 'docker.cpu.total.pct';
export const K8S_POD_CPU_PERCENTAGE_FIELD = 'kubernetes.pod.cpu.usage.node.pct';
export const SLO_ID_FIELD = 'slo.id';
export const SLO_REVISION_FIELD = 'slo.revision';

View file

@ -5,6 +5,5 @@
* 2.0.
*/
import { DOCUMENT_FIELD_NAME } from '@kbn/lens-plugin/common';
export const LOG_RATE = DOCUMENT_FIELD_NAME;
export const SLO_ID_FIELD = 'slo.id';
export const SLO_REVISION_FIELD = 'slo.revision';

View file

@ -1,35 +0,0 @@
/*
* 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.
*/
export const MONITOR_DURATION_US = 'monitor.duration.us';
export const SYNTHETICS_CLS = 'browser.experience.cls';
export const SYNTHETICS_LCP = 'browser.experience.lcp.us';
export const SYNTHETICS_FCP = 'browser.experience.fcp.us';
export const SYNTHETICS_DOCUMENT_ONLOAD = 'browser.experience.load.us';
export const SYNTHETICS_DCL = 'browser.experience.dcl.us';
export const SYNTHETICS_STEP_NAME = 'synthetics.step.name.keyword';
export const SYNTHETICS_STEP_DURATION = 'synthetics.step.duration.us';
export const SYNTHETICS_DNS_TIMINGS = 'synthetics.payload.timings.dns';
export const SYNTHETICS_SSL_TIMINGS = 'synthetics.payload.timings.ssl';
export const SYNTHETICS_BLOCKED_TIMINGS = 'synthetics.payload.timings.blocked';
export const SYNTHETICS_CONNECT_TIMINGS = 'synthetics.payload.timings.connect';
export const SYNTHETICS_RECEIVE_TIMINGS = 'synthetics.payload.timings.receive';
export const SYNTHETICS_SEND_TIMINGS = 'synthetics.payload.timings.send';
export const SYNTHETICS_WAIT_TIMINGS = 'synthetics.payload.timings.wait';
export const SYNTHETICS_TOTAL_TIMINGS = 'synthetics.payload.timings.total';
export const NETWORK_TIMINGS_FIELDS = [
SYNTHETICS_DNS_TIMINGS,
SYNTHETICS_SSL_TIMINGS,
SYNTHETICS_BLOCKED_TIMINGS,
SYNTHETICS_CONNECT_TIMINGS,
SYNTHETICS_RECEIVE_TIMINGS,
SYNTHETICS_SEND_TIMINGS,
SYNTHETICS_WAIT_TIMINGS,
SYNTHETICS_TOTAL_TIMINGS,
];

View file

@ -69,17 +69,4 @@ export const sloEditLocatorID = 'SLO_EDIT_LOCATOR';
export type { AlertsLocatorParams } from './locators/alerts';
export {
NETWORK_TIMINGS_FIELDS,
SYNTHETICS_BLOCKED_TIMINGS,
SYNTHETICS_CONNECT_TIMINGS,
SYNTHETICS_DNS_TIMINGS,
SYNTHETICS_RECEIVE_TIMINGS,
SYNTHETICS_SEND_TIMINGS,
SYNTHETICS_SSL_TIMINGS,
SYNTHETICS_STEP_DURATION,
SYNTHETICS_TOTAL_TIMINGS,
SYNTHETICS_WAIT_TIMINGS,
} from './field_names/synthetics';
export { CoPilotPromptId, loadCoPilotPrompts } from './co_pilot';

View file

@ -9,7 +9,7 @@ import { lazy } from 'react';
import { i18n } from '@kbn/i18n';
import { ALERT_REASON } from '@kbn/rule-data-utils';
import { SLO_ID_FIELD } from '../../common/field_names/infra_metrics';
import { SLO_ID_FIELD } from '../../common/field_names/slo';
import { ConfigSchema } from '../plugin';
import { ObservabilityRuleTypeRegistry } from './create_observability_rule_type_registry';
import {

View file

@ -44,7 +44,7 @@ import {
BurnRateRuleParams,
AlertStates,
} from './types';
import { SLO_ID_FIELD, SLO_REVISION_FIELD } from '../../../../common/field_names/infra_metrics';
import { SLO_ID_FIELD, SLO_REVISION_FIELD } from '../../../../common/field_names/slo';
import { SLONotFound } from '../../../errors';
import { SO_SLO_TYPE } from '../../../saved_objects';
import { sloSchema } from '@kbn/slo-schema';

View file

@ -20,7 +20,7 @@ import { LocatorPublic } from '@kbn/share-plugin/common';
import { memoize, last, upperCase } from 'lodash';
import { addSpaceIdToPath } from '@kbn/spaces-plugin/server';
import { AlertsLocatorParams, getAlertUrl } from '../../../../common';
import { SLO_ID_FIELD, SLO_REVISION_FIELD } from '../../../../common/field_names/infra_metrics';
import { SLO_ID_FIELD, SLO_REVISION_FIELD } from '../../../../common/field_names/slo';
import { Duration, SLO, toDurationUnit } from '../../../domain/models';
import { DefaultSLIClient, KibanaSavedObjectsSLORepository } from '../../../services/slo';
import { computeBurnRate } from '../../../domain/services';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { SLO_ID_FIELD, SLO_REVISION_FIELD } from '../../../../common/field_names/infra_metrics';
import { SLO_ID_FIELD, SLO_REVISION_FIELD } from '../../../../common/field_names/slo';
export const sloRuleFieldMap = {
[SLO_ID_FIELD]: {

View file

@ -121,7 +121,19 @@ export {
PROFILE_ALLOC_SPACE,
PROFILE_INUSE_OBJECTS,
PROFILE_INUSE_SPACE,
} from './elasticsearch_fieldnames';
} from './field_names/elasticsearch';
export {
NETWORK_TIMINGS_FIELDS,
SYNTHETICS_BLOCKED_TIMINGS,
SYNTHETICS_CONNECT_TIMINGS,
SYNTHETICS_DNS_TIMINGS,
SYNTHETICS_RECEIVE_TIMINGS,
SYNTHETICS_SEND_TIMINGS,
SYNTHETICS_SSL_TIMINGS,
SYNTHETICS_TOTAL_TIMINGS,
SYNTHETICS_WAIT_TIMINGS,
} from './field_names/synthetics';
export { ObservabilityTriggerId } from './trigger_ids';
export { getInspectResponse } from './utils/get_inspect_response';

View file

@ -17,7 +17,7 @@ import {
SYNTHETICS_SSL_TIMINGS,
SYNTHETICS_TOTAL_TIMINGS,
SYNTHETICS_WAIT_TIMINGS,
} from '@kbn/observability-plugin/common';
} from '@kbn/observability-shared-plugin/common';
import { SYNTHETICS_INDEX_PATTERN } from '../../../../../../common/constants';
import { useReduxEsSearch } from '../../../hooks/use_redux_es_search';

View file

@ -17,7 +17,7 @@ import {
SYNTHETICS_SSL_TIMINGS,
SYNTHETICS_TOTAL_TIMINGS,
SYNTHETICS_WAIT_TIMINGS,
} from '@kbn/observability-plugin/common';
} from '@kbn/observability-shared-plugin/common';
import moment from 'moment';
import { useJourneySteps } from '../../monitor_details/hooks/use_journey_steps';
import { SYNTHETICS_INDEX_PATTERN } from '../../../../../../common/constants';