mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Synthetics] Advanced fields broken for icmp monitors (#171161)
This commit is contained in:
parent
733c06d798
commit
b356231d02
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