-
Notifications
You must be signed in to change notification settings - Fork 8.3k
/
Copy pathui_settings.ts
540 lines (533 loc) · 20.6 KB
/
ui_settings.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
/*
* 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 { schema } from '@kbn/config-schema';
import { UiSettingsParams } from '@kbn/core/types';
import { i18n } from '@kbn/i18n';
import { observabilityFeatureId, ProgressiveLoadingQuality } from '../common';
import {
enableComparisonByDefault,
enableInspectEsQueries,
maxSuggestions,
defaultApmServiceEnvironment,
apmProgressiveLoading,
apmServiceInventoryOptimizedSorting,
apmServiceGroupMaxNumberOfServices,
apmTraceExplorerTab,
apmLabsButton,
enableAgentExplorerView,
apmEnableTableSearchBar,
enableAwsLambdaMetrics,
apmAWSLambdaPriceFactor,
apmAWSLambdaRequestCostPerMillion,
apmEnableServiceMetrics,
apmEnableContinuousRollups,
enableCriticalPath,
enableInfrastructureHostsView,
syntheticsThrottlingEnabled,
enableLegacyUptimeApp,
apmEnableProfilingIntegration,
profilingCo2PerKWH,
profilingDatacenterPUE,
profilingPervCPUWattX86,
profilingPervCPUWattArm64,
profilingAWSCostDiscountRate,
profilingCostPervCPUPerHour,
enableInfrastructureProfilingIntegration,
} from '../common/ui_settings_keys';
const betaLabel = i18n.translate('xpack.observability.uiSettings.betaLabel', {
defaultMessage: 'beta',
});
const technicalPreviewLabel = i18n.translate(
'xpack.observability.uiSettings.technicalPreviewLabel',
{ defaultMessage: 'technical preview' }
);
type UiSettings = UiSettingsParams<boolean | number | string | object> & { showInLabs?: boolean };
/**
* uiSettings definitions for Observability.
*/
export const uiSettings: Record<string, UiSettings> = {
[enableInspectEsQueries]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.enableInspectEsQueriesExperimentName', {
defaultMessage: 'Inspect ES queries',
}),
value: false,
description: i18n.translate('xpack.observability.enableInspectEsQueriesExperimentDescription', {
defaultMessage: 'Inspect Elasticsearch queries in API responses.',
}),
schema: schema.boolean(),
requiresPageReload: true,
},
[maxSuggestions]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.maxSuggestionsUiSettingName', {
defaultMessage: 'Maximum suggestions',
}),
value: 100,
description: i18n.translate('xpack.observability.maxSuggestionsUiSettingDescription', {
defaultMessage: 'Maximum number of suggestions fetched in autocomplete selection boxes.',
}),
schema: schema.number(),
},
[enableComparisonByDefault]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.enableComparisonByDefault', {
defaultMessage: 'Comparison feature',
}),
value: true,
description: i18n.translate('xpack.observability.enableComparisonByDefaultDescription', {
defaultMessage:
'Determines whether the comparison feature is enabled or disabled by default in the APM app.',
}),
schema: schema.boolean(),
},
[defaultApmServiceEnvironment]: {
category: [observabilityFeatureId],
sensitive: true,
name: i18n.translate('xpack.observability.defaultApmServiceEnvironment', {
defaultMessage: 'Default service environment',
}),
description: i18n.translate('xpack.observability.defaultApmServiceEnvironmentDescription', {
defaultMessage:
'Set the default environment for the APM app. When left empty, data from all environments will be displayed by default.',
}),
value: '',
schema: schema.string(),
},
[apmProgressiveLoading]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.apmProgressiveLoading', {
defaultMessage: 'Use progressive loading of selected APM views',
}),
description: i18n.translate('xpack.observability.apmProgressiveLoadingDescription', {
defaultMessage:
'{technicalPreviewLabel} Whether to load data progressively for APM views. Data may be requested with a lower sampling rate first, with lower accuracy but faster response times, while the unsampled data loads in the background',
values: { technicalPreviewLabel: `<em>[${technicalPreviewLabel}]</em>` },
}),
value: ProgressiveLoadingQuality.off,
schema: schema.oneOf([
schema.literal(ProgressiveLoadingQuality.off),
schema.literal(ProgressiveLoadingQuality.low),
schema.literal(ProgressiveLoadingQuality.medium),
schema.literal(ProgressiveLoadingQuality.high),
]),
requiresPageReload: false,
type: 'select',
options: [
ProgressiveLoadingQuality.off,
ProgressiveLoadingQuality.low,
ProgressiveLoadingQuality.medium,
ProgressiveLoadingQuality.high,
],
optionLabels: {
[ProgressiveLoadingQuality.off]: i18n.translate(
'xpack.observability.apmProgressiveLoadingQualityOff',
{
defaultMessage: 'Off',
}
),
[ProgressiveLoadingQuality.low]: i18n.translate(
'xpack.observability.apmProgressiveLoadingQualityLow',
{
defaultMessage: 'Low sampling rate (fastest, least accurate)',
}
),
[ProgressiveLoadingQuality.medium]: i18n.translate(
'xpack.observability.apmProgressiveLoadingQualityMedium',
{
defaultMessage: 'Medium sampling rate',
}
),
[ProgressiveLoadingQuality.high]: i18n.translate(
'xpack.observability.apmProgressiveLoadingQualityHigh',
{
defaultMessage: 'High sampling rate (slower, most accurate)',
}
),
},
showInLabs: true,
},
[apmServiceInventoryOptimizedSorting]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.apmServiceInventoryOptimizedSorting', {
defaultMessage: 'Optimize services list load performance in APM',
}),
description: i18n.translate(
'xpack.observability.apmServiceInventoryOptimizedSortingDescription',
{
defaultMessage:
'{technicalPreviewLabel} Default APM Service Inventory and Storage Explorer pages sort (for Services without Machine Learning applied) to sort by Service Name.',
values: {
technicalPreviewLabel: `<em>[${technicalPreviewLabel}]</em>`,
},
}
),
schema: schema.boolean(),
value: false,
requiresPageReload: false,
type: 'boolean',
showInLabs: true,
},
[apmServiceGroupMaxNumberOfServices]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.serviceGroupMaxServicesUiSettingName', {
defaultMessage: 'Maximum services in a service group',
}),
value: 500,
description: i18n.translate('xpack.observability.serviceGroupMaxServicesUiSettingDescription', {
defaultMessage: 'Limit the number of services in a given service group',
}),
schema: schema.number({ min: 1 }),
},
[apmTraceExplorerTab]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.apmTraceExplorerTab', {
defaultMessage: 'APM Trace Explorer',
}),
description: i18n.translate('xpack.observability.apmTraceExplorerTabDescription', {
defaultMessage:
'{technicalPreviewLabel} Enable the APM Trace Explorer feature, that allows you to search and inspect traces with KQL or EQL. {link}',
values: {
technicalPreviewLabel: `<em>[${technicalPreviewLabel}]</em>`,
link: traceExplorerDocsLink({
href: 'https://www.elastic.co/guide/en/kibana/master/traces.html#trace-explorer',
}),
},
}),
schema: schema.boolean(),
value: true,
requiresPageReload: true,
type: 'boolean',
showInLabs: true,
},
[apmLabsButton]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.apmLabs', {
defaultMessage: 'Enable labs button in APM',
}),
description: i18n.translate('xpack.observability.apmLabsDescription', {
defaultMessage:
'This flag determines if the viewer has access to the Labs button, a quick way to enable and disable technical preview features in APM.',
}),
schema: schema.boolean(),
value: false,
requiresPageReload: true,
type: 'boolean',
},
[enableInfrastructureHostsView]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.enableInfrastructureHostsView', {
defaultMessage: 'Infrastructure Hosts view',
}),
value: true,
description: i18n.translate('xpack.observability.enableInfrastructureHostsViewDescription', {
defaultMessage: '{betaLabel} Enable the Hosts view in the Infrastructure app.',
values: {
betaLabel: `<em>[${betaLabel}]</em>`,
},
}),
schema: schema.boolean(),
},
[enableInfrastructureProfilingIntegration]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.enableInfrastructureProfilingIntegration', {
defaultMessage: 'Universal Profiling integration in Infrastructure',
}),
value: true,
description: i18n.translate(
'xpack.observability.enableInfrastructureProfilingIntegrationDescription',
{
defaultMessage: 'Enable Universal Profiling integration in the Infrastructure app.',
}
),
schema: schema.boolean(),
},
[enableAwsLambdaMetrics]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.enableAwsLambdaMetrics', {
defaultMessage: 'AWS Lambda Metrics',
}),
description: i18n.translate('xpack.observability.enableAwsLambdaMetricsDescription', {
defaultMessage:
'{technicalPreviewLabel} Display Amazon Lambda metrics in the service metrics tab.',
values: {
technicalPreviewLabel: `<em>[${technicalPreviewLabel}]</em>`,
},
}),
schema: schema.boolean(),
value: true,
requiresPageReload: true,
type: 'boolean',
showInLabs: true,
},
[enableAgentExplorerView]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.enableAgentExplorer', {
defaultMessage: 'Agent explorer',
}),
description: i18n.translate('xpack.observability.enableAgentExplorerDescription', {
defaultMessage: '{betaLabel} Enables Agent explorer view.',
values: {
betaLabel: `<em>[${betaLabel}]</em>`,
},
}),
schema: schema.boolean(),
value: true,
requiresPageReload: true,
type: 'boolean',
},
[apmEnableTableSearchBar]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.apmEnableTableSearchBar', {
defaultMessage: 'Instant table search',
}),
description: i18n.translate('xpack.observability.apmEnableTableSearchBarDescription', {
defaultMessage:
'{betaLabel} Enables faster searching in APM tables by adding a handy search bar with live filtering. Available for the following tables: Services, Transactions and Errors',
values: {
betaLabel: `<em>[${betaLabel}]</em>`,
},
}),
schema: schema.boolean(),
value: true,
requiresPageReload: true,
type: 'boolean',
},
[apmAWSLambdaPriceFactor]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.apmAWSLambdaPricePerGbSeconds', {
defaultMessage: 'AWS lambda price factor',
}),
type: 'json',
value: JSON.stringify({ x86_64: 0.0000166667, arm: 0.0000133334 }, null, 2),
description: i18n.translate('xpack.observability.apmAWSLambdaPricePerGbSecondsDescription', {
defaultMessage: 'Price per Gb-second.',
}),
schema: schema.object({
arm: schema.number(),
x86_64: schema.number(),
}),
},
[apmAWSLambdaRequestCostPerMillion]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.apmAWSLambdaRequestCostPerMillion', {
defaultMessage: 'AWS lambda price per 1M requests',
}),
value: 0.2,
schema: schema.number({ min: 0 }),
},
[apmEnableServiceMetrics]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.apmEnableServiceMetrics', {
defaultMessage: 'Service transaction metrics',
}),
value: true,
description: i18n.translate('xpack.observability.apmEnableServiceMetricsDescription', {
defaultMessage:
'{betaLabel} Enables the usage of service transaction metrics, which are low cardinality metrics that can be used by certain views like the service inventory for faster loading times.',
values: { betaLabel: `<em>[${betaLabel}]</em>` },
}),
schema: schema.boolean(),
requiresPageReload: true,
},
[apmEnableContinuousRollups]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.apmEnableContinuousRollups', {
defaultMessage: 'Continuous rollups',
}),
value: true,
description: i18n.translate('xpack.observability.apmEnableContinuousRollupsDescription', {
defaultMessage:
'{betaLabel} When continuous rollups is enabled, the UI will select metrics with the appropriate resolution. On larger time ranges, lower resolution metrics will be used, which will improve loading times.',
values: { betaLabel: `<em>[${betaLabel}]</em>` },
}),
schema: schema.boolean(),
requiresPageReload: true,
},
[enableCriticalPath]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.enableCriticalPath', {
defaultMessage: 'Critical path',
}),
description: i18n.translate('xpack.observability.enableCriticalPathDescription', {
defaultMessage: '{technicalPreviewLabel} Optionally display the critical path of a trace.',
values: {
technicalPreviewLabel: `<em>[${technicalPreviewLabel}]</em>`,
},
}),
schema: schema.boolean(),
value: false,
requiresPageReload: true,
type: 'boolean',
showInLabs: true,
},
[syntheticsThrottlingEnabled]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.syntheticsThrottlingEnabledExperimentName', {
defaultMessage: 'Enable Synthetics throttling (Experimental)',
}),
value: false,
description: i18n.translate(
'xpack.observability.syntheticsThrottlingEnabledExperimentDescription',
{
defaultMessage:
'Enable the throttling setting in Synthetics monitor configurations. Note that throttling may still not be available for your monitors even if the setting is active. Intended for internal use only. {link}',
values: {
link: throttlingDocsLink({
href: 'https://github.com/elastic/synthetics/blob/main/docs/throttling.md',
}),
},
}
),
schema: schema.boolean(),
requiresPageReload: true,
},
[enableLegacyUptimeApp]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.enableLegacyUptimeApp', {
defaultMessage: 'Always show legacy Uptime app',
}),
value: false,
description: i18n.translate('xpack.observability.enableLegacyUptimeAppDescription', {
defaultMessage:
"By default, the legacy Uptime app is hidden from the interface when it doesn't have any data for more than a week. Enable this option to always show it.",
}),
schema: schema.boolean(),
requiresPageReload: true,
},
[apmEnableProfilingIntegration]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.apmEnableProfilingIntegration', {
defaultMessage: 'Enable Universal Profiling integration in APM',
}),
value: true,
schema: schema.boolean(),
requiresPageReload: false,
},
[profilingPervCPUWattX86]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.profilingPervCPUWattX86UiSettingName', {
defaultMessage: 'Per vCPU Watts - x86',
}),
value: 7,
description: i18n.translate('xpack.observability.profilingPervCPUWattX86UiSettingDescription', {
defaultMessage: `The average amortized per-core power consumption (based on 100% CPU utilization) for x86 architecture.`,
}),
schema: schema.number({ min: 0 }),
requiresPageReload: true,
},
[profilingPervCPUWattArm64]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.profilingPervCPUWattArm64UiSettingName', {
defaultMessage: 'Per vCPU Watts - arm64',
}),
value: 2.8,
description: i18n.translate(
'xpack.observability.profilingPervCPUWattArm64UiSettingDescription',
{
defaultMessage: `The average amortized per-core power consumption (based on 100% CPU utilization) for arm64 architecture.`,
}
),
schema: schema.number({ min: 0 }),
requiresPageReload: true,
},
[profilingDatacenterPUE]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.profilingDatacenterPUEUiSettingName', {
defaultMessage: 'Data Center PUE',
}),
value: 1.7,
description: i18n.translate('xpack.observability.profilingDatacenterPUEUiSettingDescription', {
defaultMessage: `Data center power usage effectiveness (PUE) measures how efficiently a data center uses energy. Defaults to 1.7, the average on-premise data center PUE according to the {uptimeLink} survey
</br></br>
You can also use the PUE that corresponds with your cloud provider:
<ul style="list-style-type: none;margin-left: 4px;">
<li><strong>AWS:</strong> 1.135</li>
<li><strong>GCP:</strong> 1.1</li>
<li><strong>Azure:</strong> 1.185</li>
</ul>
`,
values: {
uptimeLink:
'<a href="https://ela.st/uptimeinstitute" target="_blank" rel="noopener noreferrer">' +
i18n.translate(
'xpack.observability.profilingDatacenterPUEUiSettingDescription.uptimeLink',
{ defaultMessage: 'Uptime Institute' }
) +
'</a>',
},
}),
schema: schema.number({ min: 0 }),
requiresPageReload: true,
},
[profilingCo2PerKWH]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.profilingCo2PerKWHUiSettingName', {
defaultMessage: 'Regional Carbon Intensity (ton/kWh)',
}),
value: 0.000379069,
description: i18n.translate('xpack.observability.profilingCo2PerKWHUiSettingDescription', {
defaultMessage: `Carbon intensity measures how clean your data center electricity is.
Specifically, it measures the average amount of CO2 emitted per kilowatt-hour (kWh) of electricity consumed in a particular region.
Use the cloud carbon footprint {datasheetLink} to update this value according to your region. Defaults to US East (N. Virginia).`,
values: {
datasheetLink:
'<a href="https://ela.st/grid-datasheet" target="_blank" rel="noopener noreferrer">' +
i18n.translate(
'xpack.observability.profilingCo2PerKWHUiSettingDescription.datasheetLink',
{ defaultMessage: 'datasheet' }
) +
'</a>',
},
}),
schema: schema.number({ min: 0 }),
requiresPageReload: true,
},
[profilingAWSCostDiscountRate]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.profilingAWSCostDiscountRateUiSettingName', {
defaultMessage: 'AWS EDP discount rate (%)',
}),
value: 6,
schema: schema.number({ min: 0, max: 100 }),
requiresPageReload: true,
description: i18n.translate(
'xpack.observability.profilingAWSCostDiscountRateUiSettingDescription',
{
defaultMessage:
"If you're enrolled in the AWS Enterprise Discount Program (EDP), enter your discount rate to update the profiling cost calculation.",
}
),
},
[profilingCostPervCPUPerHour]: {
category: [observabilityFeatureId],
name: i18n.translate('xpack.observability.profilingCostPervCPUPerHourUiSettingName', {
defaultMessage: 'Cost per vCPU per hour ($)',
}),
value: 0.0425,
description: i18n.translate(
'xpack.observability.profilingCostPervCPUPerHourUiSettingNameDescription',
{
defaultMessage: `Default average cost per CPU core per hour (Non-AWS instances only)`,
}
),
schema: schema.number({ min: 0, max: 100 }),
requiresPageReload: true,
},
};
function throttlingDocsLink({ href }: { href: string }) {
return `<a href="${href}" target="_blank" rel="noopener noreferrer">${i18n.translate(
'xpack.observability.uiSettings.throttlingDocsLinkText',
{ defaultMessage: 'read notice here.' }
)}</a>`;
}
function traceExplorerDocsLink({ href }: { href: string }) {
return `<a href="${href}" target="_blank">${i18n.translate(
'xpack.observability.uiSettings.traceExplorerDocsLinkText',
{ defaultMessage: 'Learn more.' }
)}</a>`;
}