[8.6] [APM] Disable service metrics and remove the option to enable it in settings (#146376) (#146511)

# Backport

This will backport the following commits from `main` to `8.6`:
- [[APM] Disable service metrics and remove the option to enable it in
settings (#146376)](https://github.com/elastic/kibana/pull/146376)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Katerina
Patticha","email":"aikaterini.patticha@elastic.co"},"sourceCommit":{"committedDate":"2022-11-29T09:45:53Z","message":"[APM]
Disable service metrics and remove the option to enable it in settings
(#146376)\n\n## Summary\r\ncloses
https://github.com/elastic/kibana/issues/145745 \r\n\r\nThe feature
Service Metrics was released and marked as a technical\r\npreview in 8.5
and it was disabled by default.\r\n\r\nAs we expect to have some
breaking changes in the following releases, we\r\ndisable and remove the
feature so it would simplify the
backward\r\ncompatibility.\r\n\r\n\r\nThe PR includes:\r\n1. Disable
service metrics\r\n2. Remove the option to enable it from labs and
advanced
settings.","sha":"77659389cf09e823b6802adbc6bb4c502ee259d2","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:APM","release_note:skip","v8.5.0","v8.6.0","v8.7.0"],"number":146376,"url":"https://github.com/elastic/kibana/pull/146376","mergeCommit":{"message":"[APM]
Disable service metrics and remove the option to enable it in settings
(#146376)\n\n## Summary\r\ncloses
https://github.com/elastic/kibana/issues/145745 \r\n\r\nThe feature
Service Metrics was released and marked as a technical\r\npreview in 8.5
and it was disabled by default.\r\n\r\nAs we expect to have some
breaking changes in the following releases, we\r\ndisable and remove the
feature so it would simplify the
backward\r\ncompatibility.\r\n\r\n\r\nThe PR includes:\r\n1. Disable
service metrics\r\n2. Remove the option to enable it from labs and
advanced
settings.","sha":"77659389cf09e823b6802adbc6bb4c502ee259d2"}},"sourceBranch":"main","suggestedTargetBranches":["8.5","8.6"],"targetPullRequestStates":[{"branch":"8.5","label":"v8.5.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/146376","number":146376,"mergeCommit":{"message":"[APM]
Disable service metrics and remove the option to enable it in settings
(#146376)\n\n## Summary\r\ncloses
https://github.com/elastic/kibana/issues/145745 \r\n\r\nThe feature
Service Metrics was released and marked as a technical\r\npreview in 8.5
and it was disabled by default.\r\n\r\nAs we expect to have some
breaking changes in the following releases, we\r\ndisable and remove the
feature so it would simplify the
backward\r\ncompatibility.\r\n\r\n\r\nThe PR includes:\r\n1. Disable
service metrics\r\n2. Remove the option to enable it from labs and
advanced
settings.","sha":"77659389cf09e823b6802adbc6bb4c502ee259d2"}}]}]
BACKPORT-->

Co-authored-by: Katerina Patticha <aikaterini.patticha@elastic.co>
This commit is contained in:
Kibana Machine 2022-11-29 12:15:26 -05:00 committed by GitHub
parent c406470f7f
commit 0bfeb4989a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 29 deletions

View file

@ -7,7 +7,6 @@
import Boom from '@hapi/boom';
import { isoToEpochRt, jsonRt, toNumberRt } from '@kbn/io-ts-utils';
import { enableServiceMetrics } from '@kbn/observability-plugin/common';
import * as t from 'io-ts';
import { uniq, mergeWith } from 'lodash';
import {
@ -126,7 +125,6 @@ const servicesRoute = createApmServerRoute({
probability,
} = params.query;
const savedObjectsClient = (await context.core).savedObjects.client;
const coreContext = await resources.context.core;
const [mlClient, apmEventClient, serviceGroup, randomSampler] =
await Promise.all([
@ -138,12 +136,9 @@ const servicesRoute = createApmServerRoute({
getRandomSampler({ security, request, probability }),
]);
const serviceMetricsEnabled =
await coreContext.uiSettings.client.get<boolean>(enableServiceMetrics);
const { searchAggregatedTransactions, searchAggregatedServiceMetrics } =
await getServiceInventorySearchSource({
serviceMetricsEnabled,
serviceMetricsEnabled: false, // Disable serviceMetrics for 8.5 & 8.6
config,
apmEventClient,
kuery,
@ -220,7 +215,6 @@ const servicesDetailedStatisticsRoute = createApmServerRoute({
request,
plugins: { security },
} = resources;
const coreContext = await resources.context.core;
const { environment, kuery, offset, start, end, probability } =
params.query;
@ -232,12 +226,9 @@ const servicesDetailedStatisticsRoute = createApmServerRoute({
getRandomSampler({ security, request, probability }),
]);
const serviceMetricsEnabled =
await coreContext.uiSettings.client.get<boolean>(enableServiceMetrics);
const { searchAggregatedTransactions, searchAggregatedServiceMetrics } =
await getServiceInventorySearchSource({
serviceMetricsEnabled,
serviceMetricsEnabled: false, // Disable serviceMetrics for 8.5 & 8.6
config,
apmEventClient,
kuery,

View file

@ -24,7 +24,6 @@ export {
apmOperationsTab,
apmLabsButton,
enableInfrastructureHostsView,
enableServiceMetrics,
enableAwsLambdaMetrics,
enableAgentExplorerView,
apmAWSLambdaPriceFactor,

View file

@ -20,7 +20,6 @@ export const apmOperationsTab = 'observability:apmOperationsTab';
export const apmLabsButton = 'observability:apmLabsButton';
export const enableInfrastructureHostsView = 'observability:enableInfrastructureHostsView';
export const enableAwsLambdaMetrics = 'observability:enableAwsLambdaMetrics';
export const enableServiceMetrics = 'observability:apmEnableServiceMetrics';
export const enableAgentExplorerView = 'observability:apmAgentExplorerView';
export const apmAWSLambdaPriceFactor = 'observability:apmAWSLambdaPriceFactor';
export const apmAWSLambdaRequestCostPerMillion = 'observability:apmAWSLambdaRequestCostPerMillion';

View file

@ -27,7 +27,6 @@ import {
apmAWSLambdaRequestCostPerMillion,
enableCriticalPath,
enableInfrastructureHostsView,
enableServiceMetrics,
} from '../common/ui_settings_keys';
const technicalPreviewLabel = i18n.translate(
@ -165,21 +164,6 @@ export const uiSettings: Record<string, UiSettings> = {
},
showInLabs: true,
},
[enableServiceMetrics]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.apmEnableServiceMetrics', {
defaultMessage: 'Service metrics',
}),
value: false,
description: i18n.translate('xpack.observability.apmEnableServiceMetricsGroupsDescription', {
defaultMessage:
'{technicalPreviewLabel} Enables Service metrics. When is enabled, additional configuration in APM Server is required.',
values: { technicalPreviewLabel: `<em>[${technicalPreviewLabel}]</em>` },
}),
schema: schema.boolean(),
requiresPageReload: true,
showInLabs: true,
},
[apmServiceInventoryOptimizedSorting]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.apmServiceInventoryOptimizedSorting', {