mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
# Backport This will backport the following commits from `main` to `8.11`: - [[Synthetics] Advanced fields broken for icmp monitors (#171161)](https://github.com/elastic/kibana/pull/171161) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Shahzad","email":"shahzad31comp@gmail.com"},"sourceCommit":{"committedDate":"2023-11-15T17:12:15Z","message":"[Synthetics] Advanced fields broken for icmp monitors (#171161)","sha":"b356231d02f65afded09f1c9a44bf0218738e1ac","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:uptime","backport:prev-minor","v8.12.0"],"number":171161,"url":"https://github.com/elastic/kibana/pull/171161","mergeCommit":{"message":"[Synthetics] Advanced fields broken for icmp monitors (#171161)","sha":"b356231d02f65afded09f1c9a44bf0218738e1ac"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/171161","number":171161,"mergeCommit":{"message":"[Synthetics] Advanced fields broken for icmp monitors (#171161)","sha":"b356231d02f65afded09f1c9a44bf0218738e1ac"}}]}] BACKPORT--> Co-authored-by: Shahzad <shahzad31comp@gmail.com>
This commit is contained in:
parent
03bdf83b7b
commit
5dbb0c4a3d
1 changed files with 4 additions and 4 deletions
|
@ -18,23 +18,23 @@ import {
|
|||
DataStream,
|
||||
DataStreamCodec,
|
||||
HTTPFieldsCodec,
|
||||
ICMPSimpleFieldsCodec,
|
||||
MonitorFields,
|
||||
TCPFieldsCodec,
|
||||
SyntheticsMonitor,
|
||||
Locations,
|
||||
ICMPFieldsCodec,
|
||||
} from '../../../common/runtime_types';
|
||||
|
||||
import { ALLOWED_SCHEDULES_IN_MINUTES } from '../../../common/constants/monitor_defaults';
|
||||
|
||||
type MonitorCodecType =
|
||||
| typeof ICMPSimpleFieldsCodec
|
||||
| typeof ICMPFieldsCodec
|
||||
| typeof TCPFieldsCodec
|
||||
| typeof HTTPFieldsCodec
|
||||
| typeof BrowserFieldsCodec;
|
||||
|
||||
const monitorTypeToCodecMap: Record<DataStream, MonitorCodecType> = {
|
||||
[DataStream.ICMP]: ICMPSimpleFieldsCodec,
|
||||
[DataStream.ICMP]: ICMPFieldsCodec,
|
||||
[DataStream.TCP]: TCPFieldsCodec,
|
||||
[DataStream.HTTP]: HTTPFieldsCodec,
|
||||
[DataStream.BROWSER]: BrowserFieldsCodec,
|
||||
|
@ -67,7 +67,7 @@ export function validateMonitor(monitorFields: MonitorFields): ValidationResult
|
|||
}
|
||||
|
||||
// Cast it to ICMPCodec to satisfy typing. During runtime, correct codec will be used to decode.
|
||||
const SyntheticsMonitorCodec = monitorTypeToCodecMap[monitorType] as typeof ICMPSimpleFieldsCodec;
|
||||
const SyntheticsMonitorCodec = monitorTypeToCodecMap[monitorType] as typeof ICMPFieldsCodec;
|
||||
|
||||
if (!SyntheticsMonitorCodec) {
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue