diff --git a/docs/apm/troubleshooting.asciidoc b/docs/apm/troubleshooting.asciidoc new file mode 100644 index 0000000000000..0e902e3608e72 --- /dev/null +++ b/docs/apm/troubleshooting.asciidoc @@ -0,0 +1,44 @@ +[[troubleshooting]] +=== Troubleshooting common problems + +If you have something to add to this section, please consider creating a pull request with +your proposed changes at https://github.com/elastic/kibana. + +Also check out the https://discuss.elastic.co/c/apm[APM discussion forum]. + +==== No APM data found + +This section can help with any of the following: + +* Data isn't displaying in the APM app +* You're seeing a message like "No Services Found", +* You're seeing errors like "Fielddata is disabled on text fields by default..." + +There are a number of factors that could be at play here. +One important thing to double-check first is your index template. + +An APM index template must exist for the APM app to work correctly. +By default, this index template is created by APM Server on startup. +However, this only happens if `setup.template.enabled` is `true` in `apm-server.yml`. +You can create the index template manually by running `apm-server setup`. +Take note that index templates *cannot* be applied retroactively -- they are only applied at index creation time. +More information is available in {apm-server-ref}/apm-server-configuration.html[Set up and configure]. + +You can check for the existence of an APM index template using the +{ref}/indices-get-template.html[Get index template API]. +If you're using the default index naming pattern, that request would be: + +[source,js] +-------------------------------------------------- +GET /_template/apm-{version} +-------------------------------------------------- +// CONSOLE + +If you're not outputting data directly from APM Server to Elasticsearch (perhaps you're using Logstash or Kafka), +then the index template will not be set up automatically. Instead, you'll need to +{apm-server-ref}/_manually_loading_template_configuration.html#load-template-manually-alternate[load the template manually]. + +Finally, this problem can also occur if you've changed the index name that you write APM data to. +The default index pattern can be found {apm-server-ref}/elasticsearch-output.html#index-option-es[here]. +If you change this setting, you must also configure the `setup.template.name` and `setup.template.pattern` options. +See {apm-server-ref}/configuration-template.html[Load the Elasticsearch index template]. diff --git a/docs/apm/using-the-apm-ui.asciidoc b/docs/apm/using-the-apm-ui.asciidoc index 570e4b26d68ed..818e4429d25af 100644 --- a/docs/apm/using-the-apm-ui.asciidoc +++ b/docs/apm/using-the-apm-ui.asciidoc @@ -35,3 +35,5 @@ include::metrics.asciidoc[] include::agent-configuration.asciidoc[] include::advanced-queries.asciidoc[] + +include::troubleshooting.asciidoc[] diff --git a/docs/developer/visualize/development-create-visualization.asciidoc b/docs/developer/visualize/development-create-visualization.asciidoc index bddcebcde3aa5..b782428b83135 100644 --- a/docs/developer/visualize/development-create-visualization.asciidoc +++ b/docs/developer/visualize/development-create-visualization.asciidoc @@ -64,7 +64,7 @@ The list of common parameters: - *responseHandler*: one of the available response handlers or a for a custom response handler - *editor*: one of the available editors or Editor class for custom one - *editorConfig*: object holding editor parameters -- *options.showTimePicker*: show or hide time picker (defaults to true) +- *options.showTimePicker*: show or hide time filter (defaults to true) - *options.showQueryBar*: show or hide query bar (defaults to true) - *options.showFilterBar*: show or hide filter bar (defaults to true) - *options.showIndexSelection*: show or hide index selection (defaults to true) @@ -275,7 +275,7 @@ VisTypesRegistryProvider.register(MyNewVisType); [[development-visualization-request-handlers]] === Visualization Request Handlers Request handler gets called when one of the following keys on AppState change: -`vis`, `query`, `filters` or `uiState` and when timepicker is updated. On top +`vis`, `query`, `filters` or `uiState` and when the time filter is updated. On top of that it will also get called on force refresh. By default visualizations will use the `courier` request handler. They can also choose to use any of the other provided @@ -417,7 +417,7 @@ The `vis` object holds the visualization state and is the window into kibana: - *vis.getUiState()*: gets UI state of visualization - *vis.uiStateVal(name, val)*: updates a property in UI state - *vis.isEditorMode()*: returns true if in editor mode -- *vis.API.timeFilter*: allows you to access time picker +- *vis.API.timeFilter*: allows you to access time filter - *vis.API.queryFilter*: gives you access to queryFilter - *vis.API.events.click*: default click handler - *vis.API.events.brush*: default brush handler @@ -430,12 +430,12 @@ visualization's render method. For the parameters that should not be saved with the visualization you should use the UI state. These hold viewer-specific state, such as popup open/closed, custom colors applied to the series etc. -You can access filter bar and time picker through the objects defined on `vis.API` +You can access the filter bar and time filter through the objects defined on `vis.API` [[development-vis-timefilter]] ==== timeFilter -Update the timefilter time values and call update() method on it to update time picker +Update the timefilter time values and call update() method on it to update the time filter ["source","js"] ----------- diff --git a/docs/development/core/server/kibana-plugin-server.apicaller.md b/docs/development/core/server/kibana-plugin-server.apicaller.md index 10065a4089ce5..9fd50ea5c4b66 100644 --- a/docs/development/core/server/kibana-plugin-server.apicaller.md +++ b/docs/development/core/server/kibana-plugin-server.apicaller.md @@ -2,11 +2,11 @@ [Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [APICaller](./kibana-plugin-server.apicaller.md) -## APICaller type +## APICaller interface Signature: ```typescript -export declare type APICaller = (endpoint: string, clientParams: Record, options?: CallAPIOptions) => Promise; +export interface APICaller ``` diff --git a/docs/development/core/server/kibana-plugin-server.assistanceapiresponse.indices.md b/docs/development/core/server/kibana-plugin-server.assistanceapiresponse.indices.md new file mode 100644 index 0000000000000..307cd3bb5ae21 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.assistanceapiresponse.indices.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [AssistanceAPIResponse](./kibana-plugin-server.assistanceapiresponse.md) > [indices](./kibana-plugin-server.assistanceapiresponse.indices.md) + +## AssistanceAPIResponse.indices property + +Signature: + +```typescript +indices: { + [indexName: string]: { + action_required: MIGRATION_ASSISTANCE_INDEX_ACTION; + }; + }; +``` diff --git a/docs/development/core/server/kibana-plugin-server.assistanceapiresponse.md b/docs/development/core/server/kibana-plugin-server.assistanceapiresponse.md new file mode 100644 index 0000000000000..8e8dfb07ca08a --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.assistanceapiresponse.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [AssistanceAPIResponse](./kibana-plugin-server.assistanceapiresponse.md) + +## AssistanceAPIResponse interface + +Signature: + +```typescript +export interface AssistanceAPIResponse +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [indices](./kibana-plugin-server.assistanceapiresponse.indices.md) | {
[indexName: string]: {
action_required: MIGRATION_ASSISTANCE_INDEX_ACTION;
};
} | | + diff --git a/docs/development/core/server/kibana-plugin-server.assistantapiclientparams.md b/docs/development/core/server/kibana-plugin-server.assistantapiclientparams.md new file mode 100644 index 0000000000000..eb03b943a30ef --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.assistantapiclientparams.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [AssistantAPIClientParams](./kibana-plugin-server.assistantapiclientparams.md) + +## AssistantAPIClientParams interface + +Signature: + +```typescript +export interface AssistantAPIClientParams extends GenericParams +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [method](./kibana-plugin-server.assistantapiclientparams.method.md) | 'GET' | | +| [path](./kibana-plugin-server.assistantapiclientparams.path.md) | '/_migration/assistance' | | + diff --git a/docs/development/core/server/kibana-plugin-server.assistantapiclientparams.method.md b/docs/development/core/server/kibana-plugin-server.assistantapiclientparams.method.md new file mode 100644 index 0000000000000..feeb4403ca0a3 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.assistantapiclientparams.method.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [AssistantAPIClientParams](./kibana-plugin-server.assistantapiclientparams.md) > [method](./kibana-plugin-server.assistantapiclientparams.method.md) + +## AssistantAPIClientParams.method property + +Signature: + +```typescript +method: 'GET'; +``` diff --git a/docs/development/core/server/kibana-plugin-server.assistantapiclientparams.path.md b/docs/development/core/server/kibana-plugin-server.assistantapiclientparams.path.md new file mode 100644 index 0000000000000..3b82c477993e0 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.assistantapiclientparams.path.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [AssistantAPIClientParams](./kibana-plugin-server.assistantapiclientparams.md) > [path](./kibana-plugin-server.assistantapiclientparams.path.md) + +## AssistantAPIClientParams.path property + +Signature: + +```typescript +path: '/_migration/assistance'; +``` diff --git a/docs/development/core/server/kibana-plugin-server.clusterclient.asscoped.md b/docs/development/core/server/kibana-plugin-server.clusterclient.asscoped.md index d649eab42f086..f87fc34bdc45f 100644 --- a/docs/development/core/server/kibana-plugin-server.clusterclient.asscoped.md +++ b/docs/development/core/server/kibana-plugin-server.clusterclient.asscoped.md @@ -9,7 +9,7 @@ Creates an instance of `ScopedClusterClient` based on the configuration the curr Signature: ```typescript -asScoped(request?: KibanaRequest | LegacyRequest | FakeRequest): ScopedClusterClient; +asScoped(request?: KibanaRequest | LegacyRequest | FakeRequest): IScopedClusterClient; ``` ## Parameters @@ -20,5 +20,5 @@ asScoped(request?: KibanaRequest | LegacyRequest | FakeRequest): ScopedClusterCl Returns: -`ScopedClusterClient` +`IScopedClusterClient` diff --git a/docs/development/core/server/kibana-plugin-server.clusterclient.callasinternaluser.md b/docs/development/core/server/kibana-plugin-server.clusterclient.callasinternaluser.md index 0b314c5670365..74003189c765d 100644 --- a/docs/development/core/server/kibana-plugin-server.clusterclient.callasinternaluser.md +++ b/docs/development/core/server/kibana-plugin-server.clusterclient.callasinternaluser.md @@ -9,5 +9,5 @@ Calls specified endpoint with provided clientParams on behalf of the Kibana inte Signature: ```typescript -callAsInternalUser: (endpoint: string, clientParams?: Record, options?: CallAPIOptions | undefined) => Promise; +callAsInternalUser: APICaller; ``` diff --git a/docs/development/core/server/kibana-plugin-server.clusterclient.md b/docs/development/core/server/kibana-plugin-server.clusterclient.md index a23b30fd184c6..6288bc0a07c11 100644 --- a/docs/development/core/server/kibana-plugin-server.clusterclient.md +++ b/docs/development/core/server/kibana-plugin-server.clusterclient.md @@ -6,10 +6,12 @@ Represents an Elasticsearch cluster API client and allows to call API on behalf of the internal Kibana user and the actual user that is derived from the request headers (via `asScoped(...)`). +See [ClusterClient](./kibana-plugin-server.clusterclient.md). + Signature: ```typescript -export declare class ClusterClient +export declare class ClusterClient implements IClusterClient ``` ## Constructors @@ -22,7 +24,7 @@ export declare class ClusterClient | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [callAsInternalUser](./kibana-plugin-server.clusterclient.callasinternaluser.md) | | (endpoint: string, clientParams?: Record<string, any>, options?: CallAPIOptions | undefined) => Promise<any> | Calls specified endpoint with provided clientParams on behalf of the Kibana internal user. | +| [callAsInternalUser](./kibana-plugin-server.clusterclient.callasinternaluser.md) | | APICaller | Calls specified endpoint with provided clientParams on behalf of the Kibana internal user. | ## Methods diff --git a/docs/development/core/server/kibana-plugin-server.coresetup.elasticsearch.md b/docs/development/core/server/kibana-plugin-server.coresetup.elasticsearch.md index cd99eabe1e1e5..dfe1839babdad 100644 --- a/docs/development/core/server/kibana-plugin-server.coresetup.elasticsearch.md +++ b/docs/development/core/server/kibana-plugin-server.coresetup.elasticsearch.md @@ -8,8 +8,8 @@ ```typescript elasticsearch: { - adminClient$: Observable; - dataClient$: Observable; - createClient: (type: string, clientConfig?: Partial) => ClusterClient; + adminClient$: Observable; + dataClient$: Observable; + createClient: (type: string, clientConfig?: Partial) => IClusterClient; }; ``` diff --git a/docs/development/core/server/kibana-plugin-server.coresetup.md b/docs/development/core/server/kibana-plugin-server.coresetup.md index 528557e91bd17..a53f807d001bd 100644 --- a/docs/development/core/server/kibana-plugin-server.coresetup.md +++ b/docs/development/core/server/kibana-plugin-server.coresetup.md @@ -17,6 +17,6 @@ export interface CoreSetup | Property | Type | Description | | --- | --- | --- | | [context](./kibana-plugin-server.coresetup.context.md) | {
createContextContainer: ContextSetup['createContextContainer'];
} | | -| [elasticsearch](./kibana-plugin-server.coresetup.elasticsearch.md) | {
adminClient$: Observable<ClusterClient>;
dataClient$: Observable<ClusterClient>;
createClient: (type: string, clientConfig?: Partial<ElasticsearchClientConfig>) => ClusterClient;
} | | +| [elasticsearch](./kibana-plugin-server.coresetup.elasticsearch.md) | {
adminClient$: Observable<IClusterClient>;
dataClient$: Observable<IClusterClient>;
createClient: (type: string, clientConfig?: Partial<ElasticsearchClientConfig>) => IClusterClient;
} | | | [http](./kibana-plugin-server.coresetup.http.md) | {
createCookieSessionStorageFactory: HttpServiceSetup['createCookieSessionStorageFactory'];
registerOnPreAuth: HttpServiceSetup['registerOnPreAuth'];
registerAuth: HttpServiceSetup['registerAuth'];
registerOnPostAuth: HttpServiceSetup['registerOnPostAuth'];
basePath: HttpServiceSetup['basePath'];
isTlsEnabled: HttpServiceSetup['isTlsEnabled'];
registerRouteHandlerContext: <T extends keyof RequestHandlerContext>(name: T, provider: RequestHandlerContextProvider<T>) => RequestHandlerContextContainer;
createRouter: () => IRouter;
} | | diff --git a/docs/development/core/server/kibana-plugin-server.deprecationapiclientparams.md b/docs/development/core/server/kibana-plugin-server.deprecationapiclientparams.md new file mode 100644 index 0000000000000..3dfe6b181a3d3 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.deprecationapiclientparams.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [DeprecationAPIClientParams](./kibana-plugin-server.deprecationapiclientparams.md) + +## DeprecationAPIClientParams interface + +Signature: + +```typescript +export interface DeprecationAPIClientParams extends GenericParams +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [method](./kibana-plugin-server.deprecationapiclientparams.method.md) | 'GET' | | +| [path](./kibana-plugin-server.deprecationapiclientparams.path.md) | '/_migration/deprecations' | | + diff --git a/docs/development/core/server/kibana-plugin-server.deprecationapiclientparams.method.md b/docs/development/core/server/kibana-plugin-server.deprecationapiclientparams.method.md new file mode 100644 index 0000000000000..7b9364009923b --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.deprecationapiclientparams.method.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [DeprecationAPIClientParams](./kibana-plugin-server.deprecationapiclientparams.md) > [method](./kibana-plugin-server.deprecationapiclientparams.method.md) + +## DeprecationAPIClientParams.method property + +Signature: + +```typescript +method: 'GET'; +``` diff --git a/docs/development/core/server/kibana-plugin-server.deprecationapiclientparams.path.md b/docs/development/core/server/kibana-plugin-server.deprecationapiclientparams.path.md new file mode 100644 index 0000000000000..dbddedf75171d --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.deprecationapiclientparams.path.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [DeprecationAPIClientParams](./kibana-plugin-server.deprecationapiclientparams.md) > [path](./kibana-plugin-server.deprecationapiclientparams.path.md) + +## DeprecationAPIClientParams.path property + +Signature: + +```typescript +path: '/_migration/deprecations'; +``` diff --git a/docs/development/core/server/kibana-plugin-server.deprecationapiresponse.cluster_settings.md b/docs/development/core/server/kibana-plugin-server.deprecationapiresponse.cluster_settings.md new file mode 100644 index 0000000000000..5af134100407c --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.deprecationapiresponse.cluster_settings.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [DeprecationAPIResponse](./kibana-plugin-server.deprecationapiresponse.md) > [cluster\_settings](./kibana-plugin-server.deprecationapiresponse.cluster_settings.md) + +## DeprecationAPIResponse.cluster\_settings property + +Signature: + +```typescript +cluster_settings: DeprecationInfo[]; +``` diff --git a/docs/development/core/server/kibana-plugin-server.deprecationapiresponse.index_settings.md b/docs/development/core/server/kibana-plugin-server.deprecationapiresponse.index_settings.md new file mode 100644 index 0000000000000..c8d20c9696f63 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.deprecationapiresponse.index_settings.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [DeprecationAPIResponse](./kibana-plugin-server.deprecationapiresponse.md) > [index\_settings](./kibana-plugin-server.deprecationapiresponse.index_settings.md) + +## DeprecationAPIResponse.index\_settings property + +Signature: + +```typescript +index_settings: IndexSettingsDeprecationInfo; +``` diff --git a/docs/development/core/server/kibana-plugin-server.deprecationapiresponse.md b/docs/development/core/server/kibana-plugin-server.deprecationapiresponse.md new file mode 100644 index 0000000000000..8ebe61f4efaa5 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.deprecationapiresponse.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [DeprecationAPIResponse](./kibana-plugin-server.deprecationapiresponse.md) + +## DeprecationAPIResponse interface + +Signature: + +```typescript +export interface DeprecationAPIResponse +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [cluster\_settings](./kibana-plugin-server.deprecationapiresponse.cluster_settings.md) | DeprecationInfo[] | | +| [index\_settings](./kibana-plugin-server.deprecationapiresponse.index_settings.md) | IndexSettingsDeprecationInfo | | +| [ml\_settings](./kibana-plugin-server.deprecationapiresponse.ml_settings.md) | DeprecationInfo[] | | +| [node\_settings](./kibana-plugin-server.deprecationapiresponse.node_settings.md) | DeprecationInfo[] | | + diff --git a/docs/development/core/server/kibana-plugin-server.deprecationapiresponse.ml_settings.md b/docs/development/core/server/kibana-plugin-server.deprecationapiresponse.ml_settings.md new file mode 100644 index 0000000000000..5a4e273df69a6 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.deprecationapiresponse.ml_settings.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [DeprecationAPIResponse](./kibana-plugin-server.deprecationapiresponse.md) > [ml\_settings](./kibana-plugin-server.deprecationapiresponse.ml_settings.md) + +## DeprecationAPIResponse.ml\_settings property + +Signature: + +```typescript +ml_settings: DeprecationInfo[]; +``` diff --git a/docs/development/core/server/kibana-plugin-server.deprecationapiresponse.node_settings.md b/docs/development/core/server/kibana-plugin-server.deprecationapiresponse.node_settings.md new file mode 100644 index 0000000000000..5901c49d0edf1 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.deprecationapiresponse.node_settings.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [DeprecationAPIResponse](./kibana-plugin-server.deprecationapiresponse.md) > [node\_settings](./kibana-plugin-server.deprecationapiresponse.node_settings.md) + +## DeprecationAPIResponse.node\_settings property + +Signature: + +```typescript +node_settings: DeprecationInfo[]; +``` diff --git a/docs/development/core/server/kibana-plugin-server.deprecationinfo.details.md b/docs/development/core/server/kibana-plugin-server.deprecationinfo.details.md new file mode 100644 index 0000000000000..17dbeff942255 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.deprecationinfo.details.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [DeprecationInfo](./kibana-plugin-server.deprecationinfo.md) > [details](./kibana-plugin-server.deprecationinfo.details.md) + +## DeprecationInfo.details property + +Signature: + +```typescript +details?: string; +``` diff --git a/docs/development/core/server/kibana-plugin-server.deprecationinfo.level.md b/docs/development/core/server/kibana-plugin-server.deprecationinfo.level.md new file mode 100644 index 0000000000000..99b629bbbb8cc --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.deprecationinfo.level.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [DeprecationInfo](./kibana-plugin-server.deprecationinfo.md) > [level](./kibana-plugin-server.deprecationinfo.level.md) + +## DeprecationInfo.level property + +Signature: + +```typescript +level: MIGRATION_DEPRECATION_LEVEL; +``` diff --git a/docs/development/core/server/kibana-plugin-server.deprecationinfo.md b/docs/development/core/server/kibana-plugin-server.deprecationinfo.md new file mode 100644 index 0000000000000..21c10bde26378 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.deprecationinfo.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [DeprecationInfo](./kibana-plugin-server.deprecationinfo.md) + +## DeprecationInfo interface + +Signature: + +```typescript +export interface DeprecationInfo +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [details](./kibana-plugin-server.deprecationinfo.details.md) | string | | +| [level](./kibana-plugin-server.deprecationinfo.level.md) | MIGRATION_DEPRECATION_LEVEL | | +| [message](./kibana-plugin-server.deprecationinfo.message.md) | string | | +| [url](./kibana-plugin-server.deprecationinfo.url.md) | string | | + diff --git a/docs/development/core/server/kibana-plugin-server.deprecationinfo.message.md b/docs/development/core/server/kibana-plugin-server.deprecationinfo.message.md new file mode 100644 index 0000000000000..f027ac83f3b6e --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.deprecationinfo.message.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [DeprecationInfo](./kibana-plugin-server.deprecationinfo.md) > [message](./kibana-plugin-server.deprecationinfo.message.md) + +## DeprecationInfo.message property + +Signature: + +```typescript +message: string; +``` diff --git a/docs/development/core/server/kibana-plugin-server.deprecationinfo.url.md b/docs/development/core/server/kibana-plugin-server.deprecationinfo.url.md new file mode 100644 index 0000000000000..4fdc9d544b7ff --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.deprecationinfo.url.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [DeprecationInfo](./kibana-plugin-server.deprecationinfo.md) > [url](./kibana-plugin-server.deprecationinfo.url.md) + +## DeprecationInfo.url property + +Signature: + +```typescript +url: string; +``` diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.adminclient_.md b/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.adminclient_.md index f118941cad602..31cf07ac66a46 100644 --- a/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.adminclient_.md +++ b/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.adminclient_.md @@ -7,5 +7,5 @@ Signature: ```typescript -readonly adminClient$: Observable; +readonly adminClient$: Observable; ``` diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.createclient.md b/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.createclient.md index c29d3fbbf69ab..34d04d26e9654 100644 --- a/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.createclient.md +++ b/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.createclient.md @@ -9,7 +9,7 @@ Create application specific Elasticsearch cluster API client with customized con Signature: ```typescript -readonly createClient: (type: string, clientConfig?: Partial) => ClusterClient; +readonly createClient: (type: string, clientConfig?: Partial) => IClusterClient; ``` ## Example diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.dataclient_.md b/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.dataclient_.md index 599e7af0f7757..240dff2e53635 100644 --- a/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.dataclient_.md +++ b/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.dataclient_.md @@ -7,5 +7,5 @@ Signature: ```typescript -readonly dataClient$: Observable; +readonly dataClient$: Observable; ``` diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.md b/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.md index 53fb66ade0517..9c3b92a88fe07 100644 --- a/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.md +++ b/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.md @@ -15,8 +15,8 @@ export interface ElasticsearchServiceSetup | Property | Type | Description | | --- | --- | --- | -| [adminClient$](./kibana-plugin-server.elasticsearchservicesetup.adminclient_.md) | Observable<ClusterClient> | | -| [createClient](./kibana-plugin-server.elasticsearchservicesetup.createclient.md) | (type: string, clientConfig?: Partial<ElasticsearchClientConfig>) => ClusterClient | Create application specific Elasticsearch cluster API client with customized config. | -| [dataClient$](./kibana-plugin-server.elasticsearchservicesetup.dataclient_.md) | Observable<ClusterClient> | | +| [adminClient$](./kibana-plugin-server.elasticsearchservicesetup.adminclient_.md) | Observable<IClusterClient> | | +| [createClient](./kibana-plugin-server.elasticsearchservicesetup.createclient.md) | (type: string, clientConfig?: Partial<ElasticsearchClientConfig>) => IClusterClient | Create application specific Elasticsearch cluster API client with customized config. | +| [dataClient$](./kibana-plugin-server.elasticsearchservicesetup.dataclient_.md) | Observable<IClusterClient> | | | [legacy](./kibana-plugin-server.elasticsearchservicesetup.legacy.md) | {
readonly config$: Observable<ElasticsearchConfig>;
} | | diff --git a/docs/development/core/server/kibana-plugin-server.iclusterclient.md b/docs/development/core/server/kibana-plugin-server.iclusterclient.md new file mode 100644 index 0000000000000..834afa6db5157 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.iclusterclient.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [IClusterClient](./kibana-plugin-server.iclusterclient.md) + +## IClusterClient type + +Represents an Elasticsearch cluster API client and allows to call API on behalf of the internal Kibana user and the actual user that is derived from the request headers (via `asScoped(...)`). + +See [ClusterClient](./kibana-plugin-server.clusterclient.md). + +Signature: + +```typescript +export declare type IClusterClient = Pick; +``` diff --git a/docs/development/core/server/kibana-plugin-server.indexsettingsdeprecationinfo.md b/docs/development/core/server/kibana-plugin-server.indexsettingsdeprecationinfo.md new file mode 100644 index 0000000000000..8fd0c6bb9f997 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.indexsettingsdeprecationinfo.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [IndexSettingsDeprecationInfo](./kibana-plugin-server.indexsettingsdeprecationinfo.md) + +## IndexSettingsDeprecationInfo interface + +Signature: + +```typescript +export interface IndexSettingsDeprecationInfo +``` diff --git a/docs/development/core/server/kibana-plugin-server.iscopedclusterclient.md b/docs/development/core/server/kibana-plugin-server.iscopedclusterclient.md new file mode 100644 index 0000000000000..becd1d26d2473 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.iscopedclusterclient.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [IScopedClusterClient](./kibana-plugin-server.iscopedclusterclient.md) + +## IScopedClusterClient type + +Serves the same purpose as "normal" `ClusterClient` but exposes additional `callAsCurrentUser` method that doesn't use credentials of the Kibana internal user (as `callAsInternalUser` does) to request Elasticsearch API, but rather passes HTTP headers extracted from the current user request to the API. + +See [ScopedClusterClient](./kibana-plugin-server.scopedclusterclient.md). + +Signature: + +```typescript +export declare type IScopedClusterClient = Pick; +``` diff --git a/docs/development/core/server/kibana-plugin-server.md b/docs/development/core/server/kibana-plugin-server.md index 3c01e7aeef325..1247c52a5704b 100644 --- a/docs/development/core/server/kibana-plugin-server.md +++ b/docs/development/core/server/kibana-plugin-server.md @@ -17,11 +17,11 @@ The plugin integrates with the core system via lifecycle events: `setup` | Class | Description | | --- | --- | | [BasePath](./kibana-plugin-server.basepath.md) | Access or manipulate the Kibana base path | -| [ClusterClient](./kibana-plugin-server.clusterclient.md) | Represents an Elasticsearch cluster API client and allows to call API on behalf of the internal Kibana user and the actual user that is derived from the request headers (via asScoped(...)). | +| [ClusterClient](./kibana-plugin-server.clusterclient.md) | Represents an Elasticsearch cluster API client and allows to call API on behalf of the internal Kibana user and the actual user that is derived from the request headers (via asScoped(...)).See [ClusterClient](./kibana-plugin-server.clusterclient.md). | | [ElasticsearchErrorHelpers](./kibana-plugin-server.elasticsearcherrorhelpers.md) | Helpers for working with errors returned from the Elasticsearch service.Since the internal data of errors are subject to change, consumers of the Elasticsearch service should always use these helpers to classify errors instead of checking error internals such as body.error.header[WWW-Authenticate] | | [KibanaRequest](./kibana-plugin-server.kibanarequest.md) | Kibana specific abstraction for an incoming request. | | [SavedObjectsErrorHelpers](./kibana-plugin-server.savedobjectserrorhelpers.md) | | -| [ScopedClusterClient](./kibana-plugin-server.scopedclusterclient.md) | Serves the same purpose as "normal" ClusterClient but exposes additional callAsCurrentUser method that doesn't use credentials of the Kibana internal user (as callAsInternalUser does) to request Elasticsearch API, but rather passes HTTP headers extracted from the current user request to the API | +| [ScopedClusterClient](./kibana-plugin-server.scopedclusterclient.md) | Serves the same purpose as "normal" ClusterClient but exposes additional callAsCurrentUser method that doesn't use credentials of the Kibana internal user (as callAsInternalUser does) to request Elasticsearch API, but rather passes HTTP headers extracted from the current user request to the API.See [ScopedClusterClient](./kibana-plugin-server.scopedclusterclient.md). | ## Enumerations @@ -33,6 +33,9 @@ The plugin integrates with the core system via lifecycle events: `setup` | Interface | Description | | --- | --- | +| [APICaller](./kibana-plugin-server.apicaller.md) | | +| [AssistanceAPIResponse](./kibana-plugin-server.assistanceapiresponse.md) | | +| [AssistantAPIClientParams](./kibana-plugin-server.assistantapiclientparams.md) | | | [AuthResultParams](./kibana-plugin-server.authresultparams.md) | Result of an incoming request authentication. | | [AuthToolkit](./kibana-plugin-server.authtoolkit.md) | A tool set defining an outcome of Auth interceptor for incoming request. | | [CallAPIOptions](./kibana-plugin-server.callapioptions.md) | The set of options that defines how API call should be made and result be processed. | @@ -40,6 +43,9 @@ The plugin integrates with the core system via lifecycle events: `setup` | [CoreSetup](./kibana-plugin-server.coresetup.md) | Context passed to the plugins setup method. | | [CoreStart](./kibana-plugin-server.corestart.md) | Context passed to the plugins start method. | | [CustomHttpResponseOptions](./kibana-plugin-server.customhttpresponseoptions.md) | HTTP response parameters for a response with adjustable status code. | +| [DeprecationAPIClientParams](./kibana-plugin-server.deprecationapiclientparams.md) | | +| [DeprecationAPIResponse](./kibana-plugin-server.deprecationapiresponse.md) | | +| [DeprecationInfo](./kibana-plugin-server.deprecationinfo.md) | | | [DiscoveredPlugin](./kibana-plugin-server.discoveredplugin.md) | Small container object used to expose information about discovered plugins that may or may not have been started. | | [ElasticsearchError](./kibana-plugin-server.elasticsearcherror.md) | | | [ElasticsearchServiceSetup](./kibana-plugin-server.elasticsearchservicesetup.md) | | @@ -50,6 +56,7 @@ The plugin integrates with the core system via lifecycle events: `setup` | [HttpServiceStart](./kibana-plugin-server.httpservicestart.md) | | | [IContextContainer](./kibana-plugin-server.icontextcontainer.md) | An object that handles registration of context providers and configuring handlers with context. | | [IKibanaSocket](./kibana-plugin-server.ikibanasocket.md) | A tiny abstraction for TCP socket. | +| [IndexSettingsDeprecationInfo](./kibana-plugin-server.indexsettingsdeprecationinfo.md) | | | [IRouter](./kibana-plugin-server.irouter.md) | Registers route handlers for specified resource path and method. | | [KibanaRequestRoute](./kibana-plugin-server.kibanarequestroute.md) | Request specific route information exposed to a handler. | | [LegacyRequest](./kibana-plugin-server.legacyrequest.md) | | @@ -109,7 +116,6 @@ The plugin integrates with the core system via lifecycle events: `setup` | Type Alias | Description | | --- | --- | -| [APICaller](./kibana-plugin-server.apicaller.md) | | | [AuthenticationHandler](./kibana-plugin-server.authenticationhandler.md) | | | [AuthHeaders](./kibana-plugin-server.authheaders.md) | Auth Headers map | | [ConfigPath](./kibana-plugin-server.configpath.md) | | @@ -123,11 +129,15 @@ The plugin integrates with the core system via lifecycle events: `setup` | [HttpResponsePayload](./kibana-plugin-server.httpresponsepayload.md) | Data send to the client as a response payload. | | [HttpServiceSetup](./kibana-plugin-server.httpservicesetup.md) | | | [IBasePath](./kibana-plugin-server.ibasepath.md) | Access or manipulate the Kibana base path[BasePath](./kibana-plugin-server.basepath.md) | +| [IClusterClient](./kibana-plugin-server.iclusterclient.md) | Represents an Elasticsearch cluster API client and allows to call API on behalf of the internal Kibana user and the actual user that is derived from the request headers (via asScoped(...)).See [ClusterClient](./kibana-plugin-server.clusterclient.md). | | [IContextProvider](./kibana-plugin-server.icontextprovider.md) | A function that returns a context value for a specific key of given context type. | | [IsAuthenticated](./kibana-plugin-server.isauthenticated.md) | Return authentication status for a request. | +| [IScopedClusterClient](./kibana-plugin-server.iscopedclusterclient.md) | Serves the same purpose as "normal" ClusterClient but exposes additional callAsCurrentUser method that doesn't use credentials of the Kibana internal user (as callAsInternalUser does) to request Elasticsearch API, but rather passes HTTP headers extracted from the current user request to the API.See [ScopedClusterClient](./kibana-plugin-server.scopedclusterclient.md). | | [KibanaResponseFactory](./kibana-plugin-server.kibanaresponsefactory.md) | Creates an object containing request response payload, HTTP headers, error details, and other data transmitted to the client. | | [KnownHeaders](./kibana-plugin-server.knownheaders.md) | Set of well-known HTTP headers. | | [LifecycleResponseFactory](./kibana-plugin-server.lifecycleresponsefactory.md) | Creates an object containing redirection or error response with error details, HTTP headers, and other data transmitted to the client. | +| [MIGRATION\_ASSISTANCE\_INDEX\_ACTION](./kibana-plugin-server.migration_assistance_index_action.md) | | +| [MIGRATION\_DEPRECATION\_LEVEL](./kibana-plugin-server.migration_deprecation_level.md) | | | [OnPostAuthHandler](./kibana-plugin-server.onpostauthhandler.md) | | | [OnPreAuthHandler](./kibana-plugin-server.onpreauthhandler.md) | | | [PluginInitializer](./kibana-plugin-server.plugininitializer.md) | The plugin export at the root of a plugin's server directory should conform to this interface. | diff --git a/docs/development/core/server/kibana-plugin-server.migration_assistance_index_action.md b/docs/development/core/server/kibana-plugin-server.migration_assistance_index_action.md new file mode 100644 index 0000000000000..4753bd0db71f6 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.migration_assistance_index_action.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [MIGRATION\_ASSISTANCE\_INDEX\_ACTION](./kibana-plugin-server.migration_assistance_index_action.md) + +## MIGRATION\_ASSISTANCE\_INDEX\_ACTION type + +Signature: + +```typescript +export declare type MIGRATION_ASSISTANCE_INDEX_ACTION = 'upgrade' | 'reindex'; +``` diff --git a/docs/development/core/server/kibana-plugin-server.migration_deprecation_level.md b/docs/development/core/server/kibana-plugin-server.migration_deprecation_level.md new file mode 100644 index 0000000000000..2751faf6a1cd9 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.migration_deprecation_level.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [MIGRATION\_DEPRECATION\_LEVEL](./kibana-plugin-server.migration_deprecation_level.md) + +## MIGRATION\_DEPRECATION\_LEVEL type + +Signature: + +```typescript +export declare type MIGRATION_DEPRECATION_LEVEL = 'none' | 'info' | 'warning' | 'critical'; +``` diff --git a/docs/development/core/server/kibana-plugin-server.requesthandlercontext.core.md b/docs/development/core/server/kibana-plugin-server.requesthandlercontext.core.md index 3274db0cf508d..d06b3b9ea637c 100644 --- a/docs/development/core/server/kibana-plugin-server.requesthandlercontext.core.md +++ b/docs/development/core/server/kibana-plugin-server.requesthandlercontext.core.md @@ -9,8 +9,8 @@ ```typescript core: { elasticsearch: { - dataClient: ScopedClusterClient; - adminClient: ScopedClusterClient; + dataClient: IScopedClusterClient; + adminClient: IScopedClusterClient; }; }; ``` diff --git a/docs/development/core/server/kibana-plugin-server.requesthandlercontext.md b/docs/development/core/server/kibana-plugin-server.requesthandlercontext.md index d7498f04733dd..85c7989c6e863 100644 --- a/docs/development/core/server/kibana-plugin-server.requesthandlercontext.md +++ b/docs/development/core/server/kibana-plugin-server.requesthandlercontext.md @@ -16,5 +16,5 @@ export interface RequestHandlerContext | Property | Type | Description | | --- | --- | --- | -| [core](./kibana-plugin-server.requesthandlercontext.core.md) | {
elasticsearch: {
dataClient: ScopedClusterClient;
adminClient: ScopedClusterClient;
};
} | | +| [core](./kibana-plugin-server.requesthandlercontext.core.md) | {
elasticsearch: {
dataClient: IScopedClusterClient;
adminClient: IScopedClusterClient;
};
} | | diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsupdateresponse.md b/docs/development/core/server/kibana-plugin-server.savedobjectsupdateresponse.md index c49f391df986d..0731ff5549bd4 100644 --- a/docs/development/core/server/kibana-plugin-server.savedobjectsupdateresponse.md +++ b/docs/development/core/server/kibana-plugin-server.savedobjectsupdateresponse.md @@ -8,7 +8,7 @@ Signature: ```typescript -export interface SavedObjectsUpdateResponse extends Omit, 'attributes'> +export interface SavedObjectsUpdateResponse extends Omit, 'attributes' | 'references'> ``` ## Properties @@ -16,4 +16,5 @@ export interface SavedObjectsUpdateResponsePartial<T> | | +| [references](./kibana-plugin-server.savedobjectsupdateresponse.references.md) | SavedObjectReference[] | undefined | | diff --git a/docs/development/core/server/kibana-plugin-server.savedobjectsupdateresponse.references.md b/docs/development/core/server/kibana-plugin-server.savedobjectsupdateresponse.references.md new file mode 100644 index 0000000000000..26e33694b943c --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.savedobjectsupdateresponse.references.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [SavedObjectsUpdateResponse](./kibana-plugin-server.savedobjectsupdateresponse.md) > [references](./kibana-plugin-server.savedobjectsupdateresponse.references.md) + +## SavedObjectsUpdateResponse.references property + +Signature: + +```typescript +references: SavedObjectReference[] | undefined; +``` diff --git a/docs/development/core/server/kibana-plugin-server.scopedclusterclient.callascurrentuser.md b/docs/development/core/server/kibana-plugin-server.scopedclusterclient.callascurrentuser.md index f96554296e653..ce0c51be08698 100644 --- a/docs/development/core/server/kibana-plugin-server.scopedclusterclient.callascurrentuser.md +++ b/docs/development/core/server/kibana-plugin-server.scopedclusterclient.callascurrentuser.md @@ -9,7 +9,7 @@ Calls specified `endpoint` with provided `clientParams` on behalf of the user in Signature: ```typescript -callAsCurrentUser(endpoint: string, clientParams?: Record, options?: CallAPIOptions): Promise; +callAsCurrentUser(endpoint: string, clientParams?: Record, options?: CallAPIOptions): Promise; ``` ## Parameters @@ -22,5 +22,5 @@ callAsCurrentUser(endpoint: string, clientParams?: Record, options? Returns: -`Promise` +`Promise` diff --git a/docs/development/core/server/kibana-plugin-server.scopedclusterclient.callasinternaluser.md b/docs/development/core/server/kibana-plugin-server.scopedclusterclient.callasinternaluser.md index 395d65197e2cc..59811de18d926 100644 --- a/docs/development/core/server/kibana-plugin-server.scopedclusterclient.callasinternaluser.md +++ b/docs/development/core/server/kibana-plugin-server.scopedclusterclient.callasinternaluser.md @@ -9,7 +9,7 @@ Calls specified `endpoint` with provided `clientParams` on behalf of the Kibana Signature: ```typescript -callAsInternalUser(endpoint: string, clientParams?: Record, options?: CallAPIOptions): Promise; +callAsInternalUser(endpoint: string, clientParams?: Record, options?: CallAPIOptions): Promise; ``` ## Parameters @@ -22,5 +22,5 @@ callAsInternalUser(endpoint: string, clientParams?: Record, options Returns: -`Promise` +`Promise` diff --git a/docs/development/core/server/kibana-plugin-server.scopedclusterclient.md b/docs/development/core/server/kibana-plugin-server.scopedclusterclient.md index 817beced3346d..7833f698d486d 100644 --- a/docs/development/core/server/kibana-plugin-server.scopedclusterclient.md +++ b/docs/development/core/server/kibana-plugin-server.scopedclusterclient.md @@ -4,12 +4,14 @@ ## ScopedClusterClient class -Serves the same purpose as "normal" `ClusterClient` but exposes additional `callAsCurrentUser` method that doesn't use credentials of the Kibana internal user (as `callAsInternalUser` does) to request Elasticsearch API, but rather passes HTTP headers extracted from the current user request to the API +Serves the same purpose as "normal" `ClusterClient` but exposes additional `callAsCurrentUser` method that doesn't use credentials of the Kibana internal user (as `callAsInternalUser` does) to request Elasticsearch API, but rather passes HTTP headers extracted from the current user request to the API. + +See [ScopedClusterClient](./kibana-plugin-server.scopedclusterclient.md). Signature: ```typescript -export declare class ScopedClusterClient +export declare class ScopedClusterClient implements IScopedClusterClient ``` ## Constructors diff --git a/docs/discover/autorefresh.asciidoc b/docs/discover/autorefresh.asciidoc deleted file mode 100644 index 1929f7a24dcc1..0000000000000 --- a/docs/discover/autorefresh.asciidoc +++ /dev/null @@ -1,19 +0,0 @@ -=== Refreshing the Search Results -You can configure a refresh interval to automatically refresh the page with the latest index data. This periodically -resubmits the search query. - -When a refresh interval is set, it is displayed to the left of the Time Filter in the menu bar. - -To set the refresh interval: - -. Click the *Time Filter* image:images/TimeFilter.jpg[Time Filter]. -. Click the *Refresh Interval* tab. -. Choose a refresh interval from the list. - -To automatically refresh the data, click the image:images/autorefresh.png[] *Auto-refresh* button when the time picker -is open and select an autorefresh interval: - -image::images/autorefresh-intervals.png[] - -When auto-refresh is enabled, Kibana's top bar displays a pause button and the auto-refresh interval: -image:images/autorefresh-pause.png[]. Click the *Pause* button to pause auto-refresh. diff --git a/docs/discover/search.asciidoc b/docs/discover/search.asciidoc index 790cc669927c1..cfca4f2fc092b 100644 --- a/docs/discover/search.asciidoc +++ b/docs/discover/search.asciidoc @@ -1,5 +1,5 @@ [[search]] -== Searching Your Data +== Searching your data You can search the indices that match the current index pattern by entering your search criteria in the Query bar. By default you can use Kibana's standard query language which features autocomplete and a simple, easy to use syntax. Kibana's legacy query @@ -24,7 +24,7 @@ the request to Elasticsearch. include::kuery.asciidoc[] [[lucene-query]] -=== Lucene Query Syntax +=== Lucene query syntax Kibana's legacy query language was based on the Lucene query syntax. For the time being this syntax is still available under the options menu in the Query Bar and in Advanced Settings. The following are some tips that can help get you started. @@ -70,7 +70,7 @@ Kibana see <>. [role="screenshot"] image::discover/images/read-only-badge.png[Example of Discover's read only access indicator in Kibana's header] -==== Saving a Search +==== Save a search To save the current search: . Click *Save* in the Kibana toolbar. @@ -78,7 +78,7 @@ To save the current search: You can import, export and delete saved searches from *Management/Kibana/Saved Objects*. -==== Opening a Saved Search +==== Open a saved search To load a saved search into Discover: . Click *Open* in the Kibana toolbar. @@ -102,7 +102,7 @@ Saved queries don't include information specific to Discover, such as the curren ==== Read only access If you have insufficient privileges to save queries, the *Save current query* button isn't visible in the saved query management popover. For more information, see <> -==== Saving a query +==== Save a query To save the current query text, filters, and time filter: . Click *#* in the search bar, next to the query text input. @@ -117,13 +117,13 @@ image::discover/images/saved-query-management-component-all-privileges.png["Exam image::discover/images/saved-query-save-form-default-filters.png["Example of the saved query management save form with the filters option included and the time filter option excluded",width="80%"] . Click *Save*. -==== Loading a query +==== Load a query To load a saved query into Discover, Dashboard, or Visualize: . Click *#* in the search bar, next to the query text input. . Select the query you want to load. You might need to scroll down to find the query you are looking for. -==== Saving changes to a query +==== Save changes to a query If you load a query and then make changes to the query text, the filters, or the time filter, you can save the changes as a new query or update the existing query. To save the changes as a new query: @@ -143,13 +143,13 @@ To save the changes to the current query: . Enter a description, and then select the filter options that you want to include. . Click *Save*. -==== Clearing a query +==== Clear a query To clear a query that is currently loaded in an application: . Click *#* in the search bar. . Click *Clear* in the popover. -==== Deleting a query +==== Delete a query To completely delete a query: . Click *#* in the search bar, next to the query text input. @@ -162,7 +162,7 @@ image::discover/images/saved-query-management-component-delete-query-button.png[ You can import, export, and delete saved queries from <>. [[select-pattern]] -=== Changing Which Indices You're Searching +=== Change the indices you're searching When you submit a search request, the indices that match the currently-selected index pattern are searched. The current index pattern is shown below the toolbar. To change which indices you are searching, click the index pattern and select a @@ -172,24 +172,22 @@ For more information about index patterns, see <>. [[autorefresh]] -=== Refreshing the Search Results +=== Refresh the search results As more documents are added to the indices you're searching, the search results shown in Discover and used to display visualizations get stale. You can configure a refresh interval to periodically resubmit your searches to retrieve the latest results. -To enable auto refresh: +. Click image:images/time-filter-calendar.png[]. -. Click the *Time Picker* image:images/time-picker.jpg[Time Picker] in the -Kibana toolbar. -. Click *Auto refresh*. -. Choose a refresh interval from the list. +. In the *Refresh every* field, enter the refresh rate, then select the interval + from the dropdown. + +. Click *Start*. + image::images/autorefresh-intervals.png[] -When auto refresh is enabled, the refresh interval is displayed next to the -Time Picker, along with a Pause button. To temporarily disable auto refresh, -click *Pause*. +To disable auto refresh, click *Stop*. -NOTE: If auto refresh is not enabled, you can manually refresh visualizations -by clicking *Refresh*. +If auto refresh is not enabled, click *Refresh* to manually refresh the search +results. diff --git a/docs/discover/set-time-filter.asciidoc b/docs/discover/set-time-filter.asciidoc index 6587d4febe4d2..c2d366cdcbbb6 100644 --- a/docs/discover/set-time-filter.asciidoc +++ b/docs/discover/set-time-filter.asciidoc @@ -1,46 +1,56 @@ [[set-time-filter]] == Setting the time filter -You can -set a time filter if your index contains time-based events and a time-field is -configured for the selected index pattern. -By default, the time filter is set to the last 15 minutes. You can use the time -picker to change the time filter, or select a specific time -range in the histogram. +If your index contains time-based events, and a time-field is configured for the +selected index pattern, set a time filter that displays only the data within the +specified time range. +You can use the time filter to change the time range, or select a specific time +range in the histogram. [float] -=== Filter with the time picker - -To quickly select from popular time range options, click the calendar -dropdown image:infrastructure/images/time-filter-calendar.png[]. - +[[use-time-filter]] +=== Use the time filter + +Use the time filter to change the time range. By default, the time filter is set +to the last 15 minutes. + +. Click image:images/time-filter-calendar.png[]. + +. Choose one of the following: + +* *Quick select* to use a recent time range, then use the back and forward + arrows to move through the time ranges. + +* *Commonly used* to use a time range from options such as *Last 15 minutes*, + *Today*, and *Week to date*. + +* *Recently used date ranges* to use a previously selected data range that + you recently used. + +* *Refresh every* to specify an automatic refresh rate. ++ [role="screenshot"] -image::images/Timepicker-View.png[Time picker menu] - -With the time picker, you can choose from: - -* *Quick select* to choose a recent time range, and use the back and forward arrows to move through the time ranges. -* *Commonly used* to choose a time range from options such as *Last 15 minutes*, *Today*, and *Week to date*. -* *Refresh every* to specify an auto-refresh rate. - -For control over the start and end times, -click the start time or end time in -the bar next to the calendar dropdown. In this popup, -you can select *Absolute*, *Relative* or *Now*, -and then specify the required options. +image::images/Timepicker-View.png[Time filter menu] +. To set the start and end times, click the bar next to the time filter. +In the popup, select *Absolute*, *Relative* or *Now*, then specify the required +options. ++ +[role="screenshot"] +image::images/time-filter-bar.png[Time filter bar] [float] -=== Filter from the histogram +=== Select a time range from the histogram + +To select a specific time range in the histogram, choose one of the following: -You can set a time filter from the histogram in two ways: +* Click the bar that represents the time range you want to zoom in on. -* Click the bar that represents the time interval you want to zoom in on. -* Click and drag to view a specific timespan. You must start the selection with +* Click and drag to view a specific time range. You must start the selection with the cursor over the background of the chart--the cursor changes to a plus sign when you hover over a valid start point. -To use a different interval, click the dropdown and select an interval. +* Click the dropdown, then select an interval. [role="screenshot"] image::images/Histogram-Time.png[Time range selector in Histogram] diff --git a/docs/images/autorefresh-intervals.png b/docs/images/autorefresh-intervals.png index b8c8edaf71592..a79ae2f1f6c46 100644 Binary files a/docs/images/autorefresh-intervals.png and b/docs/images/autorefresh-intervals.png differ diff --git a/docs/images/autorefresh.png b/docs/images/autorefresh.png index cf24bac5af08f..9a6225b9007bd 100644 Binary files a/docs/images/autorefresh.png and b/docs/images/autorefresh.png differ diff --git a/docs/images/time-filter-bar.png b/docs/images/time-filter-bar.png new file mode 100644 index 0000000000000..9ad7801c5bddc Binary files /dev/null and b/docs/images/time-filter-bar.png differ diff --git a/docs/images/time-filter-calendar.png b/docs/images/time-filter-calendar.png new file mode 100644 index 0000000000000..7487401ca2e4b Binary files /dev/null and b/docs/images/time-filter-calendar.png differ diff --git a/docs/infrastructure/infra-ui.asciidoc b/docs/infrastructure/infra-ui.asciidoc index be8fc29b98ab2..b976714587b7f 100644 --- a/docs/infrastructure/infra-ui.asciidoc +++ b/docs/infrastructure/infra-ui.asciidoc @@ -49,7 +49,7 @@ For example, enter `host.hostname : "host1"` to see only the information for `ho [[infra-date]] === Specify the time and date -Click the time selector image:infrastructure/images/infra-time-selector.png[time selector icon] to choose the timeframe for the metrics. +Click the time filter image:infrastructure/images/infra-time-selector.png[time filter icon] to choose the timeframe for the metrics. The values shown are the values for the last minute at the specified time and date. [float] diff --git a/docs/logs/using.asciidoc b/docs/logs/using.asciidoc index cdc990ff1caa0..bebc225feb0e6 100644 --- a/docs/logs/using.asciidoc +++ b/docs/logs/using.asciidoc @@ -30,8 +30,9 @@ If so, <> to change the [[logs-time]] === Specify the time and date -Click the time selector image:logs/images/logs-time-selector.png[time selector icon] to choose the timeframe for the logs. -Log entries for the time you specify appear in the middle of the page, with the earlier entries above and the later entries below. +Click image:images/time-filter-calendar.png[time filter calendar], then choose the time range for the logs. + +Log entries for the specified time appear in the middle of the page, with the earlier entries above and the later entries below. To quickly jump to a nearby point in time, click the minimap timeline to the right. // ++ what's this thing called? It's minimap in the UI. Would timeline be better? diff --git a/docs/plugins/known-plugins.asciidoc b/docs/plugins/known-plugins.asciidoc index d5344a796c7ce..58885ae04605d 100644 --- a/docs/plugins/known-plugins.asciidoc +++ b/docs/plugins/known-plugins.asciidoc @@ -60,7 +60,7 @@ This list of plugins is not guaranteed to work on your version of Kibana. Instea [float] === Other -* https://github.com/nreese/kibana-time-plugin[Time picker as a dashboard panel] Widget to view and edit the time range from within dashboards. +* https://github.com/nreese/kibana-time-plugin[Time filter as a dashboard panel] Widget to view and edit the time range from within dashboards. * https://github.com/Webiks/kibana-API.git[Kibana-API] (webiks) Exposes an API with Kibana functionality. Use it to create, edit and embed visualizations, and also to search inside an embedded dashboard. diff --git a/docs/setup/settings.asciidoc b/docs/setup/settings.asciidoc index 091714cdd15e4..3f4e4e18252a4 100644 --- a/docs/setup/settings.asciidoc +++ b/docs/setup/settings.asciidoc @@ -271,9 +271,11 @@ identifies this Kibana instance. `server.port:`:: *Default: 5601* Kibana is served by a back end server. This setting specifies the port to use. -`server.rewriteBasePath:`:: *Default: false* Specifies whether Kibana should +`server.rewriteBasePath:`:: *Default: deprecated* Specifies whether Kibana should rewrite requests that are prefixed with `server.basePath` or require that they -are rewritten by your reverse proxy. +are rewritten by your reverse proxy. In Kibana 6.3 and earlier, the default is +`false`. In Kibana 7.x, the setting is deprecated. In Kibana 8.0 and later, the +default is `true`. `server.socketTimeout:`:: *Default: "120000"* The number of milliseconds to wait before closing an inactive socket. diff --git a/docs/user/monitoring/beats-details.asciidoc b/docs/user/monitoring/beats-details.asciidoc index bb4b998da9966..672ed6226e427 100644 --- a/docs/user/monitoring/beats-details.asciidoc +++ b/docs/user/monitoring/beats-details.asciidoc @@ -14,7 +14,7 @@ image::user/monitoring/images/monitoring-beats.jpg["Monitoring Beats",link="imag To view an overview of the Beats data in the cluster, click *Overview*. The overview page has a section for activity in the last day, which is a real-time sample of data. Below that, a summary bar and charts follow the typical paradigm -of data in the Monitoring UI, which is bound to the span of the time picker in +of data in the Monitoring UI, which is bound to the span of the time filter in the top right corner of the page. This overview page can therefore show up-to-date or historical information. diff --git a/docs/user/plugins.asciidoc b/docs/user/plugins.asciidoc index e80a81993c4f9..83c1ab1a842bb 100644 --- a/docs/user/plugins.asciidoc +++ b/docs/user/plugins.asciidoc @@ -1,22 +1,22 @@ [[kibana-plugins]] -= Kibana Plugins += Kibana plugins [partintro] -- -Add-on functionality for Kibana is implemented with plug-in modules. You use the `bin/kibana-plugin` +Add-on functionality for {kib} is implemented with plug-in modules. You use the `bin/kibana-plugin` command to manage these modules. [IMPORTANT] .Plugin compatibility ============================================== -The Kibana plugin interfaces are in a state of constant development. We cannot provide backwards compatibility for plugins due to the high rate of change. Kibana enforces that the installed plugins match the version of Kibana itself. Plugin developers will have to release a new version of their plugin for each new Kibana release as a result. +The {kib} plugin interfaces are in a state of constant development. We cannot provide backwards compatibility for plugins due to the high rate of change. {kib} enforces that the installed plugins match the version of {kib} itself. Plugin developers will have to release a new version of their plugin for each new {kib} release as a result. ============================================== -- [[install-plugin]] -== Installing Plugins +== Install plugins Use the following command to install a plugin: @@ -28,9 +28,9 @@ When you specify a plugin name without a URL, the plugin tool attempts to downlo ["source","shell",subs="attributes"] $ bin/kibana-plugin install x-pack - [float] -=== Installing Plugins from an Arbitrary URL +[[install-plugin-url]] +=== Install plugins from an arbitrary URL You can download official Elastic plugins simply by specifying their name. You can alternatively specify a URL to a specific plugin, as in the following @@ -42,22 +42,10 @@ $ bin/kibana-plugin install https://artifacts.elastic.co/downloads/packs/x-pack/ You can specify URLs that use the HTTP, HTTPS, or `file` protocols. [float] -=== Installing Plugins to an Arbitrary Directory - -Use the `-d` or `--plugin-dir` option after the `install` command to specify a directory for plugins, as in the following -example: - -[source,shell] -$ bin/kibana-plugin install file:///some/local/path/my-plugin.zip -d path/to/directory - -NOTE: This command creates the specified directory if it does not already exist. - -WARNING: This option is deprecated and will be removed in Kibana 7. It is known to not work with some plugins, including {xpack}. - -[float] +[[install-plugin-proxy-support]] === Proxy support for plugin installation -Kibana supports plugin installation via a proxy. It uses the `http_proxy` and `https_proxy` +{kib} supports plugin installation via a proxy. It uses the `http_proxy` and `https_proxy` environment variables to detect a proxy for HTTP and HTTPS URLs. It also respects the `no_proxy` environment variable to exclude specific URLs from proxying. @@ -67,9 +55,8 @@ You can specify the environment variable directly when installing plugins: [source,shell] $ http_proxy="http://proxy.local:4242" bin/kibana-plugin install - [[update-remove-plugin]] -== Updating & Removing Plugins +== Update and remove plugins To update a plugin, remove the current version and reinstall the plugin. @@ -80,10 +67,10 @@ $ bin/kibana-plugin remove x-pack You can also remove a plugin manually by deleting the plugin's subdirectory under the `plugins/` directory. -NOTE: Removing a plugin will result in an "optimize" run which will delay the next start of Kibana. +NOTE: Removing a plugin will result in an "optimize" run which will delay the next start of {kib}. [[disable-plugin]] -== Disabling Plugins +== Disable plugins Use the following command to disable a plugin: @@ -92,12 +79,12 @@ Use the following command to disable a plugin: ./bin/kibana --.enabled=false <1> ----------- -NOTE: Disabling or enabling a plugin will result in an "optimize" run which will delay the start of Kibana. +NOTE: Disabling or enabling a plugin will result in an "optimize" run which will delay the start of {kib}. <1> You can find a plugin's plugin ID as the value of the `name` property in the plugin's `package.json` file. [[configure-plugin-manager]] -== Configuring the Plugin Manager +== Configure the plugin manager By default, the plugin manager provides you with feedback on the status of the activity you've asked the plugin manager to perform. You can control the level of feedback for the `install` and `remove` commands with the `--quiet` and @@ -116,15 +103,17 @@ bin/kibana-plugin install --timeout 30s sample-plugin bin/kibana-plugin install --timeout 1m sample-plugin [float] -=== Plugins and Custom Kibana Configurations +[[plugin-custom-configuration]] +=== Plugins and custom {kib} configurations Use the `-c` or `--config` options with the `install` and `remove` commands to specify the path to the configuration file -used to start Kibana. By default, Kibana uses the configuration file `config/kibana.yml`. When you change your installed -plugins, the `bin/kibana-plugin` command restarts the Kibana server. When you are using a customized configuration file, +used to start {kib}. By default, {kib} uses the configuration file `config/kibana.yml`. When you change your installed +plugins, the `bin/kibana-plugin` command restarts the {kib} server. When you are using a customized configuration file, you must specify the path to that configuration file each time you use the `bin/kibana-plugin` command. [float] -=== Plugin Manager Exit Codes +[[plugin-manager-exit-codes]] +=== Plugin manager exit codes [horizontal] 0:: Success diff --git a/docs/visualize/vega.asciidoc b/docs/visualize/vega.asciidoc index a35d234a3586d..d5b7ccb12f48c 100644 --- a/docs/visualize/vega.asciidoc +++ b/docs/visualize/vega.asciidoc @@ -75,7 +75,7 @@ Here is an example of an Elasticsearch query that counts the number of documents // An object instead of a string for the url value // is treated as a context-aware Elasticsearch query. url: { - // Filter the time picker (upper right corner) with this field + // Specify the time filter (upper right corner) with this field %timefield%: @timestamp // Apply dashboard context filters when set %context%: true diff --git a/package.json b/package.json index 0ba1d196734c3..8cb6ca41a85d6 100644 --- a/package.json +++ b/package.json @@ -166,7 +166,7 @@ "globby": "^8.0.1", "good-squeeze": "2.1.0", "h2o2": "^8.1.2", - "handlebars": "4.3.3", + "handlebars": "4.3.5", "hapi": "^17.5.3", "hapi-auth-cookie": "^9.0.0", "history": "^4.9.0", diff --git a/src/core/server/elasticsearch/api_types.ts b/src/core/server/elasticsearch/api_types.ts new file mode 100644 index 0000000000000..02834739942b5 --- /dev/null +++ b/src/core/server/elasticsearch/api_types.ts @@ -0,0 +1,357 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { + Client, + GenericParams, + // root params + BulkIndexDocumentsParams, + ClearScrollParams, + CountParams, + CreateDocumentParams, + DeleteDocumentParams, + DeleteDocumentByQueryParams, + DeleteScriptParams, + DeleteTemplateParams, + ExistsParams, + ExplainParams, + FieldStatsParams, + GetParams, + GetResponse, + GetScriptParams, + GetSourceParams, + GetTemplateParams, + IndexDocumentParams, + InfoParams, + MGetParams, + MSearchParams, + MSearchTemplateParams, + MTermVectorsParams, + PingParams, + PutScriptParams, + PutTemplateParams, + ReindexParams, + ReindexRethrottleParams, + RenderSearchTemplateParams, + ScrollParams, + SearchParams, + SearchShardsParams, + SearchTemplateParams, + SuggestParams, + TermvectorsParams, + UpdateDocumentParams, + UpdateDocumentByQueryParams, + MGetResponse, + MSearchResponse, + SearchResponse, + // cat + CatAliasesParams, + CatAllocationParams, + CatFielddataParams, + CatHealthParams, + CatHelpParams, + CatIndicesParams, + CatCommonParams, + CatRecoveryParams, + CatSegmentsParams, + CatShardsParams, + CatSnapshotsParams, + CatTasksParams, + CatThreadPoolParams, + // cluster + ClusterAllocationExplainParams, + ClusterGetSettingsParams, + ClusterHealthParams, + ClusterPendingTasksParams, + ClusterPutSettingsParams, + ClusterRerouteParams, + ClusterStateParams, + ClusterStatsParams, + // indices + IndicesAnalyzeParams, + IndicesClearCacheParams, + IndicesCloseParams, + IndicesCreateParams, + IndicesDeleteParams, + IndicesDeleteAliasParams, + IndicesDeleteTemplateParams, + IndicesExistsParams, + IndicesExistsAliasParams, + IndicesExistsTemplateParams, + IndicesExistsTypeParams, + IndicesFlushParams, + IndicesFlushSyncedParams, + IndicesForcemergeParams, + IndicesGetParams, + IndicesGetAliasParams, + IndicesGetFieldMappingParams, + IndicesGetMappingParams, + IndicesGetSettingsParams, + IndicesGetTemplateParams, + IndicesGetUpgradeParams, + IndicesOpenParams, + IndicesPutAliasParams, + IndicesPutMappingParams, + IndicesPutSettingsParams, + IndicesPutTemplateParams, + IndicesRecoveryParams, + IndicesRefreshParams, + IndicesRolloverParams, + IndicesSegmentsParams, + IndicesShardStoresParams, + IndicesShrinkParams, + IndicesStatsParams, + IndicesUpdateAliasesParams, + IndicesUpgradeParams, + IndicesValidateQueryParams, + // ingest + IngestDeletePipelineParams, + IngestGetPipelineParams, + IngestPutPipelineParams, + IngestSimulateParams, + // nodes + NodesHotThreadsParams, + NodesInfoParams, + NodesStatsParams, + // snapshot + SnapshotCreateParams, + SnapshotCreateRepositoryParams, + SnapshotDeleteParams, + SnapshotDeleteRepositoryParams, + SnapshotGetParams, + SnapshotGetRepositoryParams, + SnapshotRestoreParams, + SnapshotStatusParams, + SnapshotVerifyRepositoryParams, + // tasks + TasksCancelParams, + TasksGetParams, + TasksListParams, +} from 'elasticsearch'; + +/** + * The set of options that defines how API call should be made and result be + * processed. + * + * @public + */ +export interface CallAPIOptions { + /** + * Indicates whether `401 Unauthorized` errors returned from the Elasticsearch API + * should be wrapped into `Boom` error instances with properly set `WWW-Authenticate` + * header that could have been returned by the API itself. If API didn't specify that + * then `Basic realm="Authorization Required"` is used as `WWW-Authenticate`. + */ + wrap401Errors: boolean; + /** + * A signal object that allows you to abort the request via an AbortController object. + */ + signal?: AbortSignal; +} + +/** @public */ +export interface APICaller { + /* eslint-disable */ + (endpoint: 'bulk', params: BulkIndexDocumentsParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'clearScroll', params: ClearScrollParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'count', params: CountParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'create', params: CreateDocumentParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'delete', params: DeleteDocumentParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'deleteByQuery', params: DeleteDocumentByQueryParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'deleteScript', params: DeleteScriptParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'deleteTemplate', params: DeleteTemplateParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'exists', params: ExistsParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'explain', params: ExplainParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'fieldStats', params: FieldStatsParams, options?: CallAPIOptions): ReturnType; + // Generic types cannot be properly looked up with ReturnType. Hard code these explicitly. + (endpoint: 'get', params: GetParams, options?: CallAPIOptions): Promise>; + (endpoint: 'getScript', params: GetScriptParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'getSource', params: GetSourceParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'getTemplate', params: GetTemplateParams, options?: CallAPIOptions): ReturnType; + // Generic types cannot be properly looked up with ReturnType. Hard code these explicitly. + (endpoint: 'index', params: IndexDocumentParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'info', params: InfoParams, options?: CallAPIOptions): ReturnType; + // Generic types cannot be properly looked up with ReturnType. Hard code these explicitly. + (endpoint: 'mget', params: MGetParams, options?: CallAPIOptions): Promise>; + (endpoint: 'msearch', params: MSearchParams, options?: CallAPIOptions): Promise>; + (endpoint: 'msearchTemplate', params: MSearchTemplateParams, options?: CallAPIOptions): Promise>; + (endpoint: 'mtermvectors', params: MTermVectorsParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'ping', params: PingParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'putScript', params: PutScriptParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'putTemplate', params: PutTemplateParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'reindex', params: ReindexParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'reindexRethrottle', params: ReindexRethrottleParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'renderSearchTemplate', params: RenderSearchTemplateParams, options?: CallAPIOptions): ReturnType; + // Generic types cannot be properly looked up with ReturnType. Hard code these explicitly. + (endpoint: 'scroll', params: ScrollParams, options?: CallAPIOptions): Promise>; + (endpoint: 'search', params: SearchParams, options?: CallAPIOptions): Promise>; + (endpoint: 'searchShards', params: SearchShardsParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'searchTemplate', params: SearchTemplateParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'suggest', params: SuggestParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'termvectors', params: TermvectorsParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'update', params: UpdateDocumentParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'updateByQuery', params: UpdateDocumentByQueryParams, options?: CallAPIOptions): ReturnType; + + // cat namespace + (endpoint: 'cat.aliases', params: CatAliasesParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cat.allocation', params: CatAllocationParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cat.count', params: CatAllocationParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cat.fielddata', params: CatFielddataParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cat.health', params: CatHealthParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cat.help', params: CatHelpParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cat.indices', params: CatIndicesParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cat.master', params: CatCommonParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cat.nodeattrs', params: CatCommonParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cat.nodes', params: CatCommonParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cat.pendingTasks', params: CatCommonParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cat.plugins', params: CatCommonParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cat.recovery', params: CatRecoveryParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cat.repositories', params: CatCommonParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cat.segments', params: CatSegmentsParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cat.shards', params: CatShardsParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cat.snapshots', params: CatSnapshotsParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cat.tasks', params: CatTasksParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cat.threadPool', params: CatThreadPoolParams, options?: CallAPIOptions): ReturnType; + + // cluster namespace + (endpoint: 'cluster.allocationExplain', params: ClusterAllocationExplainParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cluster.getSettings', params: ClusterGetSettingsParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cluster.health', params: ClusterHealthParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cluster.pendingTasks', params: ClusterPendingTasksParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cluster.putSettings', params: ClusterPutSettingsParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cluster.reroute', params: ClusterRerouteParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cluster.state', params: ClusterStateParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'cluster.stats', params: ClusterStatsParams, options?: CallAPIOptions): ReturnType; + + // indices namespace + (endpoint: 'indices.analyze', params: IndicesAnalyzeParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.clearCache', params: IndicesClearCacheParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.close', params: IndicesCloseParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.create', params: IndicesCreateParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.delete', params: IndicesDeleteParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.deleteAlias', params: IndicesDeleteAliasParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.deleteTemplate', params: IndicesDeleteTemplateParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.exists', params: IndicesExistsParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.existsAlias', params: IndicesExistsAliasParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.existsTemplate', params: IndicesExistsTemplateParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.existsType', params: IndicesExistsTypeParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.flush', params: IndicesFlushParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.flushSynced', params: IndicesFlushSyncedParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.forcemerge', params: IndicesForcemergeParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.get', params: IndicesGetParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.getAlias', params: IndicesGetAliasParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.getFieldMapping', params: IndicesGetFieldMappingParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.getMapping', params: IndicesGetMappingParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.getSettings', params: IndicesGetSettingsParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.getTemplate', params: IndicesGetTemplateParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.getUpgrade', params: IndicesGetUpgradeParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.open', params: IndicesOpenParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.putAlias', params: IndicesPutAliasParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.putMapping', params: IndicesPutMappingParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.putSettings', params: IndicesPutSettingsParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.putTemplate', params: IndicesPutTemplateParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.recovery', params: IndicesRecoveryParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.refresh', params: IndicesRefreshParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.rollover', params: IndicesRolloverParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.segments', params: IndicesSegmentsParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.shardStores', params: IndicesShardStoresParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.shrink', params: IndicesShrinkParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.stats', params: IndicesStatsParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.updateAliases', params: IndicesUpdateAliasesParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.upgrade', params: IndicesUpgradeParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'indices.validateQuery', params: IndicesValidateQueryParams, options?: CallAPIOptions): ReturnType; + + // ingest namepsace + (endpoint: 'ingest.deletePipeline', params: IngestDeletePipelineParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'ingest.getPipeline', params: IngestGetPipelineParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'ingest.putPipeline', params: IngestPutPipelineParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'ingest.simulate', params: IngestSimulateParams, options?: CallAPIOptions): ReturnType; + + // nodes namespace + (endpoint: 'nodes.hotThreads', params: NodesHotThreadsParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'nodes.info', params: NodesInfoParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'nodes.stats', params: NodesStatsParams, options?: CallAPIOptions): ReturnType; + + // snapshot namespace + (endpoint: 'snapshot.create', params: SnapshotCreateParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'snapshot.createRepository', params: SnapshotCreateRepositoryParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'snapshot.delete', params: SnapshotDeleteParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'snapshot.deleteRepository', params: SnapshotDeleteRepositoryParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'snapshot.get', params: SnapshotGetParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'snapshot.getRepository', params: SnapshotGetRepositoryParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'snapshot.restore', params: SnapshotRestoreParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'snapshot.status', params: SnapshotStatusParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'snapshot.verifyRepository', params: SnapshotVerifyRepositoryParams, options?: CallAPIOptions): ReturnType; + + // tasks namespace + (endpoint: 'tasks.cancel', params: TasksCancelParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'tasks.get', params: TasksGetParams, options?: CallAPIOptions): ReturnType; + (endpoint: 'tasks.list', params: TasksListParams, options?: CallAPIOptions): ReturnType; + + // other APIs accessed via transport.request + (endpoint: 'transport.request', clientParams: AssistantAPIClientParams, options?: CallAPIOptions): Promise< + AssistanceAPIResponse + >; + (endpoint: 'transport.request', clientParams: DeprecationAPIClientParams, options?: CallAPIOptions): Promise< + DeprecationAPIResponse + >; + + // Catch-all definition + (endpoint: string, clientParams?: Record, options?: CallAPIOptions): Promise; + /* eslint-enable */ +} + +export interface AssistantAPIClientParams extends GenericParams { + path: '/_migration/assistance'; + method: 'GET'; +} + +export type MIGRATION_ASSISTANCE_INDEX_ACTION = 'upgrade' | 'reindex'; +export type MIGRATION_DEPRECATION_LEVEL = 'none' | 'info' | 'warning' | 'critical'; + +export interface AssistanceAPIResponse { + indices: { + [indexName: string]: { + action_required: MIGRATION_ASSISTANCE_INDEX_ACTION; + }; + }; +} + +export interface DeprecationAPIClientParams extends GenericParams { + path: '/_migration/deprecations'; + method: 'GET'; +} + +export interface DeprecationInfo { + level: MIGRATION_DEPRECATION_LEVEL; + message: string; + url: string; + details?: string; +} + +export interface IndexSettingsDeprecationInfo { + [indexName: string]: DeprecationInfo[]; +} + +export interface DeprecationAPIResponse { + cluster_settings: DeprecationInfo[]; + ml_settings: DeprecationInfo[]; + node_settings: DeprecationInfo[]; + index_settings: IndexSettingsDeprecationInfo; +} diff --git a/src/core/server/elasticsearch/cluster_client.ts b/src/core/server/elasticsearch/cluster_client.ts index aa40010bf3b1a..cd581013e7957 100644 --- a/src/core/server/elasticsearch/cluster_client.ts +++ b/src/core/server/elasticsearch/cluster_client.ts @@ -27,7 +27,8 @@ import { ElasticsearchClientConfig, parseElasticsearchClientConfig, } from './elasticsearch_client_config'; -import { ScopedClusterClient } from './scoped_cluster_client'; +import { ScopedClusterClient, IScopedClusterClient } from './scoped_cluster_client'; +import { CallAPIOptions, APICaller } from './api_types'; /** * Support Legacy platform request for the period of migration. @@ -36,25 +37,6 @@ import { ScopedClusterClient } from './scoped_cluster_client'; */ const noop = () => undefined; -/** - * The set of options that defines how API call should be made and result be - * processed. - * - * @public - */ -export interface CallAPIOptions { - /** - * Indicates whether `401 Unauthorized` errors returned from the Elasticsearch API - * should be wrapped into `Boom` error instances with properly set `WWW-Authenticate` - * header that could have been returned by the API itself. If API didn't specify that - * then `Basic realm="Authorization Required"` is used as `WWW-Authenticate`. - */ - wrap401Errors: boolean; - /** - * A signal object that allows you to abort the request via an AbortController object. - */ - signal?: AbortSignal; -} /** * Calls the Elasticsearch API endpoint with the specified parameters. @@ -64,12 +46,12 @@ export interface CallAPIOptions { * Elasticsearch JS client. * @param options Options that affect the way we call the API and process the result. */ -async function callAPI( +const callAPI = async ( client: Client, endpoint: string, clientParams: Record = {}, options: CallAPIOptions = { wrap401Errors: true } -): Promise { +) => { const clientPath = endpoint.split('.'); const api: any = get(client, clientPath); if (!api) { @@ -95,7 +77,7 @@ async function callAPI( throw ElasticsearchErrorHelpers.decorateNotAuthorizedError(err); } -} +}; /** * Fake request object created manually by Kibana plugins. @@ -111,9 +93,17 @@ export interface FakeRequest { * of the internal Kibana user and the actual user that is derived from the request * headers (via `asScoped(...)`). * + * See {@link ClusterClient}. + * + * @public + */ +export type IClusterClient = Pick; + +/** + * {@inheritDoc IClusterClient} * @public */ -export class ClusterClient { +export class ClusterClient implements IClusterClient { /** * Raw Elasticsearch JS client that acts on behalf of the Kibana internal user. */ @@ -145,14 +135,14 @@ export class ClusterClient { * @param clientParams - A dictionary of parameters that will be passed directly to the Elasticsearch JS client. * @param options - Options that affect the way we call the API and process the result. */ - public callAsInternalUser = async ( + public callAsInternalUser: APICaller = async ( endpoint: string, clientParams: Record = {}, options?: CallAPIOptions ) => { this.assertIsNotClosed(); - return await callAPI(this.client, endpoint, clientParams, options); + return await (callAPI.bind(null, this.client) as APICaller)(endpoint, clientParams, options); }; /** @@ -181,7 +171,7 @@ export class ClusterClient { * @param request - Request the `ScopedClusterClient` instance will be scoped to. * Supports request optionality, Legacy.Request & FakeRequest for BWC with LegacyPlatform */ - public asScoped(request?: KibanaRequest | LegacyRequest | FakeRequest) { + public asScoped(request?: KibanaRequest | LegacyRequest | FakeRequest): IScopedClusterClient { // It'd have been quite expensive to create and configure client for every incoming // request since it involves parsing of the config, reading of the SSL certificate and // key files etc. Moreover scoped client needs two Elasticsearch JS clients at the same @@ -211,14 +201,18 @@ export class ClusterClient { * @param clientParams - A dictionary of parameters that will be passed directly to the Elasticsearch JS client. * @param options - Options that affect the way we call the API and process the result. */ - private callAsCurrentUser = async ( + private callAsCurrentUser: APICaller = async ( endpoint: string, clientParams: Record = {}, options?: CallAPIOptions ) => { this.assertIsNotClosed(); - return await callAPI(this.scopedClient!, endpoint, clientParams, options); + return await (callAPI.bind(null, this.scopedClient!) as APICaller)( + endpoint, + clientParams, + options + ); }; private assertIsNotClosed() { diff --git a/src/core/server/elasticsearch/elasticsearch_service.mock.ts b/src/core/server/elasticsearch/elasticsearch_service.mock.ts index dd35a4c3f5489..6cf759b73c656 100644 --- a/src/core/server/elasticsearch/elasticsearch_service.mock.ts +++ b/src/core/server/elasticsearch/elasticsearch_service.mock.ts @@ -18,17 +18,17 @@ */ import { BehaviorSubject } from 'rxjs'; -import { ClusterClient } from './cluster_client'; -import { ScopedClusterClient } from './scoped_cluster_client'; +import { IClusterClient } from './cluster_client'; +import { IScopedClusterClient } from './scoped_cluster_client'; import { ElasticsearchConfig } from './elasticsearch_config'; import { ElasticsearchService, ElasticsearchServiceSetup } from './elasticsearch_service'; -const createScopedClusterClientMock = (): jest.Mocked> => ({ +const createScopedClusterClientMock = (): jest.Mocked => ({ callAsInternalUser: jest.fn(), callAsCurrentUser: jest.fn(), }); -const createClusterClientMock = (): jest.Mocked> => ({ +const createClusterClientMock = (): jest.Mocked => ({ callAsInternalUser: jest.fn(), asScoped: jest.fn().mockImplementation(createScopedClusterClientMock), close: jest.fn(), @@ -41,8 +41,8 @@ const createSetupContractMock = () => { }, createClient: jest.fn().mockImplementation(createClusterClientMock), - adminClient$: new BehaviorSubject((createClusterClientMock() as unknown) as ClusterClient), - dataClient$: new BehaviorSubject((createClusterClientMock() as unknown) as ClusterClient), + adminClient$: new BehaviorSubject((createClusterClientMock() as unknown) as IClusterClient), + dataClient$: new BehaviorSubject((createClusterClientMock() as unknown) as IClusterClient), }; return setupContract; }; diff --git a/src/core/server/elasticsearch/elasticsearch_service.ts b/src/core/server/elasticsearch/elasticsearch_service.ts index 38a0d19b1ae3f..9bec697825346 100644 --- a/src/core/server/elasticsearch/elasticsearch_service.ts +++ b/src/core/server/elasticsearch/elasticsearch_service.ts @@ -23,7 +23,7 @@ import { merge } from 'lodash'; import { CoreService } from '../../types'; import { CoreContext } from '../core_context'; import { Logger } from '../logging'; -import { ClusterClient } from './cluster_client'; +import { ClusterClient, IClusterClient } from './cluster_client'; import { ElasticsearchClientConfig } from './elasticsearch_client_config'; import { ElasticsearchConfig, ElasticsearchConfigType } from './elasticsearch_config'; import { HttpServiceSetup, GetAuthHeaders } from '../http/'; @@ -65,9 +65,9 @@ export interface ElasticsearchServiceSetup { readonly createClient: ( type: string, clientConfig?: Partial - ) => ClusterClient; - readonly adminClient$: Observable; - readonly dataClient$: Observable; + ) => IClusterClient; + readonly adminClient$: Observable; + readonly dataClient$: Observable; } /** @internal */ diff --git a/src/core/server/elasticsearch/index.ts b/src/core/server/elasticsearch/index.ts index f732f9e39b9e3..7b496b738182b 100644 --- a/src/core/server/elasticsearch/index.ts +++ b/src/core/server/elasticsearch/index.ts @@ -18,8 +18,9 @@ */ export { ElasticsearchServiceSetup, ElasticsearchService } from './elasticsearch_service'; -export { CallAPIOptions, ClusterClient, FakeRequest } from './cluster_client'; -export { ScopedClusterClient, Headers, APICaller } from './scoped_cluster_client'; +export { IClusterClient, ClusterClient, FakeRequest } from './cluster_client'; +export { IScopedClusterClient, ScopedClusterClient, Headers } from './scoped_cluster_client'; export { ElasticsearchClientConfig } from './elasticsearch_client_config'; export { config } from './elasticsearch_config'; export { ElasticsearchError, ElasticsearchErrorHelpers } from './errors'; +export * from './api_types'; diff --git a/src/core/server/elasticsearch/scoped_cluster_client.ts b/src/core/server/elasticsearch/scoped_cluster_client.ts index d89a15e336b33..02a37e1e3567f 100644 --- a/src/core/server/elasticsearch/scoped_cluster_client.ts +++ b/src/core/server/elasticsearch/scoped_cluster_client.ts @@ -19,27 +19,31 @@ import { intersection, isObject } from 'lodash'; import { Headers } from '../http/router'; -import { CallAPIOptions } from './cluster_client'; +import { APICaller, CallAPIOptions } from './api_types'; /** @public */ export { Headers }; -/** @public */ -export type APICaller = ( - endpoint: string, - clientParams: Record, - options?: CallAPIOptions -) => Promise; - /** * Serves the same purpose as "normal" `ClusterClient` but exposes additional * `callAsCurrentUser` method that doesn't use credentials of the Kibana internal * user (as `callAsInternalUser` does) to request Elasticsearch API, but rather - * passes HTTP headers extracted from the current user request to the API + * passes HTTP headers extracted from the current user request to the API. * + * See {@link ScopedClusterClient}. + * + * @public + */ +export type IScopedClusterClient = Pick< + ScopedClusterClient, + 'callAsCurrentUser' | 'callAsInternalUser' +>; + +/** + * {@inheritDoc IScopedClusterClient} * @public */ -export class ScopedClusterClient { +export class ScopedClusterClient implements IScopedClusterClient { constructor( private readonly internalAPICaller: APICaller, private readonly scopedAPICaller: APICaller, diff --git a/src/core/server/index.ts b/src/core/server/index.ts index ca497e0f2d32d..3cc420b766439 100644 --- a/src/core/server/index.ts +++ b/src/core/server/index.ts @@ -41,10 +41,10 @@ import { Observable } from 'rxjs'; import { - ClusterClient, + IClusterClient, ElasticsearchClientConfig, ElasticsearchServiceSetup, - ScopedClusterClient, + IScopedClusterClient, } from './elasticsearch'; import { HttpServiceSetup, @@ -68,16 +68,17 @@ export { } from './context'; export { CoreId } from './core_context'; export { - CallAPIOptions, ClusterClient, + IClusterClient, Headers, ScopedClusterClient, + IScopedClusterClient, ElasticsearchClientConfig, ElasticsearchError, ElasticsearchErrorHelpers, - APICaller, FakeRequest, } from './elasticsearch'; +export * from './elasticsearch/api_types'; export { AuthenticationHandler, AuthHeaders, @@ -184,8 +185,8 @@ export { LegacyServiceSetupDeps, LegacyServiceStartDeps } from './legacy'; export interface RequestHandlerContext { core: { elasticsearch: { - dataClient: ScopedClusterClient; - adminClient: ScopedClusterClient; + dataClient: IScopedClusterClient; + adminClient: IScopedClusterClient; }; }; } @@ -200,12 +201,12 @@ export interface CoreSetup { createContextContainer: ContextSetup['createContextContainer']; }; elasticsearch: { - adminClient$: Observable; - dataClient$: Observable; + adminClient$: Observable; + dataClient$: Observable; createClient: ( type: string, clientConfig?: Partial - ) => ClusterClient; + ) => IClusterClient; }; http: { createCookieSessionStorageFactory: HttpServiceSetup['createCookieSessionStorageFactory']; diff --git a/src/core/server/saved_objects/service/lib/repository.test.js b/src/core/server/saved_objects/service/lib/repository.test.js index bc646c8c1d2e1..bbca181e05488 100644 --- a/src/core/server/saved_objects/service/lib/repository.test.js +++ b/src/core/server/saved_objects/service/lib/repository.test.js @@ -1744,6 +1744,68 @@ describe('SavedObjectsRepository', () => { ); }); + it('does not pass references if omitted', async () => { + await savedObjectsRepository.update( + type, + id, + { title: 'Testing' } + ); + + expect(callAdminCluster).toHaveBeenCalledTimes(1); + expect(callAdminCluster).not.toHaveBeenCalledWith( + expect.any(String), + expect.objectContaining({ + body: { + doc: expect.objectContaining({ + references: [], + }) + } + }) + ); + }); + + it('passes references if they are provided', async () => { + await savedObjectsRepository.update( + type, + id, + { title: 'Testing' }, + { references: ['foo'] } + ); + + expect(callAdminCluster).toHaveBeenCalledTimes(1); + expect(callAdminCluster).toHaveBeenCalledWith( + expect.any(String), + expect.objectContaining({ + body: { + doc: expect.objectContaining({ + references: ['foo'], + }) + } + }) + ); + }); + + it('passes empty references array if empty references array is provided', async () => { + await savedObjectsRepository.update( + type, + id, + { title: 'Testing' }, + { references: [] } + ); + + expect(callAdminCluster).toHaveBeenCalledTimes(1); + expect(callAdminCluster).toHaveBeenCalledWith( + expect.any(String), + expect.objectContaining({ + body: { + doc: expect.objectContaining({ + references: [], + }) + } + }) + ); + }); + it(`prepends namespace to the id but doesn't add namespace to body when providing namespace for namespaced type`, async () => { await savedObjectsRepository.update( 'index-pattern', diff --git a/src/core/server/saved_objects/service/lib/repository.ts b/src/core/server/saved_objects/service/lib/repository.ts index aadb82486ccce..cc5b9804769dd 100644 --- a/src/core/server/saved_objects/service/lib/repository.ts +++ b/src/core/server/saved_objects/service/lib/repository.ts @@ -644,9 +644,19 @@ export class SavedObjectsRepository { throw SavedObjectsErrorHelpers.createGenericNotFoundError(type, id); } - const { version, namespace, references = [] } = options; + const { version, namespace, references } = options; const time = this._getCurrentTime(); + + const doc = { + [type]: attributes, + updated_at: time, + references, + }; + if (!Array.isArray(doc.references)) { + delete doc.references; + } + const response = await this._writeToCluster('update', { id: this._serializer.generateRawId(namespace, type, id), index: this.getIndexForType(type), @@ -654,11 +664,7 @@ export class SavedObjectsRepository { refresh: 'wait_for', ignore: [404], body: { - doc: { - [type]: attributes, - updated_at: time, - references, - }, + doc, }, }); diff --git a/src/core/server/saved_objects/service/saved_objects_client.ts b/src/core/server/saved_objects/service/saved_objects_client.ts index 039579c5a2d14..6e23f81aa3df9 100644 --- a/src/core/server/saved_objects/service/saved_objects_client.ts +++ b/src/core/server/saved_objects/service/saved_objects_client.ts @@ -114,8 +114,9 @@ export interface SavedObjectsBulkResponse * @public */ export interface SavedObjectsUpdateResponse - extends Omit, 'attributes'> { + extends Omit, 'attributes' | 'references'> { attributes: Partial; + references: SavedObjectReference[] | undefined; } /** diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md index 79728ecc8fb98..2de72cf1a35f6 100644 --- a/src/core/server/server.api.md +++ b/src/core/server/server.api.md @@ -5,30 +5,410 @@ ```ts import Boom from 'boom'; +import { BulkIndexDocumentsParams } from 'elasticsearch'; import { CallCluster } from 'src/legacy/core_plugins/elasticsearch'; +import { CatAliasesParams } from 'elasticsearch'; +import { CatAllocationParams } from 'elasticsearch'; +import { CatCommonParams } from 'elasticsearch'; +import { CatFielddataParams } from 'elasticsearch'; +import { CatHealthParams } from 'elasticsearch'; +import { CatHelpParams } from 'elasticsearch'; +import { CatIndicesParams } from 'elasticsearch'; +import { CatRecoveryParams } from 'elasticsearch'; +import { CatSegmentsParams } from 'elasticsearch'; +import { CatShardsParams } from 'elasticsearch'; +import { CatSnapshotsParams } from 'elasticsearch'; +import { CatTasksParams } from 'elasticsearch'; +import { CatThreadPoolParams } from 'elasticsearch'; +import { ClearScrollParams } from 'elasticsearch'; +import { Client } from 'elasticsearch'; +import { ClusterAllocationExplainParams } from 'elasticsearch'; +import { ClusterGetSettingsParams } from 'elasticsearch'; +import { ClusterHealthParams } from 'elasticsearch'; +import { ClusterPendingTasksParams } from 'elasticsearch'; +import { ClusterPutSettingsParams } from 'elasticsearch'; +import { ClusterRerouteParams } from 'elasticsearch'; +import { ClusterStateParams } from 'elasticsearch'; +import { ClusterStatsParams } from 'elasticsearch'; import { ConfigOptions } from 'elasticsearch'; +import { CountParams } from 'elasticsearch'; +import { CreateDocumentParams } from 'elasticsearch'; +import { DeleteDocumentByQueryParams } from 'elasticsearch'; +import { DeleteDocumentParams } from 'elasticsearch'; +import { DeleteScriptParams } from 'elasticsearch'; +import { DeleteTemplateParams } from 'elasticsearch'; import { DetailedPeerCertificate } from 'tls'; import { Duration } from 'moment'; +import { ExistsParams } from 'elasticsearch'; +import { ExplainParams } from 'elasticsearch'; +import { FieldStatsParams } from 'elasticsearch'; +import { GenericParams } from 'elasticsearch'; +import { GetParams } from 'elasticsearch'; +import { GetResponse } from 'elasticsearch'; +import { GetScriptParams } from 'elasticsearch'; +import { GetSourceParams } from 'elasticsearch'; +import { GetTemplateParams } from 'elasticsearch'; import { IncomingHttpHeaders } from 'http'; +import { IndexDocumentParams } from 'elasticsearch'; import { IndexPatternsService } from 'src/legacy/server/index_patterns'; +import { IndicesAnalyzeParams } from 'elasticsearch'; +import { IndicesClearCacheParams } from 'elasticsearch'; +import { IndicesCloseParams } from 'elasticsearch'; +import { IndicesCreateParams } from 'elasticsearch'; +import { IndicesDeleteAliasParams } from 'elasticsearch'; +import { IndicesDeleteParams } from 'elasticsearch'; +import { IndicesDeleteTemplateParams } from 'elasticsearch'; +import { IndicesExistsAliasParams } from 'elasticsearch'; +import { IndicesExistsParams } from 'elasticsearch'; +import { IndicesExistsTemplateParams } from 'elasticsearch'; +import { IndicesExistsTypeParams } from 'elasticsearch'; +import { IndicesFlushParams } from 'elasticsearch'; +import { IndicesFlushSyncedParams } from 'elasticsearch'; +import { IndicesForcemergeParams } from 'elasticsearch'; +import { IndicesGetAliasParams } from 'elasticsearch'; +import { IndicesGetFieldMappingParams } from 'elasticsearch'; +import { IndicesGetMappingParams } from 'elasticsearch'; +import { IndicesGetParams } from 'elasticsearch'; +import { IndicesGetSettingsParams } from 'elasticsearch'; +import { IndicesGetTemplateParams } from 'elasticsearch'; +import { IndicesGetUpgradeParams } from 'elasticsearch'; +import { IndicesOpenParams } from 'elasticsearch'; +import { IndicesPutAliasParams } from 'elasticsearch'; +import { IndicesPutMappingParams } from 'elasticsearch'; +import { IndicesPutSettingsParams } from 'elasticsearch'; +import { IndicesPutTemplateParams } from 'elasticsearch'; +import { IndicesRecoveryParams } from 'elasticsearch'; +import { IndicesRefreshParams } from 'elasticsearch'; +import { IndicesRolloverParams } from 'elasticsearch'; +import { IndicesSegmentsParams } from 'elasticsearch'; +import { IndicesShardStoresParams } from 'elasticsearch'; +import { IndicesShrinkParams } from 'elasticsearch'; +import { IndicesStatsParams } from 'elasticsearch'; +import { IndicesUpdateAliasesParams } from 'elasticsearch'; +import { IndicesUpgradeParams } from 'elasticsearch'; +import { IndicesValidateQueryParams } from 'elasticsearch'; +import { InfoParams } from 'elasticsearch'; +import { IngestDeletePipelineParams } from 'elasticsearch'; +import { IngestGetPipelineParams } from 'elasticsearch'; +import { IngestPutPipelineParams } from 'elasticsearch'; +import { IngestSimulateParams } from 'elasticsearch'; import { KibanaConfigType } from 'src/core/server/kibana_config'; import { Logger as Logger_2 } from 'src/core/server/logging'; +import { MGetParams } from 'elasticsearch'; +import { MGetResponse } from 'elasticsearch'; +import { MSearchParams } from 'elasticsearch'; +import { MSearchResponse } from 'elasticsearch'; +import { MSearchTemplateParams } from 'elasticsearch'; +import { MTermVectorsParams } from 'elasticsearch'; +import { NodesHotThreadsParams } from 'elasticsearch'; +import { NodesInfoParams } from 'elasticsearch'; +import { NodesStatsParams } from 'elasticsearch'; import { ObjectType } from '@kbn/config-schema'; import { Observable } from 'rxjs'; import { PeerCertificate } from 'tls'; +import { PingParams } from 'elasticsearch'; +import { PutScriptParams } from 'elasticsearch'; +import { PutTemplateParams } from 'elasticsearch'; import { Readable } from 'stream'; +import { ReindexParams } from 'elasticsearch'; +import { ReindexRethrottleParams } from 'elasticsearch'; +import { RenderSearchTemplateParams } from 'elasticsearch'; import { Request } from 'hapi'; import { ResponseObject } from 'hapi'; import { ResponseToolkit } from 'hapi'; +import { ScrollParams } from 'elasticsearch'; +import { SearchParams } from 'elasticsearch'; +import { SearchResponse } from 'elasticsearch'; +import { SearchShardsParams } from 'elasticsearch'; +import { SearchTemplateParams } from 'elasticsearch'; import { Server } from 'hapi'; import { ShallowPromise } from '@kbn/utility-types'; +import { SnapshotCreateParams } from 'elasticsearch'; +import { SnapshotCreateRepositoryParams } from 'elasticsearch'; +import { SnapshotDeleteParams } from 'elasticsearch'; +import { SnapshotDeleteRepositoryParams } from 'elasticsearch'; +import { SnapshotGetParams } from 'elasticsearch'; +import { SnapshotGetRepositoryParams } from 'elasticsearch'; +import { SnapshotRestoreParams } from 'elasticsearch'; +import { SnapshotStatusParams } from 'elasticsearch'; +import { SnapshotVerifyRepositoryParams } from 'elasticsearch'; import { Stream } from 'stream'; +import { SuggestParams } from 'elasticsearch'; +import { TasksCancelParams } from 'elasticsearch'; +import { TasksGetParams } from 'elasticsearch'; +import { TasksListParams } from 'elasticsearch'; +import { TermvectorsParams } from 'elasticsearch'; import { Type } from '@kbn/config-schema'; import { TypeOf } from '@kbn/config-schema'; +import { UpdateDocumentByQueryParams } from 'elasticsearch'; +import { UpdateDocumentParams } from 'elasticsearch'; import { Url } from 'url'; // @public (undocumented) -export type APICaller = (endpoint: string, clientParams: Record, options?: CallAPIOptions) => Promise; +export interface APICaller { + // (undocumented) + (endpoint: 'cluster.state', params: ClusterStateParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'bulk', params: BulkIndexDocumentsParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'count', params: CountParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'create', params: CreateDocumentParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'delete', params: DeleteDocumentParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'deleteByQuery', params: DeleteDocumentByQueryParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'deleteScript', params: DeleteScriptParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'deleteTemplate', params: DeleteTemplateParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'exists', params: ExistsParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'explain', params: ExplainParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'fieldStats', params: FieldStatsParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'get', params: GetParams, options?: CallAPIOptions): Promise>; + // (undocumented) + (endpoint: 'getScript', params: GetScriptParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'getSource', params: GetSourceParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'getTemplate', params: GetTemplateParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'index', params: IndexDocumentParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'info', params: InfoParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'mget', params: MGetParams, options?: CallAPIOptions): Promise>; + // (undocumented) + (endpoint: 'msearch', params: MSearchParams, options?: CallAPIOptions): Promise>; + // (undocumented) + (endpoint: 'msearchTemplate', params: MSearchTemplateParams, options?: CallAPIOptions): Promise>; + // (undocumented) + (endpoint: 'mtermvectors', params: MTermVectorsParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'ping', params: PingParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'putScript', params: PutScriptParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'putTemplate', params: PutTemplateParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'reindex', params: ReindexParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'reindexRethrottle', params: ReindexRethrottleParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'renderSearchTemplate', params: RenderSearchTemplateParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'scroll', params: ScrollParams, options?: CallAPIOptions): Promise>; + // (undocumented) + (endpoint: 'search', params: SearchParams, options?: CallAPIOptions): Promise>; + // (undocumented) + (endpoint: 'searchShards', params: SearchShardsParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'searchTemplate', params: SearchTemplateParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'suggest', params: SuggestParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'termvectors', params: TermvectorsParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'update', params: UpdateDocumentParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'updateByQuery', params: UpdateDocumentByQueryParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cat.aliases', params: CatAliasesParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cat.allocation', params: CatAllocationParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cat.count', params: CatAllocationParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cat.fielddata', params: CatFielddataParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cat.health', params: CatHealthParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cat.help', params: CatHelpParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cat.indices', params: CatIndicesParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cat.master', params: CatCommonParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cat.nodeattrs', params: CatCommonParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cat.nodes', params: CatCommonParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cat.pendingTasks', params: CatCommonParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cat.plugins', params: CatCommonParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cat.recovery', params: CatRecoveryParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cat.repositories', params: CatCommonParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cat.segments', params: CatSegmentsParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cat.shards', params: CatShardsParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cat.snapshots', params: CatSnapshotsParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cat.tasks', params: CatTasksParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cat.threadPool', params: CatThreadPoolParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cluster.allocationExplain', params: ClusterAllocationExplainParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cluster.getSettings', params: ClusterGetSettingsParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cluster.health', params: ClusterHealthParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cluster.pendingTasks', params: ClusterPendingTasksParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cluster.putSettings', params: ClusterPutSettingsParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cluster.reroute', params: ClusterRerouteParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'clearScroll', params: ClearScrollParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'cluster.stats', params: ClusterStatsParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.analyze', params: IndicesAnalyzeParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.clearCache', params: IndicesClearCacheParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.close', params: IndicesCloseParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.create', params: IndicesCreateParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.delete', params: IndicesDeleteParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.deleteAlias', params: IndicesDeleteAliasParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.deleteTemplate', params: IndicesDeleteTemplateParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.exists', params: IndicesExistsParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.existsAlias', params: IndicesExistsAliasParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.existsTemplate', params: IndicesExistsTemplateParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.existsType', params: IndicesExistsTypeParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.flush', params: IndicesFlushParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.flushSynced', params: IndicesFlushSyncedParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.forcemerge', params: IndicesForcemergeParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.get', params: IndicesGetParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.getAlias', params: IndicesGetAliasParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.getFieldMapping', params: IndicesGetFieldMappingParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.getMapping', params: IndicesGetMappingParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.getSettings', params: IndicesGetSettingsParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.getTemplate', params: IndicesGetTemplateParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.getUpgrade', params: IndicesGetUpgradeParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.open', params: IndicesOpenParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.putAlias', params: IndicesPutAliasParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.putMapping', params: IndicesPutMappingParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.putSettings', params: IndicesPutSettingsParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.putTemplate', params: IndicesPutTemplateParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.recovery', params: IndicesRecoveryParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.refresh', params: IndicesRefreshParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.rollover', params: IndicesRolloverParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.segments', params: IndicesSegmentsParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.shardStores', params: IndicesShardStoresParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.shrink', params: IndicesShrinkParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.stats', params: IndicesStatsParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.updateAliases', params: IndicesUpdateAliasesParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.upgrade', params: IndicesUpgradeParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'indices.validateQuery', params: IndicesValidateQueryParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'ingest.deletePipeline', params: IngestDeletePipelineParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'ingest.getPipeline', params: IngestGetPipelineParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'ingest.putPipeline', params: IngestPutPipelineParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'ingest.simulate', params: IngestSimulateParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'nodes.hotThreads', params: NodesHotThreadsParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'nodes.info', params: NodesInfoParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'nodes.stats', params: NodesStatsParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'snapshot.create', params: SnapshotCreateParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'snapshot.createRepository', params: SnapshotCreateRepositoryParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'snapshot.delete', params: SnapshotDeleteParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'snapshot.deleteRepository', params: SnapshotDeleteRepositoryParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'snapshot.get', params: SnapshotGetParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'snapshot.getRepository', params: SnapshotGetRepositoryParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'snapshot.restore', params: SnapshotRestoreParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'snapshot.status', params: SnapshotStatusParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'snapshot.verifyRepository', params: SnapshotVerifyRepositoryParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'tasks.cancel', params: TasksCancelParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'tasks.get', params: TasksGetParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'tasks.list', params: TasksListParams, options?: CallAPIOptions): ReturnType; + // (undocumented) + (endpoint: 'transport.request', clientParams: AssistantAPIClientParams, options?: CallAPIOptions): Promise; + // (undocumented) + (endpoint: 'transport.request', clientParams: DeprecationAPIClientParams, options?: CallAPIOptions): Promise; + // (undocumented) + (endpoint: string, clientParams?: Record, options?: CallAPIOptions): Promise; +} + +// Warning: (ae-missing-release-tag) "AssistanceAPIResponse" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface AssistanceAPIResponse { + // (undocumented) + indices: { + [indexName: string]: { + action_required: MIGRATION_ASSISTANCE_INDEX_ACTION; + }; + }; +} + +// Warning: (ae-missing-release-tag) "AssistantAPIClientParams" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface AssistantAPIClientParams extends GenericParams { + // (undocumented) + method: 'GET'; + // (undocumented) + path: '/_migration/assistance'; +} // Warning: (ae-forgotten-export) The symbol "AuthResult" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "KibanaResponse" needs to be exported by the entry point index.d.ts @@ -81,10 +461,10 @@ export interface CallAPIOptions { } // @public -export class ClusterClient { +export class ClusterClient implements IClusterClient { constructor(config: ElasticsearchClientConfig, log: Logger, getAuthHeaders?: GetAuthHeaders); - asScoped(request?: KibanaRequest | LegacyRequest | FakeRequest): ScopedClusterClient; - callAsInternalUser: (endpoint: string, clientParams?: Record, options?: CallAPIOptions | undefined) => Promise; + asScoped(request?: KibanaRequest | LegacyRequest | FakeRequest): IScopedClusterClient; + callAsInternalUser: APICaller; close(): void; } @@ -124,9 +504,9 @@ export interface CoreSetup { }; // (undocumented) elasticsearch: { - adminClient$: Observable; - dataClient$: Observable; - createClient: (type: string, clientConfig?: Partial) => ClusterClient; + adminClient$: Observable; + dataClient$: Observable; + createClient: (type: string, clientConfig?: Partial) => IClusterClient; }; // (undocumented) http: { @@ -153,6 +533,44 @@ export interface CustomHttpResponseOptions; - readonly createClient: (type: string, clientConfig?: Partial) => ClusterClient; + readonly adminClient$: Observable; + readonly createClient: (type: string, clientConfig?: Partial) => IClusterClient; // (undocumented) - readonly dataClient$: Observable; + readonly dataClient$: Observable; // (undocumented) readonly legacy: { readonly config$: Observable; @@ -279,6 +697,9 @@ export interface HttpServiceStart { // @public export type IBasePath = Pick; +// @public +export type IClusterClient = Pick; + // @public export interface IContextContainer> { createHandler(pluginOpaqueId: PluginOpaqueId, handler: THandler): (...rest: HandlerParameters) => ShallowPromise>; @@ -299,6 +720,14 @@ export interface IKibanaSocket { getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate | null; } +// Warning: (ae-missing-release-tag) "IndexSettingsDeprecationInfo" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface IndexSettingsDeprecationInfo { + // (undocumented) + [indexName: string]: DeprecationInfo[]; +} + // @internal (undocumented) export interface InternalCoreSetup { // (undocumented) @@ -333,6 +762,9 @@ export interface IRouter { // @public export type IsAuthenticated = (request: KibanaRequest | LegacyRequest) => boolean; +// @public +export type IScopedClusterClient = Pick; + // @public export class KibanaRequest { // @internal (undocumented) @@ -494,6 +926,16 @@ export interface LogRecord { timestamp: Date; } +// Warning: (ae-missing-release-tag) "MIGRATION_ASSISTANCE_INDEX_ACTION" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type MIGRATION_ASSISTANCE_INDEX_ACTION = 'upgrade' | 'reindex'; + +// Warning: (ae-missing-release-tag) "MIGRATION_DEPRECATION_LEVEL" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type MIGRATION_DEPRECATION_LEVEL = 'none' | 'info' | 'warning' | 'critical'; + // Warning: (ae-forgotten-export) The symbol "OnPostAuthResult" needs to be exported by the entry point index.d.ts // // @public (undocumented) @@ -602,8 +1044,8 @@ export interface RequestHandlerContext { // (undocumented) core: { elasticsearch: { - dataClient: ScopedClusterClient; - adminClient: ScopedClusterClient; + dataClient: IScopedClusterClient; + adminClient: IScopedClusterClient; }; }; } @@ -1069,16 +1511,18 @@ export interface SavedObjectsUpdateOptions extends SavedObjectsBaseOptions { // Warning: (ae-forgotten-export) The symbol "Omit" needs to be exported by the entry point index.d.ts // // @public (undocumented) -export interface SavedObjectsUpdateResponse extends Omit, 'attributes'> { +export interface SavedObjectsUpdateResponse extends Omit, 'attributes' | 'references'> { // (undocumented) attributes: Partial; + // (undocumented) + references: SavedObjectReference[] | undefined; } // @public -export class ScopedClusterClient { +export class ScopedClusterClient implements IScopedClusterClient { constructor(internalAPICaller: APICaller, scopedAPICaller: APICaller, headers?: Headers | undefined); - callAsCurrentUser(endpoint: string, clientParams?: Record, options?: CallAPIOptions): Promise; - callAsInternalUser(endpoint: string, clientParams?: Record, options?: CallAPIOptions): Promise; + callAsCurrentUser(endpoint: string, clientParams?: Record, options?: CallAPIOptions): Promise; + callAsInternalUser(endpoint: string, clientParams?: Record, options?: CallAPIOptions): Promise; } // @public diff --git a/src/es_archiver/lib/archives/__tests__/parse.js b/src/es_archiver/lib/archives/__tests__/parse.js index 2a525e76d98e8..c31136df97a33 100644 --- a/src/es_archiver/lib/archives/__tests__/parse.js +++ b/src/es_archiver/lib/archives/__tests__/parse.js @@ -161,6 +161,17 @@ describe('esArchiver createParseArchiveStreams', () => { }); }); + it('parses blank files', async () => { + const output = await createPromiseFromStreams([ + createListStream([]), + createGzip(), + ...createParseArchiveStreams(({ gzip: true })), + createConcatStream([]) + ]); + + expect(output).to.eql([]); + }); + describe('stream errors', () => { it('stops when the input is not valid gzip archive', async () => { try { diff --git a/src/es_archiver/lib/archives/parse.js b/src/es_archiver/lib/archives/parse.js index 113e37b81b85b..86b7d40b00034 100644 --- a/src/es_archiver/lib/archives/parse.js +++ b/src/es_archiver/lib/archives/parse.js @@ -19,7 +19,7 @@ import { createGunzip } from 'zlib'; import { PassThrough } from 'stream'; - +import { createFilterStream } from '../../../legacy/utils/streams/filter_stream'; import { createSplitStream, createReplaceStream, @@ -33,6 +33,7 @@ export function createParseArchiveStreams({ gzip = false } = {}) { gzip ? createGunzip() : new PassThrough(), createReplaceStream('\r\n', '\n'), createSplitStream(RECORD_SEPARATOR), + createFilterStream(l => l.match(/[^\s]/)), createMapStream(json => JSON.parse(json.trim())), ]; } diff --git a/src/legacy/core_plugins/data/public/filter/filter_manager/filter_manager.test.ts b/src/legacy/core_plugins/data/public/filter/filter_manager/filter_manager.test.ts index 5eaa6744216c4..3980251ce0043 100644 --- a/src/legacy/core_plugins/data/public/filter/filter_manager/filter_manager.test.ts +++ b/src/legacy/core_plugins/data/public/filter/filter_manager/filter_manager.test.ts @@ -35,9 +35,6 @@ import { getFiltersArray } from './test_helpers/get_filters_array'; import { coreMock } from '../../../../../../core/public/mocks'; const setupMock = coreMock.createSetup(); -import { timefilterServiceMock } from '../../timefilter/timefilter_service.mock'; -const timefilterSetupMock = timefilterServiceMock.createSetupContract(); - setupMock.uiSettings.get.mockImplementation((key: string) => { return true; }); @@ -61,8 +58,7 @@ describe('filter_manager', () => { indexPatterns = new StubIndexPatterns(); filterManager = new FilterManager( (indexPatterns as unknown) as IndexPatterns, - setupMock.uiSettings, - timefilterSetupMock.timefilter + setupMock.uiSettings ); readyFilters = getFiltersArray(); @@ -694,12 +690,4 @@ describe('filter_manager', () => { expect(updateStub).toBeCalledTimes(1); }); }); - - describe('addFiltersAndChangeTimeFilter', () => { - test('should just add filters if there is no time filter in array', async () => { - const f1 = getFilter(FilterStateStore.GLOBAL_STATE, false, false, 'age', 34); - await filterManager.addFiltersAndChangeTimeFilter([f1]); - expect(filterManager.getFilters()).toHaveLength(1); - }); - }); }); diff --git a/src/legacy/core_plugins/data/public/filter/filter_manager/filter_manager.ts b/src/legacy/core_plugins/data/public/filter/filter_manager/filter_manager.ts index 9818c0dd31a99..6e5fa37113451 100644 --- a/src/legacy/core_plugins/data/public/filter/filter_manager/filter_manager.ts +++ b/src/legacy/core_plugins/data/public/filter/filter_manager/filter_manager.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Filter, isFilterPinned, isRangeFilter, FilterStateStore } from '@kbn/es-query'; +import { Filter, isFilterPinned, FilterStateStore } from '@kbn/es-query'; import _ from 'lodash'; import { Subject } from 'rxjs'; @@ -27,12 +27,9 @@ import { UiSettingsClientContract } from 'src/core/public'; import { compareFilters } from './lib/compare_filters'; import { mapAndFlattenFilters } from './lib/map_and_flatten_filters'; import { uniqFilters } from './lib/uniq_filters'; -import { extractTimeFilter } from './lib/extract_time_filter'; -import { changeTimeFilter } from './lib/change_time_filter'; import { onlyDisabledFiltersChanged } from './lib/only_disabled'; import { PartitionedFilters } from './partitioned_filters'; import { IndexPatterns } from '../../index_patterns'; -import { TimefilterContract } from '../../timefilter'; export class FilterManager { private indexPatterns: IndexPatterns; @@ -40,16 +37,10 @@ export class FilterManager { private updated$: Subject = new Subject(); private fetch$: Subject = new Subject(); private uiSettings: UiSettingsClientContract; - private timefilter: TimefilterContract; - constructor( - indexPatterns: IndexPatterns, - uiSettings: UiSettingsClientContract, - timefilter: TimefilterContract - ) { + constructor(indexPatterns: IndexPatterns, uiSettings: UiSettingsClientContract) { this.indexPatterns = indexPatterns; this.uiSettings = uiSettings; - this.timefilter = timefilter; } private mergeIncomingFilters(partitionedFilters: PartitionedFilters): Filter[] { @@ -189,15 +180,6 @@ export class FilterManager { await this.setFilters([]); } - public async addFiltersAndChangeTimeFilter(filters: Filter[]) { - const timeFilter = await extractTimeFilter(this.indexPatterns, filters); - - if (isRangeFilter(timeFilter)) { - changeTimeFilter(this.timefilter, timeFilter); - } - return this.addFilters(filters.filter(filter => filter !== timeFilter)); - } - public static setFiltersStore(filters: Filter[], store: FilterStateStore) { _.map(filters, (filter: Filter) => { // Override status only for filters that didn't have state in the first place. diff --git a/src/legacy/core_plugins/data/public/filter/filter_manager/filter_state_manager.test.ts b/src/legacy/core_plugins/data/public/filter/filter_manager/filter_state_manager.test.ts index a4826e059fa22..84f336506b375 100644 --- a/src/legacy/core_plugins/data/public/filter/filter_manager/filter_state_manager.test.ts +++ b/src/legacy/core_plugins/data/public/filter/filter_manager/filter_state_manager.test.ts @@ -31,9 +31,6 @@ import { StubIndexPatterns } from './test_helpers/stub_index_pattern'; import { coreMock } from '../../../../../../core/public/mocks'; const setupMock = coreMock.createSetup(); -import { timefilterServiceMock } from '../../timefilter/timefilter_service.mock'; -const timefilterSetupMock = timefilterServiceMock.createSetupContract(); - setupMock.uiSettings.get.mockImplementation((key: string) => { return true; }); @@ -50,8 +47,7 @@ describe('filter_state_manager', () => { const indexPatterns = new StubIndexPatterns(); filterManager = new FilterManager( (indexPatterns as unknown) as IndexPatterns, - setupMock.uiSettings, - timefilterSetupMock.timefilter + setupMock.uiSettings ); }); diff --git a/src/legacy/core_plugins/data/public/filter/filter_manager/index.ts b/src/legacy/core_plugins/data/public/filter/filter_manager/index.ts index a29dcde6f059d..ac533eaaf89ea 100644 --- a/src/legacy/core_plugins/data/public/filter/filter_manager/index.ts +++ b/src/legacy/core_plugins/data/public/filter/filter_manager/index.ts @@ -21,4 +21,6 @@ export { FilterManager } from './filter_manager'; export { FilterStateManager } from './filter_state_manager'; export { uniqFilters } from './lib/uniq_filters'; +export { extractTimeFilter } from './lib/extract_time_filter'; +export { changeTimeFilter } from './lib/change_time_filter'; export { onlyDisabledFiltersChanged } from './lib/only_disabled'; diff --git a/src/legacy/core_plugins/data/public/filter/filter_manager/lib/change_time_filter.ts b/src/legacy/core_plugins/data/public/filter/filter_manager/lib/change_time_filter.ts index fac40bf53fece..e975fc80e6c14 100644 --- a/src/legacy/core_plugins/data/public/filter/filter_manager/lib/change_time_filter.ts +++ b/src/legacy/core_plugins/data/public/filter/filter_manager/lib/change_time_filter.ts @@ -19,17 +19,15 @@ import moment from 'moment'; import { keys } from 'lodash'; -import { RangeFilter, isRangeFilter } from '@kbn/es-query'; +import { RangeFilter } from '@kbn/es-query'; import { TimefilterContract } from '../../../timefilter'; export function changeTimeFilter(timeFilter: TimefilterContract, filter: RangeFilter) { - if (isRangeFilter(filter)) { - const key = keys(filter.range)[0]; - const values = filter.range[key]; + const key = keys(filter.range)[0]; + const values = filter.range[key]; - timeFilter.setTime({ - from: moment(values.gt || values.gte), - to: moment(values.lt || values.lte), - }); - } + timeFilter.setTime({ + from: moment(values.gt || values.gte), + to: moment(values.lt || values.lte), + }); } diff --git a/src/legacy/core_plugins/data/public/filter/filter_manager/lib/extract_time_filter.test.ts b/src/legacy/core_plugins/data/public/filter/filter_manager/lib/extract_time_filter.test.ts index 7d8e4edbfd849..d55c9babeed79 100644 --- a/src/legacy/core_plugins/data/public/filter/filter_manager/lib/extract_time_filter.test.ts +++ b/src/legacy/core_plugins/data/public/filter/filter_manager/lib/extract_time_filter.test.ts @@ -17,41 +17,42 @@ * under the License. */ -import { Filter, buildRangeFilter, buildQueryFilter } from '@kbn/es-query'; +import { Filter, buildRangeFilter, buildQueryFilter, buildPhraseFilter } from '@kbn/es-query'; import { extractTimeFilter } from './extract_time_filter'; -import { IndexPatterns } from '../../../index_patterns'; - -const mockIndexPatterns = jest.fn( - () => - ({ - get: () => ({ - timeFieldName: 'time', - }), - } as any) -); describe('filter manager utilities', () => { describe('extractTimeFilter()', () => { - const indexPatterns = mockIndexPatterns() as IndexPatterns; - - test('should return the matching filter for the default time field', async () => { + test('should detect timeFilter', async () => { const filters: Filter[] = [ buildQueryFilter({ _type: { match: { query: 'apache', type: 'phrase' } } }, 'logstash-*'), buildRangeFilter({ name: 'time' }, { gt: 1388559600000, lt: 1388646000000 }, 'logstash-*'), ]; - const result = await extractTimeFilter(indexPatterns, filters); + const result = await extractTimeFilter('time', filters); - expect(result).toEqual(filters[1]); + expect(result.timeRangeFilter).toEqual(filters[1]); + expect(result.restOfFilters[0]).toEqual(filters[0]); }); - test('should not return the non-matching filter for the default time field', async () => { + test("should not return timeFilter when name doesn't match", async () => { const filters: Filter[] = [ buildQueryFilter({ _type: { match: { query: 'apache', type: 'phrase' } } }, 'logstash-*'), buildRangeFilter({ name: '@timestamp' }, { from: 1, to: 2 }, 'logstash-*'), ]; - const result = await extractTimeFilter(indexPatterns, filters); + const result = await extractTimeFilter('time', filters); + + expect(result.timeRangeFilter).toBeUndefined(); + expect(result.restOfFilters).toEqual(filters); + }); + + test('should not return a non range filter, even when names match', async () => { + const filters: Filter[] = [ + buildQueryFilter({ _type: { match: { query: 'apache', type: 'phrase' } } }, 'logstash-*'), + buildPhraseFilter({ name: 'time' }, 'banana', 'logstash-*'), + ]; + const result = await extractTimeFilter('time', filters); - expect(result).toBeUndefined(); + expect(result.timeRangeFilter).toBeUndefined(); + expect(result.restOfFilters).toEqual(filters); }); }); }); diff --git a/src/legacy/core_plugins/data/public/filter/filter_manager/lib/extract_time_filter.ts b/src/legacy/core_plugins/data/public/filter/filter_manager/lib/extract_time_filter.ts index a951c2df4383a..22bda5b21295e 100644 --- a/src/legacy/core_plugins/data/public/filter/filter_manager/lib/extract_time_filter.ts +++ b/src/legacy/core_plugins/data/public/filter/filter_manager/lib/extract_time_filter.ts @@ -17,25 +17,22 @@ * under the License. */ -import { keys, find, get } from 'lodash'; -import { Filter, isRangeFilter } from '@kbn/es-query'; -import { IndexPatterns } from '../../../index_patterns'; +import { keys, partition } from 'lodash'; +import { Filter, isRangeFilter, RangeFilter } from '@kbn/es-query'; -export async function extractTimeFilter(indexPatterns: IndexPatterns, filters: Filter[]) { - // Assume all the index patterns are the same since they will be added - // from the same visualization. - const id: string = get(filters, '[0].meta.index'); - if (id == null) return; - - const indexPattern = await indexPatterns.get(id); - - return find(filters, (obj: Filter) => { +export function extractTimeFilter(timeFieldName: string, filters: Filter[]) { + const [timeRangeFilter, restOfFilters] = partition(filters, (obj: Filter) => { let key; if (isRangeFilter(obj)) { key = keys(obj.range)[0]; } - return Boolean(key && key === indexPattern.timeFieldName); + return Boolean(key && key === timeFieldName); }); + + return { + restOfFilters, + timeRangeFilter: timeRangeFilter[0] as RangeFilter | undefined, + }; } diff --git a/src/legacy/core_plugins/data/public/filter/filter_service.ts b/src/legacy/core_plugins/data/public/filter/filter_service.ts index 8853fae455c1d..063b69c175b20 100644 --- a/src/legacy/core_plugins/data/public/filter/filter_service.ts +++ b/src/legacy/core_plugins/data/public/filter/filter_service.ts @@ -20,7 +20,6 @@ import { UiSettingsClientContract } from 'src/core/public'; import { IndexPatterns } from '../index_patterns'; import { FilterManager } from './filter_manager'; -import { TimefilterContract } from '../timefilter'; /** * Filter Service @@ -30,13 +29,12 @@ import { TimefilterContract } from '../timefilter'; export interface FilterServiceDependencies { indexPatterns: IndexPatterns; uiSettings: UiSettingsClientContract; - timefilter: TimefilterContract; } export class FilterService { - public setup({ indexPatterns, uiSettings, timefilter }: FilterServiceDependencies) { + public setup({ indexPatterns, uiSettings }: FilterServiceDependencies) { return { - filterManager: new FilterManager(indexPatterns, uiSettings, timefilter), + filterManager: new FilterManager(indexPatterns, uiSettings), }; } diff --git a/src/legacy/core_plugins/data/public/index.ts b/src/legacy/core_plugins/data/public/index.ts index b9554310e2413..d9abacd45eda4 100644 --- a/src/legacy/core_plugins/data/public/index.ts +++ b/src/legacy/core_plugins/data/public/index.ts @@ -47,6 +47,8 @@ export { FilterManager, FilterStateManager, uniqFilters, + extractTimeFilter, + changeTimeFilter, onlyDisabledFiltersChanged, } from './filter/filter_manager'; export { diff --git a/src/legacy/core_plugins/data/public/plugin.ts b/src/legacy/core_plugins/data/public/plugin.ts index 7f2c92cb5c6fe..549342c0da9d4 100644 --- a/src/legacy/core_plugins/data/public/plugin.ts +++ b/src/legacy/core_plugins/data/public/plugin.ts @@ -114,7 +114,6 @@ export class DataPlugin filter: this.filter.setup({ uiSettings, indexPatterns: indexPatternsService.indexPatterns, - timefilter: timefilterService.timefilter, }), query: this.query.setup(), search: this.search.setup(savedObjectsClient), diff --git a/src/legacy/core_plugins/elasticsearch/lib/__tests__/ensure_es_version.js b/src/legacy/core_plugins/elasticsearch/lib/__tests__/ensure_es_version.js index c82e4418f4d85..baf728262aad1 100644 --- a/src/legacy/core_plugins/elasticsearch/lib/__tests__/ensure_es_version.js +++ b/src/legacy/core_plugins/elasticsearch/lib/__tests__/ensure_es_version.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import Promise from 'bluebird'; +import Bluebird from 'bluebird'; import sinon from 'sinon'; import expect from '@kbn/expect'; @@ -74,13 +74,13 @@ describe('plugins/elasticsearch', () => { } const cluster = server.plugins.elasticsearch.getCluster('admin'); - cluster.callWithInternalUser.withArgs('nodes.info', sinon.match.any).returns(Promise.resolve({ nodes: nodes })); + cluster.callWithInternalUser.withArgs('nodes.info', sinon.match.any).returns(Bluebird.resolve({ nodes: nodes })); } function setNodeWithoutHTTP(version) { const nodes = { 'node-without-http': { version, ip: 'ip' } }; const cluster = server.plugins.elasticsearch.getCluster('admin'); - cluster.callWithInternalUser.withArgs('nodes.info', sinon.match.any).returns(Promise.resolve({ nodes: nodes })); + cluster.callWithInternalUser.withArgs('nodes.info', sinon.match.any).returns(Bluebird.resolve({ nodes: nodes })); } it('returns true with single a node that matches', async () => { diff --git a/src/legacy/core_plugins/elasticsearch/lib/__tests__/health_check.js b/src/legacy/core_plugins/elasticsearch/lib/__tests__/health_check.js index e52d0bfc94ca1..6ea62361b5b31 100644 --- a/src/legacy/core_plugins/elasticsearch/lib/__tests__/health_check.js +++ b/src/legacy/core_plugins/elasticsearch/lib/__tests__/health_check.js @@ -17,7 +17,7 @@ * under the License. */ -import Promise from 'bluebird'; +import Bluebird from 'bluebird'; import sinon from 'sinon'; import expect from '@kbn/expect'; @@ -58,11 +58,11 @@ describe('plugins/elasticsearch', () => { }; cluster = { callWithInternalUser: sinon.stub(), errors: { NoConnections } }; - cluster.callWithInternalUser.withArgs('index', sinon.match.any).returns(Promise.resolve()); - cluster.callWithInternalUser.withArgs('mget', sinon.match.any).returns(Promise.resolve({ ok: true })); - cluster.callWithInternalUser.withArgs('get', sinon.match.any).returns(Promise.resolve({ found: false })); - cluster.callWithInternalUser.withArgs('search', sinon.match.any).returns(Promise.resolve({ hits: { hits: [] } })); - cluster.callWithInternalUser.withArgs('nodes.info', sinon.match.any).returns(Promise.resolve({ + cluster.callWithInternalUser.withArgs('index', sinon.match.any).returns(Bluebird.resolve()); + cluster.callWithInternalUser.withArgs('mget', sinon.match.any).returns(Bluebird.resolve({ ok: true })); + cluster.callWithInternalUser.withArgs('get', sinon.match.any).returns(Bluebird.resolve({ found: false })); + cluster.callWithInternalUser.withArgs('search', sinon.match.any).returns(Bluebird.resolve({ hits: { hits: [] } })); + cluster.callWithInternalUser.withArgs('nodes.info', sinon.match.any).returns(Bluebird.resolve({ nodes: { 'node-01': { version: COMPATIBLE_VERSION_NUMBER, @@ -108,7 +108,7 @@ describe('plugins/elasticsearch', () => { }); it('should set the cluster green if everything is ready', function () { - cluster.callWithInternalUser.withArgs('ping').returns(Promise.resolve()); + cluster.callWithInternalUser.withArgs('ping').returns(Bluebird.resolve()); return health.run() .then(function () { diff --git a/src/legacy/core_plugins/elasticsearch/lib/health_check.js b/src/legacy/core_plugins/elasticsearch/lib/health_check.js index 581ac2d5a92c1..1b05d51b02494 100644 --- a/src/legacy/core_plugins/elasticsearch/lib/health_check.js +++ b/src/legacy/core_plugins/elasticsearch/lib/health_check.js @@ -17,7 +17,7 @@ * under the License. */ -import Promise from 'bluebird'; +import Bluebird from 'bluebird'; import kibanaVersion from './kibana_version'; import { ensureEsVersion } from './ensure_es_version'; @@ -25,7 +25,7 @@ export default function (plugin, server, requestDelay) { plugin.status.yellow('Waiting for Elasticsearch'); function waitUntilReady() { - return new Promise((resolve) => { + return new Bluebird((resolve) => { plugin.status.once('green', resolve); }); } diff --git a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app_controller.tsx b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app_controller.tsx index 22f127d12c438..3f37dd4db162d 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app_controller.tsx +++ b/src/legacy/core_plugins/kibana/public/dashboard/dashboard_app_controller.tsx @@ -57,6 +57,7 @@ import { capabilities } from 'ui/capabilities'; import { Subscription } from 'rxjs'; import { npStart } from 'ui/new_platform'; import { SavedObjectFinder } from 'ui/saved_objects/components/saved_object_finder'; +import { extractTimeFilter, changeTimeFilter } from '../../../data/public'; import { data } from '../../../data/public/setup'; import { @@ -423,7 +424,21 @@ export class DashboardAppController { }; $scope.onApplyFilters = filters => { - queryFilter.addFiltersAndChangeTimeFilter(filters); + // All filters originated from one visualization. + const indexPatternId = filters[0].meta.index; + const indexPattern = _.find( + $scope.indexPatterns, + (p: IndexPattern) => p.id === indexPatternId + ); + if (indexPattern && indexPattern.timeFieldName) { + const { timeRangeFilter, restOfFilters } = extractTimeFilter( + indexPattern.timeFieldName, + filters + ); + queryFilter.addFilters(restOfFilters); + if (timeRangeFilter) changeTimeFilter(timefilter, timeRangeFilter); + } + $scope.appState.$newFilters = []; }; diff --git a/src/legacy/core_plugins/kibana/public/discover/controllers/discover.js b/src/legacy/core_plugins/kibana/public/discover/controllers/discover.js index f79689ac8c733..0b882a72c8720 100644 --- a/src/legacy/core_plugins/kibana/public/discover/controllers/discover.js +++ b/src/legacy/core_plugins/kibana/public/discover/controllers/discover.js @@ -72,7 +72,8 @@ import { buildVislibDimensions } from 'ui/visualize/loader/pipeline_helpers/buil import 'ui/capabilities/route_setup'; import { addHelpMenuToAppChrome } from '../components/help_menu/help_menu_util'; -import { setup as data } from '../../../../../core_plugins/data/public/legacy'; +import { extractTimeFilter, changeTimeFilter } from '../../../../data/public'; +import { setup as data } from '../../../../data/public/legacy'; import { npStart } from 'ui/new_platform'; const { savedQueryService } = data.search.services; @@ -423,7 +424,10 @@ function discoverController( }; $scope.applyFilters = filters => { - queryFilter.addFiltersAndChangeTimeFilter(filters); + const { timeRangeFilter, restOfFilters } = extractTimeFilter($scope.indexPattern.timeFieldName, filters); + queryFilter.addFilters(restOfFilters); + if (timeRangeFilter) changeTimeFilter(timefilter, timeRangeFilter); + $scope.state.$newFilters = []; }; diff --git a/src/legacy/core_plugins/kibana/public/visualize/editor/editor.js b/src/legacy/core_plugins/kibana/public/visualize/editor/editor.js index ddd87542e4bde..17b54bfc2d248 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/editor/editor.js +++ b/src/legacy/core_plugins/kibana/public/visualize/editor/editor.js @@ -53,7 +53,8 @@ import { showSaveModal } from 'ui/saved_objects/show_saved_object_save_modal'; import { SavedObjectSaveModal } from 'ui/saved_objects/components/saved_object_save_modal'; import { getEditBreadcrumbs, getCreateBreadcrumbs } from '../breadcrumbs'; import { npStart } from 'ui/new_platform'; -import { setup as data } from '../../../../../core_plugins/data/public/legacy'; +import { extractTimeFilter, changeTimeFilter } from '../../../../data/public'; +import { start as data } from '../../../../data/public/legacy'; import { start as visualizations } from '../../../../visualizations/public/np_ready/public/legacy'; import { addHelpMenuToAppChrome } from '../help_menu/help_menu_util'; @@ -343,7 +344,9 @@ function VisEditor( }; $scope.onApplyFilters = filters => { - queryFilter.addFiltersAndChangeTimeFilter(filters); + const { timeRangeFilter, restOfFilters } = extractTimeFilter($scope.indexPattern.timeFieldName, filters); + queryFilter.addFilters(restOfFilters); + if (timeRangeFilter) changeTimeFilter(timefilter, timeRangeFilter); $scope.state.$newFilters = []; }; diff --git a/src/legacy/core_plugins/kibana/server/lib/manage_uuid.js b/src/legacy/core_plugins/kibana/server/lib/manage_uuid.js index 0c744ef3ac18b..d367682a2646d 100644 --- a/src/legacy/core_plugins/kibana/server/lib/manage_uuid.js +++ b/src/legacy/core_plugins/kibana/server/lib/manage_uuid.js @@ -18,7 +18,7 @@ */ import uuid from 'uuid'; -import Promise from 'bluebird'; +import Bluebird from 'bluebird'; import { join as pathJoin } from 'path'; import { readFile as readFileCallback, writeFile as writeFileCallback } from 'fs'; @@ -30,7 +30,7 @@ export default async function manageUuid(server) { const uuidFile = pathJoin(config.get('path.data'), fileName); async function detectUuid() { - const readFile = Promise.promisify(readFileCallback); + const readFile = Bluebird.promisify(readFileCallback); try { const result = await readFile(uuidFile); return result.toString(FILE_ENCODING); @@ -46,7 +46,7 @@ export default async function manageUuid(server) { } async function writeUuid(uuid) { - const writeFile = Promise.promisify(writeFileCallback); + const writeFile = Bluebird.promisify(writeFileCallback); try { return await writeFile(uuidFile, uuid, { encoding: FILE_ENCODING }); } catch (err) { diff --git a/src/legacy/core_plugins/timelion/server/handlers/chain_runner.js b/src/legacy/core_plugins/timelion/server/handlers/chain_runner.js index 0bd1d9d2ffc03..0860851f3a9b6 100644 --- a/src/legacy/core_plugins/timelion/server/handlers/chain_runner.js +++ b/src/legacy/core_plugins/timelion/server/handlers/chain_runner.js @@ -19,7 +19,7 @@ import _ from 'lodash'; -import Promise from 'bluebird'; +import Bluebird from 'bluebird'; import { i18n } from '@kbn/i18n'; import parseSheet from './lib/parse_sheet.js'; @@ -46,7 +46,7 @@ export default function chainRunner(tlConfig) { function resolveArgument(item) { if (Array.isArray(item)) { - return Promise.all(_.map(item, resolveArgument)); + return Bluebird.all(_.map(item, resolveArgument)); } if (_.isObject(item)) { @@ -55,7 +55,7 @@ export default function chainRunner(tlConfig) { const itemFunctionDef = tlConfig.server.plugins.timelion.getFunction(item.function); if (itemFunctionDef.cacheKey && queryCache[itemFunctionDef.cacheKey(item)]) { stats.queryCount++; - return Promise.resolve(_.cloneDeep(queryCache[itemFunctionDef.cacheKey(item)])); + return Bluebird.resolve(_.cloneDeep(queryCache[itemFunctionDef.cacheKey(item)])); } return invoke(item.function, item.arguments); } @@ -98,7 +98,7 @@ export default function chainRunner(tlConfig) { args = _.map(args, resolveArgument); - return Promise.all(args).then(function (args) { + return Bluebird.all(args).then(function (args) { args.byName = indexArguments(functionDef, args); return functionDef.fn(args, tlConfig); }); @@ -133,7 +133,7 @@ export default function chainRunner(tlConfig) { return args; }); }); - return Promise.all(seriesList).then(function (args) { + return Bluebird.all(seriesList).then(function (args) { const list = _.chain(args).pluck('list').flatten().value(); const seriesList = _.merge.apply(this, _.flatten([{}, args])); seriesList.list = list; @@ -161,7 +161,7 @@ export default function chainRunner(tlConfig) { return invoke(query.function, query.arguments); }).value(); - return Promise.settle(promises).then(function (resolvedDatasources) { + return Bluebird.settle(promises).then(function (resolvedDatasources) { stats.queryTime = (new Date()).getTime(); diff --git a/src/legacy/core_plugins/timelion/server/lib/alter.js b/src/legacy/core_plugins/timelion/server/lib/alter.js index 95806fb715c10..154392fd66253 100644 --- a/src/legacy/core_plugins/timelion/server/lib/alter.js +++ b/src/legacy/core_plugins/timelion/server/lib/alter.js @@ -17,7 +17,7 @@ * under the License. */ -import Promise from 'bluebird'; +import Bluebird from 'bluebird'; import _ from 'lodash'; /* @param {Array} args @@ -29,7 +29,7 @@ import _ from 'lodash'; export default function alter(args, fn) { // In theory none of the args should ever be promises. This is probably a waste. - return Promise.all(args).then(function (args) { + return Bluebird.all(args).then(function (args) { const seriesList = args.shift(); diff --git a/src/legacy/core_plugins/timelion/server/routes/run.js b/src/legacy/core_plugins/timelion/server/routes/run.js index a2d5bd23fe9a9..d868f868aaf3e 100644 --- a/src/legacy/core_plugins/timelion/server/routes/run.js +++ b/src/legacy/core_plugins/timelion/server/routes/run.js @@ -17,7 +17,7 @@ * under the License. */ -import Promise from 'bluebird'; +import Bluebird from 'bluebird'; import _ from 'lodash'; import chainRunnerFn from '../handlers/chain_runner.js'; const timelionDefaults = require('../lib/get_namespaced_settings')(); @@ -44,7 +44,7 @@ export function runRoute(server) { }); const chainRunner = chainRunnerFn(tlConfig); - const sheet = await Promise.all(chainRunner.processRequest(request.payload || { + const sheet = await Bluebird.all(chainRunner.processRequest(request.payload || { sheet: [request.query.expression], time: { from: request.query.from, diff --git a/src/legacy/core_plugins/timelion/server/series_functions/__tests__/es.js b/src/legacy/core_plugins/timelion/server/series_functions/__tests__/es.js index 7d6c76739860b..f370c3439125b 100644 --- a/src/legacy/core_plugins/timelion/server/series_functions/__tests__/es.js +++ b/src/legacy/core_plugins/timelion/server/series_functions/__tests__/es.js @@ -26,7 +26,7 @@ import buildRequest from '../es/lib/build_request'; import createDateAgg from '../es/lib/create_date_agg'; import esResponse from './fixtures/es_response'; -import Promise from 'bluebird'; +import Bluebird from 'bluebird'; import _ from 'lodash'; import { expect } from 'chai'; import sinon from 'sinon'; @@ -39,7 +39,7 @@ function stubRequestAndServer(response, indexPatternSavedObjects = []) { elasticsearch: { getCluster: sinon.stub().withArgs('data').returns({ callWithRequest: function () { - return Promise.resolve(response); + return Bluebird.resolve(response); } }) } @@ -49,7 +49,7 @@ function stubRequestAndServer(response, indexPatternSavedObjects = []) { getSavedObjectsClient: function () { return { find: function () { - return Promise.resolve({ + return Bluebird.resolve({ saved_objects: indexPatternSavedObjects }); } diff --git a/src/legacy/core_plugins/timelion/server/series_functions/__tests__/graphite.js b/src/legacy/core_plugins/timelion/server/series_functions/__tests__/graphite.js index 9958cf2cad7ab..8d5e25b43938d 100644 --- a/src/legacy/core_plugins/timelion/server/series_functions/__tests__/graphite.js +++ b/src/legacy/core_plugins/timelion/server/series_functions/__tests__/graphite.js @@ -18,11 +18,11 @@ */ import proxyquire from 'proxyquire'; -import Promise from 'bluebird'; +import Bluebird from 'bluebird'; const expect = require('chai').expect; const graphiteResponse = function () { - return Promise.resolve({ + return Bluebird.resolve({ json: function () { return [{ target: '__beer__', diff --git a/src/legacy/core_plugins/timelion/server/series_functions/__tests__/quandl.js b/src/legacy/core_plugins/timelion/server/series_functions/__tests__/quandl.js index d4b1fa64f8d14..4fcc8fadcd013 100644 --- a/src/legacy/core_plugins/timelion/server/series_functions/__tests__/quandl.js +++ b/src/legacy/core_plugins/timelion/server/series_functions/__tests__/quandl.js @@ -18,7 +18,7 @@ */ import proxyquire from 'proxyquire'; -import Promise from 'bluebird'; +import Bluebird from 'bluebird'; import assert from 'chai'; const expect = assert.expect; @@ -41,7 +41,7 @@ describe(filename, function () { params: parseQueryString(parseURL(url).query), code: url.match(/datasets\/(.*).json/)[1] }; - return Promise.resolve({ + return Bluebird.resolve({ json: function () { return { name: '__beer__', diff --git a/src/legacy/core_plugins/timelion/server/series_functions/__tests__/yaxis.js b/src/legacy/core_plugins/timelion/server/series_functions/__tests__/yaxis.js index 7a181d9cbb8c0..ebc187100c7e1 100644 --- a/src/legacy/core_plugins/timelion/server/series_functions/__tests__/yaxis.js +++ b/src/legacy/core_plugins/timelion/server/series_functions/__tests__/yaxis.js @@ -18,7 +18,7 @@ */ const fn = require(`../yaxis`); -import Promise from 'bluebird'; +import Bluebird from 'bluebird'; const expect = require('chai').expect; import invoke from './helpers/invoke_series_fn.js'; @@ -36,7 +36,7 @@ describe('yaxis.js', () => { }); it('puts odd numbers of the left, even on the right, by default', () => { - return Promise.all([ + return Bluebird.all([ invoke(fn, [seriesList, 1]).then((r) => { expect(r.output.list[0]._global.yaxes[0].position).to.equal('left'); }), @@ -50,7 +50,7 @@ describe('yaxis.js', () => { }); it('it lets you override default positions', () => { - return Promise.all([ + return Bluebird.all([ invoke(fn, [seriesList, 1, null, null, 'right']).then((r) => { expect(r.output.list[0]._global.yaxes[0].position).to.equal('right'); }), @@ -61,7 +61,7 @@ describe('yaxis.js', () => { }); it('sets the minimum (default: no min)', () => { - return Promise.all([ + return Bluebird.all([ invoke(fn, [seriesList, 1, null]).then((r) => { expect(r.output.list[0]._global.yaxes[0].min).to.equal(null); }), @@ -72,7 +72,7 @@ describe('yaxis.js', () => { }); it('sets the max (default: no max)', () => { - return Promise.all([ + return Bluebird.all([ invoke(fn, [seriesList, 1, null]).then((r) => { expect(r.output.list[0]._global.yaxes[0].max).to.equal(undefined); }), @@ -83,7 +83,7 @@ describe('yaxis.js', () => { }); it('sets the units (default: no unit', () => { - return Promise.all([ + return Bluebird.all([ invoke(fn, [seriesList, 1, null, null, null, null, null, null]).then((r) => { expect(r.output.list[0]._global.yaxes[0].units).to.equal(undefined); }), diff --git a/src/legacy/core_plugins/timelion/server/series_functions/static.js b/src/legacy/core_plugins/timelion/server/series_functions/static.js index 4f7879e3e2c23..e348afbec95b8 100644 --- a/src/legacy/core_plugins/timelion/server/series_functions/static.js +++ b/src/legacy/core_plugins/timelion/server/series_functions/static.js @@ -20,7 +20,7 @@ import { i18n } from '@kbn/i18n'; import _ from 'lodash'; import Datasource from '../lib/classes/datasource'; -import Promise from 'bluebird'; +import Bluebird from 'bluebird'; export default new Datasource ('static', { aliases: ['value'], @@ -63,7 +63,7 @@ export default new Datasource ('static', { }); } - return Promise.resolve({ + return Bluebird.resolve({ type: 'seriesList', list: [ { diff --git a/src/legacy/core_plugins/timelion/server/series_functions/worldbank_indicators.js b/src/legacy/core_plugins/timelion/server/series_functions/worldbank_indicators.js index e0b4126612565..5b8703a6abe25 100644 --- a/src/legacy/core_plugins/timelion/server/series_functions/worldbank_indicators.js +++ b/src/legacy/core_plugins/timelion/server/series_functions/worldbank_indicators.js @@ -20,7 +20,7 @@ import { i18n } from '@kbn/i18n'; import _ from 'lodash'; import worldbank from './worldbank.js'; -import Promise from 'bluebird'; +import Bluebird from 'bluebird'; import Datasource from '../lib/classes/datasource'; export default new Datasource ('worldbank_indicators', { @@ -73,7 +73,7 @@ export default new Datasource ('worldbank_indicators', { return worldbank.timelionFn(wbArgs, tlConfig); }); - return Promise.map(seriesLists, function (seriesList) { + return Bluebird.map(seriesLists, function (seriesList) { return seriesList.list[0]; }).then(function (list) { return { diff --git a/src/legacy/core_plugins/vis_type_vega/public/__tests__/vega_visualization.js b/src/legacy/core_plugins/vis_type_vega/public/__tests__/vega_visualization.js index 13f4ce06f1b62..46725a2c5d01f 100644 --- a/src/legacy/core_plugins/vis_type_vega/public/__tests__/vega_visualization.js +++ b/src/legacy/core_plugins/vis_type_vega/public/__tests__/vega_visualization.js @@ -17,7 +17,7 @@ * under the License. */ -import Promise from 'bluebird'; +import Bluebird from 'bluebird'; import expect from '@kbn/expect'; import ngMock from 'ng_mock'; import $ from 'jquery'; @@ -153,7 +153,7 @@ describe('VegaVisualizations', () => { $el.find('canvas')[0].dispatchEvent(event); - await Promise.delay(10); + await Bluebird.delay(10); let tooltip = document.getElementById('vega-kibana-tooltip'); expect(tooltip).to.be.ok(); diff --git a/src/legacy/server/index_patterns/mixin.ts b/src/legacy/server/index_patterns/mixin.ts index 914bdc01063b9..a7180d6a2d70e 100644 --- a/src/legacy/server/index_patterns/mixin.ts +++ b/src/legacy/server/index_patterns/mixin.ts @@ -19,7 +19,7 @@ import { IndexPatternsService } from './service'; import KbnServer from '../kbn_server'; -import { APICaller } from '../../../core/server'; +import { APICaller, CallAPIOptions } from '../../../core/server'; import { Legacy } from '../../../../kibana'; import { registerRoutes } from './routes'; @@ -43,8 +43,11 @@ export function indexPatternsMixin(kbnServer: KbnServer, server: Legacy.Server) */ server.addMemoizedFactoryToRequest('getIndexPatternsService', (request: Legacy.Request) => { const { callWithRequest } = request.server.plugins.elasticsearch.getCluster('data'); - const callCluster: APICaller = (endpoint, params, options) => - callWithRequest(request, endpoint, params, options); + const callCluster: APICaller = ( + endpoint: string, + params?: Record, + options?: CallAPIOptions + ) => callWithRequest(request, endpoint, params, options); return server.indexPatternsServiceFactory({ callCluster }); }); diff --git a/src/legacy/server/index_patterns/routes.ts b/src/legacy/server/index_patterns/routes.ts index 60b2ea28afab5..fb78b94e0f77f 100644 --- a/src/legacy/server/index_patterns/routes.ts +++ b/src/legacy/server/index_patterns/routes.ts @@ -19,14 +19,23 @@ import { first } from 'rxjs/operators'; import { schema } from '@kbn/config-schema'; -import { CoreSetup, KibanaRequest, RequestHandlerContext, APICaller } from '../../../core/server'; +import { + CoreSetup, + KibanaRequest, + RequestHandlerContext, + APICaller, + CallAPIOptions, +} from '../../../core/server'; import { IndexPatternsService } from './service'; export function registerRoutes(core: CoreSetup) { const getIndexPatternsService = async (request: KibanaRequest): Promise => { const client = await core.elasticsearch.dataClient$.pipe(first()).toPromise(); - const callCluster: APICaller = (endpoint, params, options) => - client.asScoped(request).callAsCurrentUser(endpoint, params, options); + const callCluster: APICaller = ( + endpoint: string, + params?: Record, + options?: CallAPIOptions + ) => client.asScoped(request).callAsCurrentUser(endpoint, params, options); return new Promise(resolve => resolve(new IndexPatternsService(callCluster))); }; diff --git a/src/legacy/server/pid/index.js b/src/legacy/server/pid/index.js index cc53b8bd97f3d..fe43cabd56fec 100644 --- a/src/legacy/server/pid/index.js +++ b/src/legacy/server/pid/index.js @@ -19,11 +19,11 @@ import _ from 'lodash'; import Boom from 'boom'; -import Promise from 'bluebird'; +import Bluebird from 'bluebird'; import { unlinkSync as unlink } from 'fs'; -const writeFile = Promise.promisify(require('fs').writeFile); +const writeFile = Bluebird.promisify(require('fs').writeFile); -export default Promise.method(function (kbnServer, server, config) { +export default Bluebird.method(function (kbnServer, server, config) { const path = config.get('pid.file'); if (!path) return; diff --git a/src/legacy/server/saved_objects/routes/update.test.ts b/src/legacy/server/saved_objects/routes/update.test.ts index 6dd530ba01cb2..d1a86b1e38e74 100644 --- a/src/legacy/server/saved_objects/routes/update.test.ts +++ b/src/legacy/server/saved_objects/routes/update.test.ts @@ -99,7 +99,7 @@ describe('PUT /api/saved_objects/{type}/{id?}', () => { 'index-pattern', 'logstash-*', { title: 'Testing' }, - { version: 'foo', references: [] } + { version: 'foo' } ); }); }); diff --git a/src/legacy/server/saved_objects/routes/update.ts b/src/legacy/server/saved_objects/routes/update.ts index 7782253f9b542..dadd1e412c8cd 100644 --- a/src/legacy/server/saved_objects/routes/update.ts +++ b/src/legacy/server/saved_objects/routes/update.ts @@ -53,15 +53,13 @@ export const createUpdateRoute = (prereqs: Prerequisites) => { payload: Joi.object({ attributes: Joi.object().required(), version: Joi.string(), - references: Joi.array() - .items( - Joi.object().keys({ - name: Joi.string().required(), - type: Joi.string().required(), - id: Joi.string().required(), - }) - ) - .default([]), + references: Joi.array().items( + Joi.object().keys({ + name: Joi.string().required(), + type: Joi.string().required(), + id: Joi.string().required(), + }) + ), }).required(), }, handler(request: UpdateRequest) { diff --git a/src/legacy/ui/public/courier/search_strategy/default_search_strategy.test.js b/src/legacy/ui/public/courier/search_strategy/default_search_strategy.test.js index 341a3268f6f3d..dc8732032ba22 100644 --- a/src/legacy/ui/public/courier/search_strategy/default_search_strategy.test.js +++ b/src/legacy/ui/public/courier/search_strategy/default_search_strategy.test.js @@ -18,7 +18,7 @@ */ import { defaultSearchStrategy } from './default_search_strategy'; -import { Promise } from 'bluebird'; +import Bluebird from 'bluebird'; const { search } = defaultSearchStrategy; @@ -35,8 +35,8 @@ describe('defaultSearchStrategy', function () { let searchArgs; beforeEach(() => { - const msearchMock = jest.fn().mockReturnValue(Promise.resolve([])); - const searchMock = jest.fn().mockReturnValue(Promise.resolve([])); + const msearchMock = jest.fn().mockReturnValue(Bluebird.resolve([])); + const searchMock = jest.fn().mockReturnValue(Bluebird.resolve([])); searchArgs = { searchRequests: [], @@ -44,8 +44,8 @@ describe('defaultSearchStrategy', function () { msearch: msearchMock, search: searchMock, }, - Promise, - serializeFetchParams: () => Promise.resolve('pretend this is a valid request body'), + Promise: Bluebird, + serializeFetchParams: () => Bluebird.resolve('pretend this is a valid request body'), }; }); diff --git a/src/legacy/ui/public/filter_manager/query_filter.js b/src/legacy/ui/public/filter_manager/query_filter.js index c6189481b47a5..a09e4162d75c6 100644 --- a/src/legacy/ui/public/filter_manager/query_filter.js +++ b/src/legacy/ui/public/filter_manager/query_filter.js @@ -35,7 +35,6 @@ export function FilterBarQueryFilterProvider(getAppState, globalState) { queryFilter.removeFilter = filterManager.removeFilter.bind(filterManager); queryFilter.addFilters = filterManager.addFilters.bind(filterManager); queryFilter.setFilters = filterManager.setFilters.bind(filterManager); - queryFilter.addFiltersAndChangeTimeFilter = filterManager.addFiltersAndChangeTimeFilter.bind(filterManager); queryFilter.removeAll = filterManager.removeAll.bind(filterManager); queryFilter.destroy = () => { diff --git a/src/legacy/ui/public/saved_objects/__tests__/saved_object.js b/src/legacy/ui/public/saved_objects/__tests__/saved_object.js index bb733da193069..e6d6907560aca 100644 --- a/src/legacy/ui/public/saved_objects/__tests__/saved_object.js +++ b/src/legacy/ui/public/saved_objects/__tests__/saved_object.js @@ -20,7 +20,7 @@ import ngMock from 'ng_mock'; import expect from '@kbn/expect'; import sinon from 'sinon'; -import BluebirdPromise from 'bluebird'; +import Bluebird from 'bluebird'; import { SavedObjectProvider } from '../saved_object'; import StubIndexPatternProv from 'test_utils/stub_index_pattern'; @@ -61,11 +61,11 @@ describe('Saved Object', function () { */ function stubESResponse(mockDocResponse) { // Stub out search for duplicate title: - sinon.stub(savedObjectsClientStub, 'get').returns(BluebirdPromise.resolve(mockDocResponse)); - sinon.stub(savedObjectsClientStub, 'update').returns(BluebirdPromise.resolve(mockDocResponse)); + sinon.stub(savedObjectsClientStub, 'get').returns(Bluebird.resolve(mockDocResponse)); + sinon.stub(savedObjectsClientStub, 'update').returns(Bluebird.resolve(mockDocResponse)); - sinon.stub(savedObjectsClientStub, 'find').returns(BluebirdPromise.resolve({ savedObjects: [], total: 0 })); - sinon.stub(savedObjectsClientStub, 'bulkGet').returns(BluebirdPromise.resolve({ savedObjects: [mockDocResponse] })); + sinon.stub(savedObjectsClientStub, 'find').returns(Bluebird.resolve({ savedObjects: [], total: 0 })); + sinon.stub(savedObjectsClientStub, 'bulkGet').returns(Bluebird.resolve({ savedObjects: [mockDocResponse] })); } /** @@ -108,7 +108,7 @@ describe('Saved Object', function () { describe('with confirmOverwrite', function () { function stubConfirmOverwrite() { window.confirm = sinon.stub().returns(true); - sinon.stub(esDataStub, 'create').returns(BluebirdPromise.reject(mock409FetchError)); + sinon.stub(esDataStub, 'create').returns(Bluebird.reject(mock409FetchError)); } describe('when true', function () { @@ -116,8 +116,8 @@ describe('Saved Object', function () { stubESResponse(getMockedDocResponse('myId')); return createInitializedSavedObject({ type: 'dashboard', id: 'myId' }).then(savedObject => { const createStub = sinon.stub(savedObjectsClientStub, 'create'); - createStub.onFirstCall().returns(BluebirdPromise.reject(mock409FetchError)); - createStub.onSecondCall().returns(BluebirdPromise.resolve({ id: 'myId' })); + createStub.onFirstCall().returns(Bluebird.reject(mock409FetchError)); + createStub.onSecondCall().returns(Bluebird.resolve({ id: 'myId' })); stubConfirmOverwrite(); @@ -139,7 +139,7 @@ describe('Saved Object', function () { return createInitializedSavedObject({ type: 'dashboard', id: 'HI' }).then(savedObject => { window.confirm = sinon.stub().returns(false); - sinon.stub(savedObjectsClientStub, 'create').returns(BluebirdPromise.reject(mock409FetchError)); + sinon.stub(savedObjectsClientStub, 'create').returns(Bluebird.reject(mock409FetchError)); savedObject.lastSavedTitle = 'original title'; savedObject.title = 'new title'; @@ -158,7 +158,7 @@ describe('Saved Object', function () { return createInitializedSavedObject({ type: 'dashboard', id: 'myId' }).then(savedObject => { stubConfirmOverwrite(); - sinon.stub(savedObjectsClientStub, 'create').returns(BluebirdPromise.reject(mock409FetchError)); + sinon.stub(savedObjectsClientStub, 'create').returns(Bluebird.reject(mock409FetchError)); return savedObject.save({ confirmOverwrite: true }) .then(() => { @@ -178,7 +178,7 @@ describe('Saved Object', function () { return createInitializedSavedObject({ type: 'dashboard', id: 'myId' }).then(savedObject => { stubConfirmOverwrite(); - sinon.stub(savedObjectsClientStub, 'create').returns(BluebirdPromise.resolve({ id: 'myId' })); + sinon.stub(savedObjectsClientStub, 'create').returns(Bluebird.resolve({ id: 'myId' })); return savedObject.save({ confirmOverwrite: false }).then(() => { expect(window.confirm.called).to.be(false); @@ -193,7 +193,7 @@ describe('Saved Object', function () { stubESResponse(mockDocResponse); return createInitializedSavedObject({ type: 'dashboard', id: 'myId' }).then(savedObject => { sinon.stub(savedObjectsClientStub, 'create').callsFake(() => { - return BluebirdPromise.resolve({ type: 'dashboard', id: 'newUniqueId' }); + return Bluebird.resolve({ type: 'dashboard', id: 'newUniqueId' }); }); savedObject.copyOnSave = true; @@ -209,7 +209,7 @@ describe('Saved Object', function () { stubESResponse(mockDocResponse); return createInitializedSavedObject({ type: 'dashboard', id: originalId }).then(savedObject => { sinon.stub(savedObjectsClientStub, 'create').callsFake(() => { - return BluebirdPromise.reject('simulated error'); + return Bluebird.reject('simulated error'); }); savedObject.copyOnSave = true; return savedObject.save().then(() => { @@ -228,7 +228,7 @@ describe('Saved Object', function () { return createInitializedSavedObject({ type: 'dashboard', id: id }).then(savedObject => { sinon.stub(savedObjectsClientStub, 'create').callsFake(() => { expect(savedObject.id).to.be(id); - return BluebirdPromise.resolve(id); + return Bluebird.resolve(id); }); savedObject.copyOnSave = false; return savedObject.save().then((id) => { @@ -242,7 +242,7 @@ describe('Saved Object', function () { return createInitializedSavedObject({ type: 'dashboard' }).then(savedObject => { const mockDocResponse = getMockedDocResponse('myId'); sinon.stub(savedObjectsClientStub, 'create').callsFake(() => { - return BluebirdPromise.resolve({ + return Bluebird.resolve({ type: 'dashboard', id: 'myId', _version: 'foo' @@ -264,7 +264,7 @@ describe('Saved Object', function () { return createInitializedSavedObject({ type: 'dashboard', id: id }).then(savedObject => { sinon.stub(savedObjectsClientStub, 'create').callsFake(() => { expect(savedObject.isSaving).to.be(true); - return BluebirdPromise.resolve({ + return Bluebird.resolve({ type: 'dashboard', id, version: 'foo' @@ -282,7 +282,7 @@ describe('Saved Object', function () { return createInitializedSavedObject({ type: 'dashboard' }).then(savedObject => { sinon.stub(savedObjectsClientStub, 'create').callsFake(() => { expect(savedObject.isSaving).to.be(true); - return BluebirdPromise.reject(); + return Bluebird.reject(); }); expect(savedObject.isSaving).to.be(false); return savedObject.save().catch(() => { @@ -307,7 +307,7 @@ describe('Saved Object', function () { return createInitializedSavedObject({ type: 'dashboard', extractReferences }) .then((savedObject) => { sinon.stub(savedObjectsClientStub, 'create').callsFake(() => { - return BluebirdPromise.resolve({ + return Bluebird.resolve({ id, version: 'foo', type: 'dashboard', @@ -333,7 +333,7 @@ describe('Saved Object', function () { return createInitializedSavedObject({ type: 'dashboard', searchSource: true }) .then((savedObject) => { sinon.stub(savedObjectsClientStub, 'create').callsFake(() => { - return BluebirdPromise.resolve({ + return Bluebird.resolve({ id, version: 2, type: 'dashboard', @@ -369,7 +369,7 @@ describe('Saved Object', function () { return createInitializedSavedObject({ type: 'dashboard', searchSource: true }) .then((savedObject) => { sinon.stub(savedObjectsClientStub, 'create').callsFake(() => { - return BluebirdPromise.resolve({ + return Bluebird.resolve({ id, version: 2, type: 'dashboard', @@ -403,7 +403,7 @@ describe('Saved Object', function () { return createInitializedSavedObject({ type: 'dashboard', searchSource: true }) .then((savedObject) => { sinon.stub(savedObjectsClientStub, 'create').callsFake(() => { - return BluebirdPromise.resolve({ + return Bluebird.resolve({ id, version: 2, type: 'dashboard', diff --git a/src/test_utils/public/simulate_keys.js b/src/test_utils/public/simulate_keys.js index 837a864d31ef3..225ecc0b6a08e 100644 --- a/src/test_utils/public/simulate_keys.js +++ b/src/test_utils/public/simulate_keys.js @@ -19,7 +19,7 @@ import $ from 'jquery'; import _ from 'lodash'; -import Promise from 'bluebird'; +import Bluebird from 'bluebird'; import { keyMap } from 'ui/utils/key_map'; const reverseKeyMap = _.mapValues(_.invert(keyMap), _.ary(_.parseInt, 1)); @@ -70,7 +70,7 @@ export default function ($el, sequence) { } function doList(list) { - return Promise.try(function () { + return Bluebird.try(function () { if (!list || !list.length) return; let event = list[0]; @@ -80,20 +80,20 @@ export default function ($el, sequence) { switch (event.type) { case 'press': - return Promise.resolve() + return Bluebird.resolve() .then(_.partial(fire, 'keydown', event.key)) .then(_.partial(fire, 'keypress', event.key)) .then(_.partial(doList, event.events)) .then(_.partial(fire, 'keyup', event.key)); case 'wait': - return Promise.delay(event.ms); + return Bluebird.delay(event.ms); case 'repeat': return (function again(remaining) { - if (!remaining) return Promise.resolve(); + if (!remaining) return Bluebird.resolve(); remaining = remaining - 1; - return Promise.resolve() + return Bluebird.resolve() .then(_.partial(fire, 'keydown', event.key, true)) .then(_.partial(fire, 'keypress', event.key, true)) .then(_.partial(again, remaining)); diff --git a/test/api_integration/apis/kql_telemetry/kql_telemetry.js b/test/api_integration/apis/kql_telemetry/kql_telemetry.js index b17dec2ef437b..87d06ee9458d6 100644 --- a/test/api_integration/apis/kql_telemetry/kql_telemetry.js +++ b/test/api_integration/apis/kql_telemetry/kql_telemetry.js @@ -18,7 +18,7 @@ */ import expect from '@kbn/expect'; -import Promise from 'bluebird'; +import Bluebird from 'bluebird'; import { get } from 'lodash'; export default function ({ getService }) { @@ -89,7 +89,7 @@ export default function ({ getService }) { }); it('should only accept literal boolean values for the opt_in POST body param', function () { - return Promise.all([ + return Bluebird.all([ supertest .post('/api/kibana/kql_opt_in_telemetry') .set('content-type', 'application/json') diff --git a/test/api_integration/apis/saved_objects/update.js b/test/api_integration/apis/saved_objects/update.js index 25a97d9e00b78..e6ad6b2b781da 100644 --- a/test/api_integration/apis/saved_objects/update.js +++ b/test/api_integration/apis/saved_objects/update.js @@ -52,11 +52,55 @@ export default function ({ getService }) { attributes: { title: 'My second favorite vis' }, - references: [], }); }); }); + it('does not pass references if omitted', async () => { + const resp = await supertest + .put(`/api/saved_objects/visualization/dd7caf20-9efd-11e7-acb3-3dab96693fab`) + .send({ + attributes: { + title: 'foo' + } + }) + .expect(200); + + expect(resp.body).not.to.have.property('references'); + }); + + it('passes references if they are provided', async () => { + const references = [{ id: 'foo', name: 'Foo', type: 'visualization' }]; + + const resp = await supertest + .put(`/api/saved_objects/visualization/dd7caf20-9efd-11e7-acb3-3dab96693fab`) + .send({ + attributes: { + title: 'foo' + }, + references + }) + .expect(200); + + expect(resp.body).to.have.property('references'); + expect(resp.body.references).to.eql(references); + }); + + it('passes empty references array if empty references array is provided', async () => { + const resp = await supertest + .put(`/api/saved_objects/visualization/dd7caf20-9efd-11e7-acb3-3dab96693fab`) + .send({ + attributes: { + title: 'foo' + }, + references: [] + }) + .expect(200); + + expect(resp.body).to.have.property('references'); + expect(resp.body.references).to.eql([]); + }); + describe('unknown id', () => { it('should return a generic 404', async () => { await supertest diff --git a/test/functional/services/browser.ts b/test/functional/services/browser.ts index 5cf879e460402..4060e3dd7800f 100644 --- a/test/functional/services/browser.ts +++ b/test/functional/services/browser.ts @@ -18,40 +18,27 @@ */ import { cloneDeep } from 'lodash'; -import { logging, Key, Origin } from 'selenium-webdriver'; +import { Key, Origin } from 'selenium-webdriver'; // @ts-ignore internal modules are not typed import { LegacyActionSequence } from 'selenium-webdriver/lib/actions'; -import { takeUntil } from 'rxjs/operators'; import Jimp from 'jimp'; import { modifyUrl } from '../../../src/core/utils'; import { WebElementWrapper } from './lib/web_element_wrapper'; import { FtrProviderContext } from '../ftr_provider_context'; import { Browsers } from './remote/browsers'; -import { pollForLogEntry$ } from './remote/poll_for_log_entry'; export async function BrowserProvider({ getService }: FtrProviderContext) { const log = getService('log'); - const config = getService('config'); - const lifecycle = getService('lifecycle'); - const { driver, browserType } = await getService('__webdriver__').init(); + const { driver, browserType, consoleLog$ } = await getService('__webdriver__').init(); - const isW3CEnabled = (driver as any).executor_.w3c === true; + consoleLog$.subscribe(({ message, level }) => { + log[level === 'SEVERE' || level === 'error' ? 'error' : 'debug']( + `browser[${level}] ${message}` + ); + }); - if (browserType === Browsers.Chrome) { - // The logs endpoint has not been defined in W3C Spec browsers other than Chrome don't have access to this endpoint. - // See: https://github.com/w3c/webdriver/issues/406 - // See: https://w3c.github.io/webdriver/#endpoints - - pollForLogEntry$(driver, logging.Type.BROWSER, config.get('browser.logPollingMs')) - .pipe(takeUntil(lifecycle.cleanup$)) - .subscribe({ - next({ message, level: { name: level } }) { - const msg = message.replace(/\\n/g, '\n'); - log[level === 'SEVERE' ? 'error' : 'debug'](`browser[${level}] ${msg}`); - }, - }); - } + const isW3CEnabled = (driver as any).executor_.w3c === true; return new (class BrowserService { /** diff --git a/test/functional/services/remote/create_stdout_stream.ts b/test/functional/services/remote/create_stdout_stream.ts new file mode 100644 index 0000000000000..877be1f829daf --- /dev/null +++ b/test/functional/services/remote/create_stdout_stream.ts @@ -0,0 +1,92 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import Net from 'net'; + +import * as Rx from 'rxjs'; +import { map, takeUntil, take } from 'rxjs/operators'; + +export async function createStdoutSocket() { + const chunk$ = new Rx.Subject(); + const cleanup$ = new Rx.ReplaySubject(1); + + const server = Net.createServer(); + server.on('connection', socket => { + const data$ = Rx.fromEvent(socket, 'data'); + const end$ = Rx.fromEvent(socket, 'end'); + const error$ = Rx.fromEvent(socket, 'error'); + + Rx.merge(data$, error$) + .pipe(takeUntil(Rx.merge(end$, cleanup$))) + .subscribe({ + next(chunkOrError) { + if (Buffer.isBuffer(chunkOrError)) { + chunk$.next(chunkOrError); + } else { + chunk$.error(chunkOrError); + } + }, + error(error) { + chunk$.error(error); + }, + complete() { + if (!socket.destroyed) { + socket.destroy(); + } + + chunk$.complete(); + }, + }); + }); + + const readyPromise = Rx.race( + Rx.fromEvent(server, 'listening').pipe(take(1)), + Rx.fromEvent(server, 'error').pipe( + map(error => { + throw error; + }) + ) + ).toPromise(); + + server.listen(0); + cleanup$.subscribe(() => { + server.close(); + }); + + await readyPromise; + + const addressInfo = server.address(); + if (typeof addressInfo === 'string') { + throw new Error('server must listen to a random port, not a unix socket'); + } + + const input = Net.createConnection(addressInfo.port, addressInfo.address); + await Rx.fromEvent(input, 'connect') + .pipe(take(1)) + .toPromise(); + + return { + input, + chunk$, + cleanup() { + cleanup$.next(); + cleanup$.complete(); + }, + }; +} diff --git a/test/functional/services/remote/remote.ts b/test/functional/services/remote/remote.ts index 30e6a55c79627..2db5056a73f51 100644 --- a/test/functional/services/remote/remote.ts +++ b/test/functional/services/remote/remote.ts @@ -27,7 +27,12 @@ export async function RemoteProvider({ getService }: FtrProviderContext) { const config = getService('config'); const browserType: Browsers = config.get('browser.type'); - const { driver, By, until } = await initWebDriver(log, browserType); + const { driver, By, until, consoleLog$ } = await initWebDriver( + log, + browserType, + lifecycle, + config.get('browser.logPollingMs') + ); const isW3CEnabled = (driver as any).executor_.w3c; const caps = await driver.getCapabilities(); @@ -74,5 +79,5 @@ export async function RemoteProvider({ getService }: FtrProviderContext) { lifecycle.on('cleanup', async () => await driver.quit()); - return { driver, By, until, browserType }; + return { driver, By, until, browserType, consoleLog$ }; } diff --git a/test/functional/services/remote/webdriver.ts b/test/functional/services/remote/webdriver.ts index d25f8ec93f76d..024a4ee1c1fb3 100644 --- a/test/functional/services/remote/webdriver.ts +++ b/test/functional/services/remote/webdriver.ts @@ -17,6 +17,11 @@ * under the License. */ +import { delimiter } from 'path'; + +import * as Rx from 'rxjs'; +import { mergeMap, map, takeUntil } from 'rxjs/operators'; +import { Lifecycle } from '@kbn/test/src/functional_test_runner/lib/lifecycle'; import { ToolingLog } from '@kbn/dev-utils'; import { delay } from 'bluebird'; import chromeDriver from 'chromedriver'; @@ -30,7 +35,8 @@ import { Executor } from 'selenium-webdriver/lib/http'; // @ts-ignore internal modules are not typed import { getLogger } from 'selenium-webdriver/lib/logging'; -import { resolve, delimiter } from 'path'; +import { pollForLogEntry$ } from './poll_for_log_entry'; +import { createStdoutSocket } from './create_stdout_stream'; import { preventParallelCalls } from './prevent_parallel_calls'; import { Browsers } from './browsers'; @@ -55,13 +61,18 @@ Executor.prototype.execute = preventParallelCalls( ); let attemptCounter = 0; -async function attemptToCreateCommand(log: ToolingLog, browserType: Browsers) { +async function attemptToCreateCommand( + log: ToolingLog, + browserType: Browsers, + lifecycle: Lifecycle, + logPollingMs: number +) { const attemptId = ++attemptCounter; log.debug('[webdriver] Creating session'); const buildDriverInstance = async () => { switch (browserType) { - case 'chrome': + case 'chrome': { const chromeCapabilities = Capabilities.chrome(); const chromeOptions = [ 'disable-translate', @@ -81,30 +92,74 @@ async function attemptToCreateCommand(log: ToolingLog, browserType: Browsers) { args: chromeOptions, }); chromeCapabilities.set('goog:loggingPrefs', { browser: 'ALL' }); - return new Builder() + + const session = await new Builder() .forBrowser(browserType) .withCapabilities(chromeCapabilities) .setChromeService(new chrome.ServiceBuilder(chromeDriver.path).enableVerboseLogging()) .build(); - case 'firefox': + return { + session, + consoleLog$: pollForLogEntry$(session, logging.Type.BROWSER, logPollingMs).pipe( + takeUntil(lifecycle.cleanup$), + map(({ message, level: { name: level } }) => ({ + message: message.replace(/\\n/g, '\n'), + level, + })) + ), + }; + } + + case 'firefox': { const firefoxOptions = new firefox.Options(); + // Firefox 65+ supports logging console output to stdout + firefoxOptions.set('moz:firefoxOptions', { + prefs: { 'devtools.console.stdout.content': true }, + }); if (headlessBrowser === '1') { // See: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode firefoxOptions.headless(); } - return new Builder() + const { input, chunk$, cleanup } = await createStdoutSocket(); + lifecycle.on('cleanup', cleanup); + + const session = await new Builder() .forBrowser(browserType) .setFirefoxOptions(firefoxOptions) - .setFirefoxService(new firefox.ServiceBuilder(geckoDriver.path).enableVerboseLogging()) + .setFirefoxService( + new firefox.ServiceBuilder(geckoDriver.path).setStdio(['ignore', input, 'ignore']) + ) .build(); - case 'ie': + const CONSOLE_LINE_RE = /^console\.([a-z]+): ([\s\S]+)/; + + return { + session, + consoleLog$: chunk$.pipe( + map(chunk => chunk.toString('utf8')), + mergeMap(msg => { + const match = msg.match(CONSOLE_LINE_RE); + if (!match) { + log.debug('Firefox stdout: ' + msg); + return []; + } + + const [, level, message] = match; + return [ + { + level, + message: message.trim(), + }, + ]; + }) + ), + }; + } + + case 'ie': { // https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/ie_exports_Options.html - const driverPath = resolve( - __dirname, - '..\\..\\..\\..\\node_modules\\iedriver\\lib\\iedriver' - ); + const driverPath = require.resolve('iedriver/lib/iedriver'); process.env.PATH = driverPath + delimiter + process.env.PATH; const ieCapabilities = Capabilities.ie(); @@ -117,17 +172,23 @@ async function attemptToCreateCommand(log: ToolingLog, browserType: Browsers) { logLevel: 'TRACE', }); - return new Builder() + const session = await new Builder() .forBrowser(browserType) .withCapabilities(ieCapabilities) .build(); + return { + session, + consoleLog$: Rx.EMPTY, + }; + } + default: throw new Error(`${browserType} is not supported yet`); } }; - const session = await buildDriverInstance(); + const { session, consoleLog$ } = await buildDriverInstance(); if (throttleOption === '1' && browserType === 'chrome') { // Only chrome supports this option. @@ -145,10 +206,15 @@ async function attemptToCreateCommand(log: ToolingLog, browserType: Browsers) { return; } // abort - return { driver: session, By, until }; + return { driver: session, By, until, consoleLog$ }; } -export async function initWebDriver(log: ToolingLog, browserType: Browsers) { +export async function initWebDriver( + log: ToolingLog, + browserType: Browsers, + lifecycle: Lifecycle, + logPollingMs: number +) { const logger = getLogger('webdriver.http.Executor'); logger.setLevel(logging.Level.FINEST); logger.addHandler((entry: { message: string }) => { @@ -170,7 +236,7 @@ export async function initWebDriver(log: ToolingLog, browserType: Browsers) { while (true) { const command = await Promise.race([ delay(30 * SECOND), - attemptToCreateCommand(log, browserType), + attemptToCreateCommand(log, browserType, lifecycle, logPollingMs), ]); if (!command) { diff --git a/x-pack/legacy/plugins/alerting/README.md b/x-pack/legacy/plugins/alerting/README.md index fd131acaf5b7d..678877f2b318e 100644 --- a/x-pack/legacy/plugins/alerting/README.md +++ b/x-pack/legacy/plugins/alerting/README.md @@ -37,7 +37,7 @@ When security is enabled, users who create alerts will need the `manage_api_key` ### Methods -**server.plugins.alerting.registerType(options)** +**server.plugins.alerting.setup.registerType(options)** The following table describes the properties of the `options` object. @@ -71,7 +71,7 @@ This example receives server and threshold as parameters. It will read the CPU u ``` import { schema } from '@kbn/config-schema'; ... -server.plugins.alerting.registerType({ +server.plugins.alerting.setup.registerType({ id: 'my-alert-type', name: 'My alert type', validate: { @@ -129,7 +129,7 @@ server.plugins.alerting.registerType({ This example only receives threshold as a parameter. It will read the CPU usage of all the servers and schedule individual actions if the reading for a server is greater than the threshold. This is a better implementation than above as only one query is performed for all the servers instead of one query per server. ``` -server.plugins.alerting.registerType({ +server.plugins.alerting.setup.registerType({ id: 'my-alert-type', name: 'My alert type', validate: { diff --git a/x-pack/legacy/plugins/alerting/index.ts b/x-pack/legacy/plugins/alerting/index.ts index 10ccbdbf4cd55..22db92baa8d28 100644 --- a/x-pack/legacy/plugins/alerting/index.ts +++ b/x-pack/legacy/plugins/alerting/index.ts @@ -9,7 +9,14 @@ import { Root } from 'joi'; import { init } from './server'; import mappings from './mappings.json'; -export { AlertingPlugin, AlertsClient, AlertType, AlertExecutorOptions } from './server'; +export { + AlertingPlugin, + AlertsClient, + AlertType, + AlertExecutorOptions, + PluginSetupContract, + PluginStartContract, +} from './server'; export function alerting(kibana: any) { return new kibana.Plugin({ diff --git a/x-pack/legacy/plugins/alerting/server/alert_type_registry.test.ts b/x-pack/legacy/plugins/alerting/server/alert_type_registry.test.ts index 649f07c41cdf1..e03df364e78ce 100644 --- a/x-pack/legacy/plugins/alerting/server/alert_type_registry.test.ts +++ b/x-pack/legacy/plugins/alerting/server/alert_type_registry.test.ts @@ -4,31 +4,15 @@ * you may not use this file except in compliance with the Elastic License. */ -jest.mock('./lib/get_create_task_runner_function', () => ({ - getCreateTaskRunnerFunction: jest.fn().mockReturnValue(jest.fn()), -})); - +import { TaskRunnerFactory } from './lib'; import { AlertTypeRegistry } from './alert_type_registry'; -import { SavedObjectsClientMock } from '../../../../../src/core/server/mocks'; import { taskManagerMock } from '../../task_manager/task_manager.mock'; -import { encryptedSavedObjectsMock } from '../../encrypted_saved_objects/server/plugin.mock'; const taskManager = taskManagerMock.create(); const alertTypeRegistryParams = { - isSecurityEnabled: true, - getServices() { - return { - log: jest.fn(), - callCluster: jest.fn(), - savedObjectsClient: SavedObjectsClientMock.create(), - }; - }, taskManager, - executeAction: jest.fn(), - getBasePath: jest.fn().mockReturnValue(undefined), - spaceIdToNamespace: jest.fn().mockReturnValue(undefined), - encryptedSavedObjectsPlugin: encryptedSavedObjectsMock.create(), + taskRunnerFactory: new TaskRunnerFactory(), }; beforeEach(() => jest.resetAllMocks()); @@ -60,31 +44,20 @@ describe('register()', () => { executor: jest.fn(), }; // eslint-disable-next-line @typescript-eslint/no-var-requires - const { getCreateTaskRunnerFunction } = require('./lib/get_create_task_runner_function'); const registry = new AlertTypeRegistry(alertTypeRegistryParams); - getCreateTaskRunnerFunction.mockReturnValue(jest.fn()); registry.register(alertType); expect(taskManager.registerTaskDefinitions).toHaveBeenCalledTimes(1); expect(taskManager.registerTaskDefinitions.mock.calls[0]).toMatchInlineSnapshot(` Array [ Object { "alerting:test": Object { - "createTaskRunner": [MockFunction], + "createTaskRunner": [Function], "title": "Test", "type": "alerting:test", }, }, ] `); - expect(getCreateTaskRunnerFunction).toHaveBeenCalledWith({ - alertType, - isSecurityEnabled: true, - getServices: alertTypeRegistryParams.getServices, - encryptedSavedObjectsPlugin: alertTypeRegistryParams.encryptedSavedObjectsPlugin, - getBasePath: alertTypeRegistryParams.getBasePath, - spaceIdToNamespace: alertTypeRegistryParams.spaceIdToNamespace, - executeAction: alertTypeRegistryParams.executeAction, - }); }); test('should throw an error if type is already registered', () => { diff --git a/x-pack/legacy/plugins/alerting/server/alert_type_registry.ts b/x-pack/legacy/plugins/alerting/server/alert_type_registry.ts index da169668cee6c..ec875aa2181eb 100644 --- a/x-pack/legacy/plugins/alerting/server/alert_type_registry.ts +++ b/x-pack/legacy/plugins/alerting/server/alert_type_registry.ts @@ -6,53 +6,24 @@ import Boom from 'boom'; import { i18n } from '@kbn/i18n'; -import { TaskManager } from '../../task_manager'; -import { getCreateTaskRunnerFunction } from './lib'; -import { ActionsPlugin } from '../../actions'; -import { EncryptedSavedObjectsPlugin } from '../../encrypted_saved_objects'; -import { - AlertType, - GetBasePathFunction, - GetServicesFunction, - SpaceIdToNamespaceFunction, -} from './types'; +import { TaskRunnerFactory } from './lib'; +import { RunContext } from '../../task_manager'; +import { TaskManagerSetupContract } from './shim'; +import { AlertType } from './types'; interface ConstructorOptions { - isSecurityEnabled: boolean; - getServices: GetServicesFunction; - taskManager: TaskManager; - executeAction: ActionsPlugin['execute']; - encryptedSavedObjectsPlugin: EncryptedSavedObjectsPlugin; - spaceIdToNamespace: SpaceIdToNamespaceFunction; - getBasePath: GetBasePathFunction; + taskManager: TaskManagerSetupContract; + taskRunnerFactory: TaskRunnerFactory; } export class AlertTypeRegistry { - private readonly getServices: GetServicesFunction; - private readonly taskManager: TaskManager; - private readonly executeAction: ActionsPlugin['execute']; + private readonly taskManager: TaskManagerSetupContract; private readonly alertTypes: Map = new Map(); - private readonly encryptedSavedObjectsPlugin: EncryptedSavedObjectsPlugin; - private readonly spaceIdToNamespace: SpaceIdToNamespaceFunction; - private readonly getBasePath: GetBasePathFunction; - private readonly isSecurityEnabled: boolean; + private readonly taskRunnerFactory: TaskRunnerFactory; - constructor({ - encryptedSavedObjectsPlugin, - executeAction, - taskManager, - getServices, - spaceIdToNamespace, - getBasePath, - isSecurityEnabled, - }: ConstructorOptions) { + constructor({ taskManager, taskRunnerFactory }: ConstructorOptions) { this.taskManager = taskManager; - this.executeAction = executeAction; - this.encryptedSavedObjectsPlugin = encryptedSavedObjectsPlugin; - this.getServices = getServices; - this.getBasePath = getBasePath; - this.spaceIdToNamespace = spaceIdToNamespace; - this.isSecurityEnabled = isSecurityEnabled; + this.taskRunnerFactory = taskRunnerFactory; } public has(id: string) { @@ -75,15 +46,8 @@ export class AlertTypeRegistry { [`alerting:${alertType.id}`]: { title: alertType.name, type: `alerting:${alertType.id}`, - createTaskRunner: getCreateTaskRunnerFunction({ - alertType, - isSecurityEnabled: this.isSecurityEnabled, - getServices: this.getServices, - executeAction: this.executeAction, - encryptedSavedObjectsPlugin: this.encryptedSavedObjectsPlugin, - getBasePath: this.getBasePath, - spaceIdToNamespace: this.spaceIdToNamespace, - }), + createTaskRunner: (context: RunContext) => + this.taskRunnerFactory.create(alertType, context), }, }); } diff --git a/x-pack/legacy/plugins/alerting/server/alerts_client.test.ts b/x-pack/legacy/plugins/alerting/server/alerts_client.test.ts index 856143c693954..dccb065faa1f9 100644 --- a/x-pack/legacy/plugins/alerting/server/alerts_client.test.ts +++ b/x-pack/legacy/plugins/alerting/server/alerts_client.test.ts @@ -6,7 +6,7 @@ import { schema } from '@kbn/config-schema'; import { AlertsClient } from './alerts_client'; -import { SavedObjectsClientMock } from '../../../../../src/core/server/mocks'; +import { SavedObjectsClientMock, loggingServiceMock } from '../../../../../src/core/server/mocks'; import { taskManagerMock } from '../../task_manager/task_manager.mock'; import { alertTypeRegistryMock } from './alert_type_registry.mock'; @@ -15,13 +15,13 @@ const alertTypeRegistry = alertTypeRegistryMock.create(); const savedObjectsClient = SavedObjectsClientMock.create(); const alertsClientParams = { - log: jest.fn(), taskManager, alertTypeRegistry, savedObjectsClient, spaceId: 'default', getUserName: jest.fn(), createAPIKey: jest.fn(), + logger: loggingServiceMock.create().get(), }; beforeEach(() => { @@ -418,16 +418,9 @@ describe('create()', () => { await expect(alertsClient.create({ data })).rejects.toThrowErrorMatchingInlineSnapshot( `"Task manager error"` ); - expect(alertsClientParams.log).toHaveBeenCalledTimes(1); - expect(alertsClientParams.log.mock.calls[0]).toMatchInlineSnapshot(` - Array [ - Array [ - "alerting", - "error", - ], - "Failed to cleanup alert \\"1\\" after scheduling task failed. Error: Saved object delete error", - ] - `); + expect(alertsClientParams.logger.error).toHaveBeenCalledWith( + 'Failed to cleanup alert "1" after scheduling task failed. Error: Saved object delete error' + ); }); test('throws an error if alert type not registerd', async () => { diff --git a/x-pack/legacy/plugins/alerting/server/alerts_client.ts b/x-pack/legacy/plugins/alerting/server/alerts_client.ts index 10f87dbd6024a..96c3f54e136a3 100644 --- a/x-pack/legacy/plugins/alerting/server/alerts_client.ts +++ b/x-pack/legacy/plugins/alerting/server/alerts_client.ts @@ -7,9 +7,9 @@ import Boom from 'boom'; import { omit } from 'lodash'; import { i18n } from '@kbn/i18n'; -import { SavedObjectsClientContract, SavedObjectReference } from 'src/core/server'; -import { Alert, RawAlert, AlertTypeRegistry, AlertAction, Log, AlertType } from './types'; -import { TaskManager } from '../../task_manager'; +import { Logger, SavedObjectsClientContract, SavedObjectReference } from 'src/core/server'; +import { Alert, RawAlert, AlertTypeRegistry, AlertAction, AlertType } from './types'; +import { TaskManagerStartContract } from './shim'; import { validateAlertTypeParams } from './lib'; import { CreateAPIKeyResult as SecurityPluginCreateAPIKeyResult } from '../../../../plugins/security/server'; @@ -23,8 +23,8 @@ interface SuccessCreateAPIKeyResult { export type CreateAPIKeyResult = FailedCreateAPIKeyResult | SuccessCreateAPIKeyResult; interface ConstructorOptions { - log: Log; - taskManager: TaskManager; + logger: Logger; + taskManager: TaskManagerStartContract; savedObjectsClient: SavedObjectsClientContract; alertTypeRegistry: AlertTypeRegistry; spaceId?: string; @@ -78,10 +78,10 @@ interface UpdateOptions { } export class AlertsClient { - private readonly log: Log; + private readonly logger: Logger; private readonly getUserName: () => Promise; private readonly spaceId?: string; - private readonly taskManager: TaskManager; + private readonly taskManager: TaskManagerStartContract; private readonly savedObjectsClient: SavedObjectsClientContract; private readonly alertTypeRegistry: AlertTypeRegistry; private readonly createAPIKey: () => Promise; @@ -90,12 +90,12 @@ export class AlertsClient { alertTypeRegistry, savedObjectsClient, taskManager, - log, + logger, spaceId, getUserName, createAPIKey, }: ConstructorOptions) { - this.log = log; + this.logger = logger; this.getUserName = getUserName; this.spaceId = spaceId; this.taskManager = taskManager; @@ -143,8 +143,7 @@ export class AlertsClient { await this.savedObjectsClient.delete('alert', createdAlert.id); } catch (err) { // Skip the cleanup error and throw the task manager error to avoid confusion - this.log( - ['alerting', 'error'], + this.logger.error( `Failed to cleanup alert "${createdAlert.id}" after scheduling task failed. Error: ${err.message}` ); } @@ -449,7 +448,7 @@ export class AlertsClient { private getAlertFromRaw( id: string, rawAlert: Partial, - references: SavedObjectReference[] + references: SavedObjectReference[] | undefined ) { if (!rawAlert.actions) { return { @@ -457,7 +456,7 @@ export class AlertsClient { ...rawAlert, }; } - const actions = this.injectReferencesIntoActions(rawAlert.actions, references); + const actions = this.injectReferencesIntoActions(rawAlert.actions, references || []); return { id, ...rawAlert, diff --git a/x-pack/legacy/plugins/alerting/server/index.ts b/x-pack/legacy/plugins/alerting/server/index.ts index 613878417d998..2f8356c0e9d01 100644 --- a/x-pack/legacy/plugins/alerting/server/index.ts +++ b/x-pack/legacy/plugins/alerting/server/index.ts @@ -7,3 +7,4 @@ export { init } from './init'; export { AlertType, AlertingPlugin, AlertExecutorOptions } from './types'; export { AlertsClient } from './alerts_client'; +export { PluginSetupContract, PluginStartContract } from './plugin'; diff --git a/x-pack/legacy/plugins/alerting/server/init.ts b/x-pack/legacy/plugins/alerting/server/init.ts index 191d9b08c8ab7..d76bc33f3fa0a 100644 --- a/x-pack/legacy/plugins/alerting/server/init.ts +++ b/x-pack/legacy/plugins/alerting/server/init.ts @@ -4,181 +4,25 @@ * you may not use this file except in compliance with the Elastic License. */ -import Hapi from 'hapi'; -import uuid from 'uuid'; -import { Legacy } from 'kibana'; -import KbnServer from 'src/legacy/server/kbn_server'; -import { ActionsPlugin } from '../../actions'; -import { TaskManager } from '../../task_manager'; -import { AlertingPlugin, Services } from './types'; -import { AlertTypeRegistry } from './alert_type_registry'; -import { AlertsClient, CreateAPIKeyResult } from './alerts_client'; -import { SpacesPlugin } from '../../spaces'; -import { KibanaRequest } from '../../../../../src/core/server'; -import { EncryptedSavedObjectsPlugin } from '../../encrypted_saved_objects'; -import { PluginSetupContract as SecurityPluginSetupContract } from '../../../../plugins/security/server'; -import { createOptionalPlugin } from '../../../server/lib/optional_plugin'; -import { - createAlertRoute, - deleteAlertRoute, - findRoute, - getRoute, - listAlertTypesRoute, - updateAlertRoute, - enableAlertRoute, - disableAlertRoute, - updateApiKeyRoute, - muteAllAlertRoute, - unmuteAllAlertRoute, - muteAlertInstanceRoute, - unmuteAlertInstanceRoute, -} from './routes'; +import { Server, shim } from './shim'; +import { Plugin } from './plugin'; +import { AlertingPlugin } from './types'; -// Extend PluginProperties to indicate which plugins are guaranteed to exist -// due to being marked as dependencies -interface Plugins extends Hapi.PluginProperties { - actions: ActionsPlugin; - task_manager: TaskManager; - encrypted_saved_objects: EncryptedSavedObjectsPlugin; -} - -interface Server extends Legacy.Server { - plugins: Plugins; -} - -export function init(server: Server) { - const config = server.config(); - const kbnServer = (server as unknown) as KbnServer; - const taskManager = server.plugins.task_manager; - const { callWithRequest } = server.plugins.elasticsearch.getCluster('admin'); - const spaces = createOptionalPlugin( - config, - 'xpack.spaces', - server.plugins, - 'spaces' - ); - const security = createOptionalPlugin( - config, - 'xpack.security', - kbnServer.newPlatform.setup.plugins, - 'security' - ); - - server.plugins.xpack_main.registerFeature({ - id: 'alerting', - name: 'Alerting', - app: ['alerting', 'kibana'], - privileges: { - all: { - savedObject: { - all: ['alert'], - read: [], - }, - ui: [], - api: ['alerting-read', 'alerting-all'], - }, - read: { - savedObject: { - all: [], - read: ['alert'], - }, - ui: [], - api: ['alerting-read'], - }, - }, - }); +export async function init(server: Server) { + const { initializerContext, coreSetup, coreStart, pluginsSetup, pluginsStart } = shim(server); - // Encrypted attributes - server.plugins.encrypted_saved_objects.registerType({ - type: 'alert', - attributesToEncrypt: new Set(['apiKey']), - attributesToExcludeFromAAD: new Set([ - 'scheduledTaskId', - 'muted', - 'mutedInstanceIds', - 'updatedBy', - ]), - }); - - function getServices(request: any): Services { - return { - log: (...args) => server.log(...args), - callCluster: (...args) => callWithRequest(request, ...args), - savedObjectsClient: server.savedObjects.getScopedSavedObjectsClient(request), - }; - } - function getBasePath(spaceId?: string): string { - return spaces.isEnabled && spaceId - ? spaces.getBasePath(spaceId) - : ((server.config().get('server.basePath') || '') as string); - } - function spaceIdToNamespace(spaceId?: string): string | undefined { - return spaces.isEnabled && spaceId ? spaces.spaceIdToNamespace(spaceId) : undefined; - } - - const alertTypeRegistry = new AlertTypeRegistry({ - getServices, - isSecurityEnabled: security.isEnabled, - taskManager, - executeAction: server.plugins.actions.execute, - encryptedSavedObjectsPlugin: server.plugins.encrypted_saved_objects, - getBasePath, - spaceIdToNamespace, - }); + const plugin = new Plugin(initializerContext); - // Register routes - createAlertRoute(server); - deleteAlertRoute(server); - findRoute(server); - getRoute(server); - listAlertTypesRoute(server); - updateAlertRoute(server); - enableAlertRoute(server); - disableAlertRoute(server); - updateApiKeyRoute(server); - muteAllAlertRoute(server); - unmuteAllAlertRoute(server); - muteAlertInstanceRoute(server); - unmuteAlertInstanceRoute(server); + const setupContract = await plugin.setup(coreSetup, pluginsSetup); + const startContract = plugin.start(coreStart, pluginsStart); - // Expose functions server.decorate('request', 'getAlertsClient', function() { - const request = this; - const savedObjectsClient = request.getSavedObjectsClient(); - - const alertsClient = new AlertsClient({ - log: server.log.bind(server), - savedObjectsClient, - alertTypeRegistry, - taskManager, - spaceId: spaces.isEnabled ? spaces.getSpaceId(request) : undefined, - async getUserName(): Promise { - if (!security.isEnabled) { - return null; - } - const user = await security.authc.getCurrentUser(KibanaRequest.from(request)); - return user ? user.username : null; - }, - async createAPIKey(): Promise { - if (!security.isEnabled) { - return { created: false }; - } - return { - created: true, - result: (await security.authc.createAPIKey(KibanaRequest.from(request), { - name: `source: alerting, generated uuid: "${uuid.v4()}"`, - role_descriptors: {}, - }))!, - }; - }, - }); - - return alertsClient; + return startContract.getAlertsClientWithRequest(this); }); const exposedFunctions: AlertingPlugin = { - registerType: alertTypeRegistry.register.bind(alertTypeRegistry), - listTypes: alertTypeRegistry.list.bind(alertTypeRegistry), + setup: setupContract, + start: startContract, }; server.expose(exposedFunctions); } diff --git a/x-pack/legacy/plugins/alerting/server/lib/alerts_client_factory.test.ts b/x-pack/legacy/plugins/alerting/server/lib/alerts_client_factory.test.ts new file mode 100644 index 0000000000000..1063e20e4ba3b --- /dev/null +++ b/x-pack/legacy/plugins/alerting/server/lib/alerts_client_factory.test.ts @@ -0,0 +1,107 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { Request } from 'hapi'; +import { AlertsClientFactory, ConstructorOpts } from './alerts_client_factory'; +import { alertTypeRegistryMock } from '../alert_type_registry.mock'; +import { taskManagerMock } from '../../../task_manager/task_manager.mock'; +import { KibanaRequest } from '../../../../../../src/core/server'; +import { loggingServiceMock } from '../../../../../../src/core/server/mocks'; + +jest.mock('../alerts_client'); + +const savedObjectsClient = jest.fn(); +const securityPluginSetup = { + authc: { + createAPIKey: jest.fn(), + getCurrentUser: jest.fn(), + }, +}; +const alertsClientFactoryParams: jest.Mocked = { + logger: loggingServiceMock.create().get(), + taskManager: taskManagerMock.create(), + alertTypeRegistry: alertTypeRegistryMock.create(), + getSpaceId: jest.fn(), +}; +const fakeRequest: Request = { + headers: {}, + getBasePath: () => '', + path: '/', + route: { settings: {} }, + url: { + href: '/', + }, + raw: { + req: { + url: '/', + }, + }, + getSavedObjectsClient: () => savedObjectsClient, +} as any; + +beforeEach(() => { + jest.resetAllMocks(); + alertsClientFactoryParams.getSpaceId.mockReturnValue('default'); +}); + +test('creates an alerts client with proper constructor arguments', async () => { + const factory = new AlertsClientFactory(alertsClientFactoryParams); + factory.create(KibanaRequest.from(fakeRequest), fakeRequest); + + expect(jest.requireMock('../alerts_client').AlertsClient).toHaveBeenCalledWith({ + savedObjectsClient, + logger: alertsClientFactoryParams.logger, + taskManager: alertsClientFactoryParams.taskManager, + alertTypeRegistry: alertsClientFactoryParams.alertTypeRegistry, + spaceId: 'default', + getUserName: expect.any(Function), + createAPIKey: expect.any(Function), + }); +}); + +test('getUserName() returns null when security is disabled', async () => { + const factory = new AlertsClientFactory(alertsClientFactoryParams); + factory.create(KibanaRequest.from(fakeRequest), fakeRequest); + const constructorCall = jest.requireMock('../alerts_client').AlertsClient.mock.calls[0][0]; + + const userNameResult = await constructorCall.getUserName(); + expect(userNameResult).toEqual(null); +}); + +test('getUserName() returns a name when security is enabled', async () => { + const factory = new AlertsClientFactory({ + ...alertsClientFactoryParams, + securityPluginSetup: securityPluginSetup as any, + }); + factory.create(KibanaRequest.from(fakeRequest), fakeRequest); + const constructorCall = jest.requireMock('../alerts_client').AlertsClient.mock.calls[0][0]; + + securityPluginSetup.authc.getCurrentUser.mockResolvedValueOnce({ username: 'bob' }); + const userNameResult = await constructorCall.getUserName(); + expect(userNameResult).toEqual('bob'); +}); + +test('createAPIKey() returns { created: false } when security is disabled', async () => { + const factory = new AlertsClientFactory(alertsClientFactoryParams); + factory.create(KibanaRequest.from(fakeRequest), fakeRequest); + const constructorCall = jest.requireMock('../alerts_client').AlertsClient.mock.calls[0][0]; + + const createAPIKeyResult = await constructorCall.createAPIKey(); + expect(createAPIKeyResult).toEqual({ created: false }); +}); + +test('createAPIKey() returns an API key when security is enabled', async () => { + const factory = new AlertsClientFactory({ + ...alertsClientFactoryParams, + securityPluginSetup: securityPluginSetup as any, + }); + factory.create(KibanaRequest.from(fakeRequest), fakeRequest); + const constructorCall = jest.requireMock('../alerts_client').AlertsClient.mock.calls[0][0]; + + securityPluginSetup.authc.createAPIKey.mockResolvedValueOnce({ api_key: '123', id: 'abc' }); + const createAPIKeyResult = await constructorCall.createAPIKey(); + expect(createAPIKeyResult).toEqual({ created: true, result: { api_key: '123', id: 'abc' } }); +}); diff --git a/x-pack/legacy/plugins/alerting/server/lib/alerts_client_factory.ts b/x-pack/legacy/plugins/alerting/server/lib/alerts_client_factory.ts new file mode 100644 index 0000000000000..bacb346042187 --- /dev/null +++ b/x-pack/legacy/plugins/alerting/server/lib/alerts_client_factory.ts @@ -0,0 +1,66 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import Hapi from 'hapi'; +import uuid from 'uuid'; +import { AlertTypeRegistry } from '../types'; +import { AlertsClient } from '../alerts_client'; +import { SecurityPluginStartContract, TaskManagerStartContract } from '../shim'; +import { KibanaRequest, Logger } from '../../../../../../src/core/server'; + +export interface ConstructorOpts { + logger: Logger; + taskManager: TaskManagerStartContract; + alertTypeRegistry: AlertTypeRegistry; + securityPluginSetup?: SecurityPluginStartContract; + getSpaceId: (request: Hapi.Request) => string | undefined; +} + +export class AlertsClientFactory { + private readonly logger: Logger; + private readonly taskManager: TaskManagerStartContract; + private readonly alertTypeRegistry: AlertTypeRegistry; + private readonly securityPluginSetup?: SecurityPluginStartContract; + private readonly getSpaceId: (request: Hapi.Request) => string | undefined; + + constructor(options: ConstructorOpts) { + this.logger = options.logger; + this.getSpaceId = options.getSpaceId; + this.taskManager = options.taskManager; + this.alertTypeRegistry = options.alertTypeRegistry; + this.securityPluginSetup = options.securityPluginSetup; + } + + public create(request: KibanaRequest, legacyRequest: Hapi.Request): AlertsClient { + const { securityPluginSetup } = this; + return new AlertsClient({ + logger: this.logger, + taskManager: this.taskManager, + alertTypeRegistry: this.alertTypeRegistry, + savedObjectsClient: legacyRequest.getSavedObjectsClient(), + spaceId: this.getSpaceId(legacyRequest), + async getUserName() { + if (!securityPluginSetup) { + return null; + } + const user = await securityPluginSetup.authc.getCurrentUser(request); + return user ? user.username : null; + }, + async createAPIKey() { + if (!securityPluginSetup) { + return { created: false }; + } + return { + created: true, + result: (await securityPluginSetup.authc.createAPIKey(request, { + name: `source: alerting, generated uuid: "${uuid.v4()}"`, + role_descriptors: {}, + }))!, + }; + }, + }); + } +} diff --git a/x-pack/legacy/plugins/alerting/server/lib/create_execution_handler.test.ts b/x-pack/legacy/plugins/alerting/server/lib/create_execution_handler.test.ts index 30e56a70ac492..4f523f203f87a 100644 --- a/x-pack/legacy/plugins/alerting/server/lib/create_execution_handler.test.ts +++ b/x-pack/legacy/plugins/alerting/server/lib/create_execution_handler.test.ts @@ -6,6 +6,7 @@ import { AlertType } from '../types'; import { createExecutionHandler } from './create_execution_handler'; +import { loggingServiceMock } from '../../../../../../src/core/server/mocks'; const alertType: AlertType = { id: 'test', @@ -15,7 +16,6 @@ const alertType: AlertType = { }; const createExecutionHandlerParams = { - log: jest.fn(), executeAction: jest.fn(), spaceId: 'default', alertId: '1', @@ -23,6 +23,7 @@ const createExecutionHandlerParams = { spaceIdToNamespace: jest.fn().mockReturnValue(undefined), getBasePath: jest.fn().mockReturnValue(undefined), alertType, + logger: loggingServiceMock.create().get(), actions: [ { id: '1', @@ -133,8 +134,7 @@ test(`logs an error when action group isn't part of actionGroups available for t alertInstanceId: '2', }); expect(result).toBeUndefined(); - expect(createExecutionHandlerParams.log).toHaveBeenCalledWith( - ['error', 'alerting'], + expect(createExecutionHandlerParams.logger.error).toHaveBeenCalledWith( 'Invalid action group "invalid-group" for alert "test".' ); }); diff --git a/x-pack/legacy/plugins/alerting/server/lib/create_execution_handler.ts b/x-pack/legacy/plugins/alerting/server/lib/create_execution_handler.ts index c2871965546db..2b562f70c68b9 100644 --- a/x-pack/legacy/plugins/alerting/server/lib/create_execution_handler.ts +++ b/x-pack/legacy/plugins/alerting/server/lib/create_execution_handler.ts @@ -4,18 +4,19 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AlertAction, State, Context, AlertType, Log } from '../types'; -import { ActionsPlugin } from '../../../actions'; +import { AlertAction, State, Context, AlertType } from '../types'; +import { ActionsPluginStartContract } from '../shim'; +import { Logger } from '../../../../../../src/core/server'; import { transformActionParams } from './transform_action_params'; interface CreateExecutionHandlerOptions { alertId: string; - executeAction: ActionsPlugin['execute']; + executeAction: ActionsPluginStartContract['execute']; actions: AlertAction[]; spaceId: string; apiKey?: string; alertType: AlertType; - log: Log; + logger: Logger; } interface ExecutionHandlerOptions { @@ -26,7 +27,7 @@ interface ExecutionHandlerOptions { } export function createExecutionHandler({ - log, + logger, alertId, executeAction, actions: alertActions, @@ -36,10 +37,7 @@ export function createExecutionHandler({ }: CreateExecutionHandlerOptions) { return async ({ actionGroup, context, state, alertInstanceId }: ExecutionHandlerOptions) => { if (!alertType.actionGroups.includes(actionGroup)) { - log( - ['error', 'alerting'], - `Invalid action group "${actionGroup}" for alert "${alertType.id}".` - ); + logger.error(`Invalid action group "${actionGroup}" for alert "${alertType.id}".`); return; } const actions = alertActions diff --git a/x-pack/legacy/plugins/alerting/server/lib/index.ts b/x-pack/legacy/plugins/alerting/server/lib/index.ts index 6c5570f2fad89..ca4ddf9e11ad2 100644 --- a/x-pack/legacy/plugins/alerting/server/lib/index.ts +++ b/x-pack/legacy/plugins/alerting/server/lib/index.ts @@ -5,6 +5,7 @@ */ export { AlertInstance } from './alert_instance'; -export { getCreateTaskRunnerFunction } from './get_create_task_runner_function'; export { validateAlertTypeParams } from './validate_alert_type_params'; export { parseDuration, getDurationSchema } from './parse_duration'; +export { AlertsClientFactory } from './alerts_client_factory'; +export { TaskRunnerFactory } from './task_runner_factory'; diff --git a/x-pack/legacy/plugins/alerting/server/lib/get_create_task_runner_function.test.ts b/x-pack/legacy/plugins/alerting/server/lib/task_runner_factory.test.ts similarity index 67% rename from x-pack/legacy/plugins/alerting/server/lib/get_create_task_runner_function.test.ts rename to x-pack/legacy/plugins/alerting/server/lib/task_runner_factory.test.ts index 8875e964ef58e..5a3c4a4e91eaa 100644 --- a/x-pack/legacy/plugins/alerting/server/lib/get_create_task_runner_function.test.ts +++ b/x-pack/legacy/plugins/alerting/server/lib/task_runner_factory.test.ts @@ -8,11 +8,21 @@ import sinon from 'sinon'; import { schema } from '@kbn/config-schema'; import { AlertExecutorOptions } from '../types'; import { ConcreteTaskInstance } from '../../../task_manager'; -import { SavedObjectsClientMock } from '../../../../../../src/core/server/mocks'; -import { getCreateTaskRunnerFunction } from './get_create_task_runner_function'; +import { TaskRunnerContext, TaskRunnerFactory } from './task_runner_factory'; import { encryptedSavedObjectsMock } from '../../../encrypted_saved_objects/server/plugin.mock'; +import { + SavedObjectsClientMock, + loggingServiceMock, +} from '../../../../../../src/core/server/mocks'; +const alertType = { + id: 'test', + name: 'My test alert', + actionGroups: ['default'], + executor: jest.fn(), +}; let fakeTimer: sinon.SinonFakeTimers; +let taskRunnerFactory: TaskRunnerFactory; let mockedTaskInstance: ConcreteTaskInstance; beforeAll(() => { @@ -35,6 +45,8 @@ beforeAll(() => { }, ownerId: null, }; + taskRunnerFactory = new TaskRunnerFactory(); + taskRunnerFactory.initialize(taskRunnerFactoryInitializerParams); }); afterAll(() => fakeTimer.restore()); @@ -47,17 +59,12 @@ const services = { savedObjectsClient, }; -const getCreateTaskRunnerFunctionParams = { +const taskRunnerFactoryInitializerParams: jest.Mocked = { isSecurityEnabled: true, getServices: jest.fn().mockReturnValue(services), - alertType: { - id: 'test', - name: 'My test alert', - actionGroups: ['default'], - executor: jest.fn(), - }, executeAction: jest.fn(), encryptedSavedObjectsPlugin, + logger: loggingServiceMock.create().get(), spaceIdToNamespace: jest.fn().mockReturnValue(undefined), getBasePath: jest.fn().mockReturnValue(undefined), }; @@ -94,11 +101,28 @@ const mockedAlertTypeSavedObject = { beforeEach(() => { jest.resetAllMocks(); - getCreateTaskRunnerFunctionParams.getServices.mockReturnValue(services); + taskRunnerFactoryInitializerParams.getServices.mockReturnValue(services); +}); + +test(`throws an error if factory isn't initialized`, () => { + const factory = new TaskRunnerFactory(); + expect(() => + factory.create(alertType, { taskInstance: mockedTaskInstance }) + ).toThrowErrorMatchingInlineSnapshot(`"TaskRunnerFactory not initialized"`); +}); + +test(`throws an error if factory is already initialized`, () => { + const factory = new TaskRunnerFactory(); + factory.initialize(taskRunnerFactoryInitializerParams); + expect(() => + factory.initialize(taskRunnerFactoryInitializerParams) + ).toThrowErrorMatchingInlineSnapshot(`"TaskRunnerFactory already initialized"`); }); test('successfully executes the task', async () => { - const createTaskRunner = getCreateTaskRunnerFunction(getCreateTaskRunnerFunctionParams); + const taskRunner = taskRunnerFactory.create(alertType, { + taskInstance: mockedTaskInstance, + }); savedObjectsClient.get.mockResolvedValueOnce(mockedAlertTypeSavedObject); encryptedSavedObjectsPlugin.getDecryptedAsInternalUser.mockResolvedValueOnce({ id: '1', @@ -108,8 +132,7 @@ test('successfully executes the task', async () => { }, references: [], }); - const runner = createTaskRunner({ taskInstance: mockedTaskInstance }); - const runnerResult = await runner.run(); + const runnerResult = await taskRunner.run(); expect(runnerResult).toMatchInlineSnapshot(` Object { "runAt": 1970-01-01T00:00:10.000Z, @@ -120,8 +143,8 @@ test('successfully executes the task', async () => { }, } `); - expect(getCreateTaskRunnerFunctionParams.alertType.executor).toHaveBeenCalledTimes(1); - const call = getCreateTaskRunnerFunctionParams.alertType.executor.mock.calls[0][0]; + expect(alertType.executor).toHaveBeenCalledTimes(1); + const call = alertType.executor.mock.calls[0][0]; expect(call.params).toMatchInlineSnapshot(` Object { "bar": true, @@ -135,12 +158,12 @@ test('successfully executes the task', async () => { }); test('executeAction is called per alert instance that is scheduled', async () => { - getCreateTaskRunnerFunctionParams.alertType.executor.mockImplementation( - ({ services: executorServices }: AlertExecutorOptions) => { - executorServices.alertInstanceFactory('1').scheduleActions('default'); - } - ); - const createTaskRunner = getCreateTaskRunnerFunction(getCreateTaskRunnerFunctionParams); + alertType.executor.mockImplementation(({ services: executorServices }: AlertExecutorOptions) => { + executorServices.alertInstanceFactory('1').scheduleActions('default'); + }); + const taskRunner = taskRunnerFactory.create(alertType, { + taskInstance: mockedTaskInstance, + }); savedObjectsClient.get.mockResolvedValueOnce(mockedAlertTypeSavedObject); encryptedSavedObjectsPlugin.getDecryptedAsInternalUser.mockResolvedValueOnce({ id: '1', @@ -150,10 +173,9 @@ test('executeAction is called per alert instance that is scheduled', async () => }, references: [], }); - const runner = createTaskRunner({ taskInstance: mockedTaskInstance }); - await runner.run(); - expect(getCreateTaskRunnerFunctionParams.executeAction).toHaveBeenCalledTimes(1); - expect(getCreateTaskRunnerFunctionParams.executeAction.mock.calls[0]).toMatchInlineSnapshot(` + await taskRunner.run(); + expect(taskRunnerFactoryInitializerParams.executeAction).toHaveBeenCalledTimes(1); + expect(taskRunnerFactoryInitializerParams.executeAction.mock.calls[0]).toMatchInlineSnapshot(` Array [ Object { "apiKey": "MTIzOmFiYw==", @@ -168,22 +190,10 @@ test('executeAction is called per alert instance that is scheduled', async () => }); test('persists alertInstances passed in from state, only if they are scheduled for execution', async () => { - getCreateTaskRunnerFunctionParams.alertType.executor.mockImplementation( - ({ services: executorServices }: AlertExecutorOptions) => { - executorServices.alertInstanceFactory('1').scheduleActions('default'); - } - ); - const createTaskRunner = getCreateTaskRunnerFunction(getCreateTaskRunnerFunctionParams); - savedObjectsClient.get.mockResolvedValueOnce(mockedAlertTypeSavedObject); - encryptedSavedObjectsPlugin.getDecryptedAsInternalUser.mockResolvedValueOnce({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - }, - references: [], + alertType.executor.mockImplementation(({ services: executorServices }: AlertExecutorOptions) => { + executorServices.alertInstanceFactory('1').scheduleActions('default'); }); - const runner = createTaskRunner({ + const taskRunner = taskRunnerFactory.create(alertType, { taskInstance: { ...mockedTaskInstance, state: { @@ -195,7 +205,16 @@ test('persists alertInstances passed in from state, only if they are scheduled f }, }, }); - const runnerResult = await runner.run(); + savedObjectsClient.get.mockResolvedValueOnce(mockedAlertTypeSavedObject); + encryptedSavedObjectsPlugin.getDecryptedAsInternalUser.mockResolvedValueOnce({ + id: '1', + type: 'alert', + attributes: { + apiKey: Buffer.from('123:abc').toString('base64'), + }, + references: [], + }); + const runnerResult = await taskRunner.run(); expect(runnerResult.state.alertInstances).toMatchInlineSnapshot(` Object { "1": Object { @@ -214,17 +233,17 @@ test('persists alertInstances passed in from state, only if they are scheduled f }); test('validates params before executing the alert type', async () => { - const createTaskRunner = getCreateTaskRunnerFunction({ - ...getCreateTaskRunnerFunctionParams, - alertType: { - ...getCreateTaskRunnerFunctionParams.alertType, + const taskRunner = taskRunnerFactory.create( + { + ...alertType, validate: { params: schema.object({ param1: schema.string(), }), }, }, - }); + { taskInstance: mockedTaskInstance } + ); savedObjectsClient.get.mockResolvedValueOnce(mockedAlertTypeSavedObject); encryptedSavedObjectsPlugin.getDecryptedAsInternalUser.mockResolvedValueOnce({ id: '1', @@ -234,14 +253,15 @@ test('validates params before executing the alert type', async () => { }, references: [], }); - const runner = createTaskRunner({ taskInstance: mockedTaskInstance }); - await expect(runner.run()).rejects.toThrowErrorMatchingInlineSnapshot( + await expect(taskRunner.run()).rejects.toThrowErrorMatchingInlineSnapshot( `"alertTypeParams invalid: [param1]: expected value of type [string] but got [undefined]"` ); }); test('throws error if reference not found', async () => { - const createTaskRunner = getCreateTaskRunnerFunction(getCreateTaskRunnerFunctionParams); + const taskRunner = taskRunnerFactory.create(alertType, { + taskInstance: mockedTaskInstance, + }); savedObjectsClient.get.mockResolvedValueOnce({ ...mockedAlertTypeSavedObject, references: [], @@ -254,14 +274,15 @@ test('throws error if reference not found', async () => { }, references: [], }); - const runner = createTaskRunner({ taskInstance: mockedTaskInstance }); - await expect(runner.run()).rejects.toThrowErrorMatchingInlineSnapshot( + await expect(taskRunner.run()).rejects.toThrowErrorMatchingInlineSnapshot( `"Action reference \\"action_0\\" not found in alert id: 1"` ); }); test('uses API key when provided', async () => { - const createTaskRunner = getCreateTaskRunnerFunction(getCreateTaskRunnerFunctionParams); + const taskRunner = taskRunnerFactory.create(alertType, { + taskInstance: mockedTaskInstance, + }); savedObjectsClient.get.mockResolvedValueOnce(mockedAlertTypeSavedObject); encryptedSavedObjectsPlugin.getDecryptedAsInternalUser.mockResolvedValueOnce({ id: '1', @@ -271,23 +292,36 @@ test('uses API key when provided', async () => { }, references: [], }); - const runner = createTaskRunner({ taskInstance: mockedTaskInstance }); - await runner.run(); - expect(getCreateTaskRunnerFunctionParams.getServices).toHaveBeenCalledWith({ + await taskRunner.run(); + expect(taskRunnerFactoryInitializerParams.getServices).toHaveBeenCalledWith({ getBasePath: expect.anything(), headers: { // base64 encoded "123:abc" authorization: 'ApiKey MTIzOmFiYw==', }, + path: '/', + route: { settings: {} }, + url: { + href: '/', + }, + raw: { + req: { + url: '/', + }, + }, }); }); test(`doesn't use API key when not provided`, async () => { - const createTaskRunner = getCreateTaskRunnerFunction({ - ...getCreateTaskRunnerFunctionParams, + const factory = new TaskRunnerFactory(); + factory.initialize({ + ...taskRunnerFactoryInitializerParams, isSecurityEnabled: false, }); + const taskRunner = factory.create(alertType, { + taskInstance: mockedTaskInstance, + }); savedObjectsClient.get.mockResolvedValueOnce(mockedAlertTypeSavedObject); encryptedSavedObjectsPlugin.getDecryptedAsInternalUser.mockResolvedValueOnce({ id: '1', @@ -295,12 +329,21 @@ test(`doesn't use API key when not provided`, async () => { attributes: {}, references: [], }); - const runner = createTaskRunner({ taskInstance: mockedTaskInstance }); - await runner.run(); + await taskRunner.run(); - expect(getCreateTaskRunnerFunctionParams.getServices).toHaveBeenCalledWith({ + expect(taskRunnerFactoryInitializerParams.getServices).toHaveBeenCalledWith({ getBasePath: expect.anything(), headers: {}, + path: '/', + route: { settings: {} }, + url: { + href: '/', + }, + raw: { + req: { + url: '/', + }, + }, }); }); diff --git a/x-pack/legacy/plugins/alerting/server/lib/get_create_task_runner_function.ts b/x-pack/legacy/plugins/alerting/server/lib/task_runner_factory.ts similarity index 78% rename from x-pack/legacy/plugins/alerting/server/lib/get_create_task_runner_function.ts rename to x-pack/legacy/plugins/alerting/server/lib/task_runner_factory.ts index 8725017148d4a..513f6d25d8371 100644 --- a/x-pack/legacy/plugins/alerting/server/lib/get_create_task_runner_function.ts +++ b/x-pack/legacy/plugins/alerting/server/lib/task_runner_factory.ts @@ -4,14 +4,14 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ActionsPlugin } from '../../../actions'; -import { ConcreteTaskInstance } from '../../../task_manager'; +import { Logger } from '../../../../../../src/core/server'; +import { RunContext } from '../../../task_manager'; import { createExecutionHandler } from './create_execution_handler'; import { createAlertInstanceFactory } from './create_alert_instance_factory'; import { AlertInstance } from './alert_instance'; import { getNextRunAt } from './get_next_run_at'; import { validateAlertTypeParams } from './validate_alert_type_params'; -import { EncryptedSavedObjectsPlugin } from '../../../encrypted_saved_objects'; +import { ActionsPluginStartContract, EncryptedSavedObjectsStartContract } from '../shim'; import { AlertType, AlertServices, @@ -21,32 +21,45 @@ import { SpaceIdToNamespaceFunction, } from '../types'; -export interface CreateTaskRunnerFunctionOptions { +export interface TaskRunnerContext { + logger: Logger; isSecurityEnabled: boolean; getServices: GetServicesFunction; - alertType: AlertType; - executeAction: ActionsPlugin['execute']; - encryptedSavedObjectsPlugin: EncryptedSavedObjectsPlugin; + executeAction: ActionsPluginStartContract['execute']; + encryptedSavedObjectsPlugin: EncryptedSavedObjectsStartContract; spaceIdToNamespace: SpaceIdToNamespaceFunction; getBasePath: GetBasePathFunction; } -interface TaskRunnerOptions { - taskInstance: ConcreteTaskInstance; -} +export class TaskRunnerFactory { + private isInitialized = false; + private taskRunnerContext?: TaskRunnerContext; + + public initialize(taskRunnerContext: TaskRunnerContext) { + if (this.isInitialized) { + throw new Error('TaskRunnerFactory already initialized'); + } + this.isInitialized = true; + this.taskRunnerContext = taskRunnerContext; + } + + public create(alertType: AlertType, { taskInstance }: RunContext) { + if (!this.isInitialized) { + throw new Error('TaskRunnerFactory not initialized'); + } + + const { + logger, + isSecurityEnabled, + getServices, + executeAction, + encryptedSavedObjectsPlugin, + spaceIdToNamespace, + getBasePath, + } = this.taskRunnerContext!; -export function getCreateTaskRunnerFunction({ - getServices, - alertType, - executeAction, - encryptedSavedObjectsPlugin, - spaceIdToNamespace, - getBasePath, - isSecurityEnabled, -}: CreateTaskRunnerFunctionOptions) { - return ({ taskInstance }: TaskRunnerOptions) => { return { - run: async () => { + async run() { const { alertId, spaceId } = taskInstance.params; const requestHeaders: Record = {}; const namespace = spaceIdToNamespace(spaceId); @@ -69,6 +82,16 @@ export function getCreateTaskRunnerFunction({ const fakeRequest = { headers: requestHeaders, getBasePath: () => getBasePath(spaceId), + path: '/', + route: { settings: {} }, + url: { + href: '/', + }, + raw: { + req: { + url: '/', + }, + }, }; const services = getServices(fakeRequest); @@ -97,7 +120,7 @@ export function getCreateTaskRunnerFunction({ const executionHandler = createExecutionHandler({ alertId, - log: services.log, + logger, executeAction, apiKey, actions: actionsWithIds, @@ -154,5 +177,5 @@ export function getCreateTaskRunnerFunction({ }; }, }; - }; + } } diff --git a/x-pack/legacy/plugins/alerting/server/plugin.ts b/x-pack/legacy/plugins/alerting/server/plugin.ts new file mode 100644 index 0000000000000..150343f447c1d --- /dev/null +++ b/x-pack/legacy/plugins/alerting/server/plugin.ts @@ -0,0 +1,168 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import Hapi from 'hapi'; +import { first } from 'rxjs/operators'; +import { Services } from './types'; +import { AlertsClient } from './alerts_client'; +import { AlertTypeRegistry } from './alert_type_registry'; +import { AlertsClientFactory, TaskRunnerFactory } from './lib'; +import { IClusterClient, KibanaRequest, Logger } from '../../../../../src/core/server'; +import { + AlertingPluginInitializerContext, + AlertingCoreSetup, + AlertingCoreStart, + AlertingPluginsSetup, + AlertingPluginsStart, +} from './shim'; +import { + createAlertRoute, + deleteAlertRoute, + findAlertRoute, + getAlertRoute, + listAlertTypesRoute, + updateAlertRoute, + enableAlertRoute, + disableAlertRoute, + updateApiKeyRoute, + muteAllAlertRoute, + unmuteAllAlertRoute, + muteAlertInstanceRoute, + unmuteAlertInstanceRoute, +} from './routes'; + +export interface PluginSetupContract { + registerType: AlertTypeRegistry['register']; +} +export interface PluginStartContract { + listTypes: AlertTypeRegistry['list']; + getAlertsClientWithRequest(request: Hapi.Request): AlertsClient; +} + +export class Plugin { + private readonly logger: Logger; + private alertTypeRegistry?: AlertTypeRegistry; + private readonly taskRunnerFactory: TaskRunnerFactory; + private adminClient?: IClusterClient; + private serverBasePath?: string; + + constructor(initializerContext: AlertingPluginInitializerContext) { + this.logger = initializerContext.logger.get('plugins', 'alerting'); + this.taskRunnerFactory = new TaskRunnerFactory(); + } + + public async setup( + core: AlertingCoreSetup, + plugins: AlertingPluginsSetup + ): Promise { + this.adminClient = await core.elasticsearch.adminClient$.pipe(first()).toPromise(); + + plugins.xpack_main.registerFeature({ + id: 'alerting', + name: 'Alerting', + app: ['alerting', 'kibana'], + privileges: { + all: { + savedObject: { + all: ['alert'], + read: [], + }, + ui: [], + api: ['alerting-read', 'alerting-all'], + }, + read: { + savedObject: { + all: [], + read: ['alert'], + }, + ui: [], + api: ['alerting-read'], + }, + }, + }); + + // Encrypted attributes + plugins.encrypted_saved_objects.registerType({ + type: 'alert', + attributesToEncrypt: new Set(['apiKey']), + attributesToExcludeFromAAD: new Set([ + 'scheduledTaskId', + 'muted', + 'mutedInstanceIds', + 'updatedBy', + ]), + }); + + const alertTypeRegistry = new AlertTypeRegistry({ + taskManager: plugins.task_manager, + taskRunnerFactory: this.taskRunnerFactory, + }); + this.alertTypeRegistry = alertTypeRegistry; + this.serverBasePath = core.http.basePath.serverBasePath; + + // Register routes + core.http.route(createAlertRoute); + core.http.route(deleteAlertRoute); + core.http.route(findAlertRoute); + core.http.route(getAlertRoute); + core.http.route(listAlertTypesRoute); + core.http.route(updateAlertRoute); + core.http.route(enableAlertRoute); + core.http.route(disableAlertRoute); + core.http.route(updateApiKeyRoute); + core.http.route(muteAllAlertRoute); + core.http.route(unmuteAllAlertRoute); + core.http.route(muteAlertInstanceRoute); + core.http.route(unmuteAlertInstanceRoute); + + return { + registerType: alertTypeRegistry.register.bind(alertTypeRegistry), + }; + } + + public start(core: AlertingCoreStart, plugins: AlertingPluginsStart): PluginStartContract { + const { adminClient, serverBasePath } = this; + + const alertsClientFactory = new AlertsClientFactory({ + alertTypeRegistry: this.alertTypeRegistry!, + logger: this.logger, + taskManager: plugins.task_manager, + securityPluginSetup: plugins.security, + getSpaceId(request: Hapi.Request) { + const spacesPlugin = plugins.spaces(); + return spacesPlugin ? spacesPlugin.getSpaceId(request) : undefined; + }, + }); + + this.taskRunnerFactory.initialize({ + logger: this.logger, + isSecurityEnabled: !!plugins.security, + getServices(request: Hapi.Request): Services { + return { + callCluster: (...args) => + adminClient!.asScoped(KibanaRequest.from(request)).callAsCurrentUser(...args), + savedObjectsClient: core.savedObjects.getScopedSavedObjectsClient(request), + }; + }, + executeAction: plugins.actions.execute, + encryptedSavedObjectsPlugin: plugins.encrypted_saved_objects, + spaceIdToNamespace(spaceId?: string): string | undefined { + const spacesPlugin = plugins.spaces(); + return spacesPlugin && spaceId ? spacesPlugin.spaceIdToNamespace(spaceId) : undefined; + }, + getBasePath(spaceId?: string): string { + const spacesPlugin = plugins.spaces(); + return spacesPlugin && spaceId ? spacesPlugin.getBasePath(spaceId) : serverBasePath!; + }, + }); + + return { + listTypes: this.alertTypeRegistry!.list.bind(this.alertTypeRegistry!), + getAlertsClientWithRequest: (request: Hapi.Request) => + alertsClientFactory!.create(KibanaRequest.from(request), request), + }; + } +} diff --git a/x-pack/legacy/plugins/alerting/server/routes/_mock_server.ts b/x-pack/legacy/plugins/alerting/server/routes/_mock_server.ts index b5defca9319a9..0f865a12067ad 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/_mock_server.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/_mock_server.ts @@ -34,8 +34,14 @@ export function createMockServer(config: Record = defaultConfig) { server.register({ name: 'alerting', register(pluginServer: Hapi.Server) { - pluginServer.expose('registerType', alertTypeRegistry.register); - pluginServer.expose('listTypes', alertTypeRegistry.list); + pluginServer.expose({ + setup: { + registerType: alertTypeRegistry.register, + }, + start: { + listTypes: alertTypeRegistry.list, + }, + }); }, }); diff --git a/x-pack/legacy/plugins/alerting/server/routes/create.test.ts b/x-pack/legacy/plugins/alerting/server/routes/create.test.ts index 740f59f924acb..3751aa968b3de 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/create.test.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/create.test.ts @@ -8,7 +8,7 @@ import { createMockServer } from './_mock_server'; import { createAlertRoute } from './create'; const { server, alertsClient } = createMockServer(); -createAlertRoute(server); +server.route(createAlertRoute); const mockedAlert = { alertTypeId: '1', diff --git a/x-pack/legacy/plugins/alerting/server/routes/create.ts b/x-pack/legacy/plugins/alerting/server/routes/create.ts index 2d488612b9c55..984153d81e0f8 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/create.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/create.ts @@ -20,39 +20,37 @@ interface ScheduleRequest extends Hapi.Request { }; } -export function createAlertRoute(server: Hapi.Server) { - server.route({ - method: 'POST', - path: '/api/alert', - options: { - tags: ['access:alerting-all'], - validate: { - options: { - abortEarly: false, - }, - payload: Joi.object() - .keys({ - enabled: Joi.boolean().default(true), - alertTypeId: Joi.string().required(), - throttle: getDurationSchema().default(null), - interval: getDurationSchema().required(), - alertTypeParams: Joi.object().required(), - actions: Joi.array() - .items( - Joi.object().keys({ - group: Joi.string().required(), - id: Joi.string().required(), - params: Joi.object().required(), - }) - ) - .required(), - }) - .required(), +export const createAlertRoute = { + method: 'POST', + path: '/api/alert', + options: { + tags: ['access:alerting-all'], + validate: { + options: { + abortEarly: false, }, + payload: Joi.object() + .keys({ + enabled: Joi.boolean().default(true), + alertTypeId: Joi.string().required(), + throttle: getDurationSchema().default(null), + interval: getDurationSchema().required(), + alertTypeParams: Joi.object().required(), + actions: Joi.array() + .items( + Joi.object().keys({ + group: Joi.string().required(), + id: Joi.string().required(), + params: Joi.object().required(), + }) + ) + .required(), + }) + .required(), }, - async handler(request: ScheduleRequest) { - const alertsClient = request.getAlertsClient!(); - return await alertsClient.create({ data: request.payload }); - }, - }); -} + }, + async handler(request: ScheduleRequest) { + const alertsClient = request.getAlertsClient!(); + return await alertsClient.create({ data: request.payload }); + }, +}; diff --git a/x-pack/legacy/plugins/alerting/server/routes/delete.test.ts b/x-pack/legacy/plugins/alerting/server/routes/delete.test.ts index 7e3948640034e..b7b25538847fa 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/delete.test.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/delete.test.ts @@ -8,7 +8,7 @@ import { createMockServer } from './_mock_server'; import { deleteAlertRoute } from './delete'; const { server, alertsClient } = createMockServer(); -deleteAlertRoute(server); +server.route(deleteAlertRoute); beforeEach(() => jest.resetAllMocks()); diff --git a/x-pack/legacy/plugins/alerting/server/routes/delete.ts b/x-pack/legacy/plugins/alerting/server/routes/delete.ts index 428c6d69b77d4..24a1f6777b17b 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/delete.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/delete.ts @@ -13,25 +13,23 @@ interface DeleteRequest extends Hapi.Request { }; } -export function deleteAlertRoute(server: Hapi.Server) { - server.route({ - method: 'DELETE', - path: '/api/alert/{id}', - options: { - tags: ['access:alerting-all'], - validate: { - params: Joi.object() - .keys({ - id: Joi.string().required(), - }) - .required(), - }, +export const deleteAlertRoute = { + method: 'DELETE', + path: '/api/alert/{id}', + config: { + tags: ['access:alerting-all'], + validate: { + params: Joi.object() + .keys({ + id: Joi.string().required(), + }) + .required(), }, - async handler(request: DeleteRequest, h: Hapi.ResponseToolkit) { - const { id } = request.params; - const alertsClient = request.getAlertsClient!(); - await alertsClient.delete({ id }); - return h.response().code(204); - }, - }); -} + }, + async handler(request: DeleteRequest, h: Hapi.ResponseToolkit) { + const { id } = request.params; + const alertsClient = request.getAlertsClient!(); + await alertsClient.delete({ id }); + return h.response().code(204); + }, +}; diff --git a/x-pack/legacy/plugins/alerting/server/routes/disable.test.ts b/x-pack/legacy/plugins/alerting/server/routes/disable.test.ts index 05ad20f480070..d2214f5c7c175 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/disable.test.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/disable.test.ts @@ -8,7 +8,7 @@ import { createMockServer } from './_mock_server'; import { disableAlertRoute } from './disable'; const { server, alertsClient } = createMockServer(); -disableAlertRoute(server); +server.route(disableAlertRoute); test('disables an alert', async () => { const request = { diff --git a/x-pack/legacy/plugins/alerting/server/routes/disable.ts b/x-pack/legacy/plugins/alerting/server/routes/disable.ts index a80f5f21b16e3..2e88d3b5b96da 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/disable.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/disable.ts @@ -6,20 +6,18 @@ import Hapi from 'hapi'; -export function disableAlertRoute(server: Hapi.Server) { - server.route({ - method: 'POST', - path: '/api/alert/{id}/_disable', - options: { - tags: ['access:alerting-all'], - response: { - emptyStatusCode: 204, - }, +export const disableAlertRoute = { + method: 'POST', + path: '/api/alert/{id}/_disable', + config: { + tags: ['access:alerting-all'], + response: { + emptyStatusCode: 204, }, - async handler(request: Hapi.Request, h: Hapi.ResponseToolkit) { - const alertsClient = request.getAlertsClient!(); - await alertsClient.disable({ id: request.params.id }); - return h.response(); - }, - }); -} + }, + async handler(request: Hapi.Request, h: Hapi.ResponseToolkit) { + const alertsClient = request.getAlertsClient!(); + await alertsClient.disable({ id: request.params.id }); + return h.response(); + }, +}; diff --git a/x-pack/legacy/plugins/alerting/server/routes/enable.test.ts b/x-pack/legacy/plugins/alerting/server/routes/enable.test.ts index 657f5b1daf3fb..bc5498af61989 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/enable.test.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/enable.test.ts @@ -8,7 +8,7 @@ import { createMockServer } from './_mock_server'; import { enableAlertRoute } from './enable'; const { server, alertsClient } = createMockServer(); -enableAlertRoute(server); +server.route(enableAlertRoute); test('enables an alert', async () => { const request = { diff --git a/x-pack/legacy/plugins/alerting/server/routes/enable.ts b/x-pack/legacy/plugins/alerting/server/routes/enable.ts index d8943b8a85d72..28080db7b0230 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/enable.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/enable.ts @@ -6,20 +6,18 @@ import Hapi from 'hapi'; -export function enableAlertRoute(server: Hapi.Server) { - server.route({ - method: 'POST', - path: '/api/alert/{id}/_enable', - options: { - tags: ['access:alerting-all'], - response: { - emptyStatusCode: 204, - }, +export const enableAlertRoute = { + method: 'POST', + path: '/api/alert/{id}/_enable', + config: { + tags: ['access:alerting-all'], + response: { + emptyStatusCode: 204, }, - async handler(request: Hapi.Request, h: Hapi.ResponseToolkit) { - const alertsClient = request.getAlertsClient!(); - await alertsClient.enable({ id: request.params.id }); - return h.response(); - }, - }); -} + }, + async handler(request: Hapi.Request, h: Hapi.ResponseToolkit) { + const alertsClient = request.getAlertsClient!(); + await alertsClient.enable({ id: request.params.id }); + return h.response(); + }, +}; diff --git a/x-pack/legacy/plugins/alerting/server/routes/find.test.ts b/x-pack/legacy/plugins/alerting/server/routes/find.test.ts index 73ab2ddd594fa..aac323bed0e13 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/find.test.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/find.test.ts @@ -5,10 +5,10 @@ */ import { createMockServer } from './_mock_server'; -import { findRoute } from './find'; +import { findAlertRoute } from './find'; const { server, alertsClient } = createMockServer(); -findRoute(server); +server.route(findAlertRoute); beforeEach(() => jest.resetAllMocks()); diff --git a/x-pack/legacy/plugins/alerting/server/routes/find.ts b/x-pack/legacy/plugins/alerting/server/routes/find.ts index 6085c5d714ea5..ae76a4acaade0 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/find.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/find.ts @@ -25,59 +25,57 @@ interface FindRequest extends WithoutQueryAndParams { }; } -export function findRoute(server: Hapi.Server) { - server.route({ - method: 'GET', - path: '/api/alert/_find', - options: { - tags: ['access:alerting-read'], - validate: { - query: Joi.object() - .keys({ - per_page: Joi.number() - .min(0) - .default(20), - page: Joi.number() - .min(1) - .default(1), - search: Joi.string() - .allow('') - .optional(), - default_search_operator: Joi.string() - .valid('OR', 'AND') - .default('OR'), - search_fields: Joi.array() - .items(Joi.string()) - .single(), - sort_field: Joi.string(), - has_reference: Joi.object() - .keys({ - type: Joi.string().required(), - id: Joi.string().required(), - }) - .optional(), - fields: Joi.array() - .items(Joi.string()) - .single(), - }) - .default(), - }, - }, - async handler(request: FindRequest) { - const { query } = request; - const alertsClient = request.getAlertsClient!(); - return await alertsClient.find({ - options: { - perPage: query.per_page, - page: query.page, - search: query.search, - defaultSearchOperator: query.default_search_operator, - searchFields: query.search_fields, - sortField: query.sort_field, - hasReference: query.has_reference, - fields: query.fields, - }, - }); +export const findAlertRoute = { + method: 'GET', + path: '/api/alert/_find', + config: { + tags: ['access:alerting-read'], + validate: { + query: Joi.object() + .keys({ + per_page: Joi.number() + .min(0) + .default(20), + page: Joi.number() + .min(1) + .default(1), + search: Joi.string() + .allow('') + .optional(), + default_search_operator: Joi.string() + .valid('OR', 'AND') + .default('OR'), + search_fields: Joi.array() + .items(Joi.string()) + .single(), + sort_field: Joi.string(), + has_reference: Joi.object() + .keys({ + type: Joi.string().required(), + id: Joi.string().required(), + }) + .optional(), + fields: Joi.array() + .items(Joi.string()) + .single(), + }) + .default(), }, - }); -} + }, + async handler(request: FindRequest) { + const { query } = request; + const alertsClient = request.getAlertsClient!(); + return await alertsClient.find({ + options: { + perPage: query.per_page, + page: query.page, + search: query.search, + defaultSearchOperator: query.default_search_operator, + searchFields: query.search_fields, + sortField: query.sort_field, + hasReference: query.has_reference, + fields: query.fields, + }, + }); + }, +}; diff --git a/x-pack/legacy/plugins/alerting/server/routes/get.test.ts b/x-pack/legacy/plugins/alerting/server/routes/get.test.ts index 01bb6fff7c8bc..84938a0e927d1 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/get.test.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/get.test.ts @@ -5,10 +5,10 @@ */ import { createMockServer } from './_mock_server'; -import { getRoute } from './get'; +import { getAlertRoute } from './get'; const { server, alertsClient } = createMockServer(); -getRoute(server); +server.route(getAlertRoute); const mockedAlert = { id: '1', diff --git a/x-pack/legacy/plugins/alerting/server/routes/get.ts b/x-pack/legacy/plugins/alerting/server/routes/get.ts index ce172176aedbf..67991aa575a21 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/get.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/get.ts @@ -13,24 +13,22 @@ interface GetRequest extends Hapi.Request { }; } -export function getRoute(server: Hapi.Server) { - server.route({ - method: 'GET', - path: `/api/alert/{id}`, - options: { - tags: ['access:alerting-read'], - validate: { - params: Joi.object() - .keys({ - id: Joi.string().required(), - }) - .required(), - }, +export const getAlertRoute = { + method: 'GET', + path: `/api/alert/{id}`, + options: { + tags: ['access:alerting-read'], + validate: { + params: Joi.object() + .keys({ + id: Joi.string().required(), + }) + .required(), }, - async handler(request: GetRequest) { - const { id } = request.params; - const alertsClient = request.getAlertsClient!(); - return await alertsClient.get({ id }); - }, - }); -} + }, + async handler(request: GetRequest) { + const { id } = request.params; + const alertsClient = request.getAlertsClient!(); + return await alertsClient.get({ id }); + }, +}; diff --git a/x-pack/legacy/plugins/alerting/server/routes/index.ts b/x-pack/legacy/plugins/alerting/server/routes/index.ts index 9e568c21f2992..02cba8adc9db2 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/index.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/index.ts @@ -6,8 +6,8 @@ export { createAlertRoute } from './create'; export { deleteAlertRoute } from './delete'; -export { findRoute } from './find'; -export { getRoute } from './get'; +export { findAlertRoute } from './find'; +export { getAlertRoute } from './get'; export { listAlertTypesRoute } from './list_alert_types'; export { updateAlertRoute } from './update'; export { enableAlertRoute } from './enable'; diff --git a/x-pack/legacy/plugins/alerting/server/routes/list_alert_types.test.ts b/x-pack/legacy/plugins/alerting/server/routes/list_alert_types.test.ts index d9d4bf48a971b..46f02812e0f6c 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/list_alert_types.test.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/list_alert_types.test.ts @@ -8,7 +8,7 @@ import { createMockServer } from './_mock_server'; import { listAlertTypesRoute } from './list_alert_types'; const { server, alertTypeRegistry } = createMockServer(); -listAlertTypesRoute(server); +server.route(listAlertTypesRoute); beforeEach(() => jest.resetAllMocks()); diff --git a/x-pack/legacy/plugins/alerting/server/routes/list_alert_types.ts b/x-pack/legacy/plugins/alerting/server/routes/list_alert_types.ts index 8a1e507fd1e05..13aaf6bfe452e 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/list_alert_types.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/list_alert_types.ts @@ -6,15 +6,13 @@ import Hapi from 'hapi'; -export function listAlertTypesRoute(server: Hapi.Server) { - server.route({ - method: 'GET', - path: `/api/alert/types`, - options: { - tags: ['access:alerting-read'], - }, - async handler(request: Hapi.Request) { - return request.server.plugins.alerting!.listTypes(); - }, - }); -} +export const listAlertTypesRoute = { + method: 'GET', + path: `/api/alert/types`, + config: { + tags: ['access:alerting-read'], + }, + async handler(request: Hapi.Request) { + return request.server.plugins.alerting!.start.listTypes(); + }, +}; diff --git a/x-pack/legacy/plugins/alerting/server/routes/mute_all.test.ts b/x-pack/legacy/plugins/alerting/server/routes/mute_all.test.ts index 17114fcc62a42..408a037edc345 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/mute_all.test.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/mute_all.test.ts @@ -8,7 +8,7 @@ import { createMockServer } from './_mock_server'; import { muteAllAlertRoute } from './mute_all'; const { server, alertsClient } = createMockServer(); -muteAllAlertRoute(server); +server.route(muteAllAlertRoute); test('mutes an alert', async () => { const request = { diff --git a/x-pack/legacy/plugins/alerting/server/routes/mute_all.ts b/x-pack/legacy/plugins/alerting/server/routes/mute_all.ts index 5ad63c8ed97d4..90ae9b11b2f43 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/mute_all.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/mute_all.ts @@ -12,20 +12,18 @@ interface MuteAllRequest extends Hapi.Request { }; } -export function muteAllAlertRoute(server: Hapi.Server) { - server.route({ - method: 'POST', - path: '/api/alert/{id}/_mute_all', - options: { - tags: ['access:alerting-all'], - response: { - emptyStatusCode: 204, - }, +export const muteAllAlertRoute = { + method: 'POST', + path: '/api/alert/{id}/_mute_all', + config: { + tags: ['access:alerting-all'], + response: { + emptyStatusCode: 204, }, - async handler(request: MuteAllRequest, h: Hapi.ResponseToolkit) { - const alertsClient = request.getAlertsClient!(); - await alertsClient.muteAll(request.params); - return h.response(); - }, - }); -} + }, + async handler(request: MuteAllRequest, h: Hapi.ResponseToolkit) { + const alertsClient = request.getAlertsClient!(); + await alertsClient.muteAll(request.params); + return h.response(); + }, +}; diff --git a/x-pack/legacy/plugins/alerting/server/routes/mute_instance.test.ts b/x-pack/legacy/plugins/alerting/server/routes/mute_instance.test.ts index 9ab46562d12f2..697a68763adf6 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/mute_instance.test.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/mute_instance.test.ts @@ -8,7 +8,7 @@ import { createMockServer } from './_mock_server'; import { muteAlertInstanceRoute } from './mute_instance'; const { server, alertsClient } = createMockServer(); -muteAlertInstanceRoute(server); +server.route(muteAlertInstanceRoute); test('mutes an alert instance', async () => { const request = { diff --git a/x-pack/legacy/plugins/alerting/server/routes/mute_instance.ts b/x-pack/legacy/plugins/alerting/server/routes/mute_instance.ts index 90d3b116f6617..503a07af88bca 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/mute_instance.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/mute_instance.ts @@ -13,20 +13,18 @@ interface MuteInstanceRequest extends Hapi.Request { }; } -export function muteAlertInstanceRoute(server: Hapi.Server) { - server.route({ - method: 'POST', - path: '/api/alert/{alertId}/alert_instance/{alertInstanceId}/_mute', - options: { - tags: ['access:alerting-all'], - response: { - emptyStatusCode: 204, - }, +export const muteAlertInstanceRoute = { + method: 'POST', + path: '/api/alert/{alertId}/alert_instance/{alertInstanceId}/_mute', + config: { + tags: ['access:alerting-all'], + response: { + emptyStatusCode: 204, }, - async handler(request: MuteInstanceRequest, h: Hapi.ResponseToolkit) { - const alertsClient = request.getAlertsClient!(); - await alertsClient.muteInstance(request.params); - return h.response(); - }, - }); -} + }, + async handler(request: MuteInstanceRequest, h: Hapi.ResponseToolkit) { + const alertsClient = request.getAlertsClient!(); + await alertsClient.muteInstance(request.params); + return h.response(); + }, +}; diff --git a/x-pack/legacy/plugins/alerting/server/routes/unmute_all.test.ts b/x-pack/legacy/plugins/alerting/server/routes/unmute_all.test.ts index 62fce147b0105..c28f51b405a3e 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/unmute_all.test.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/unmute_all.test.ts @@ -8,7 +8,7 @@ import { createMockServer } from './_mock_server'; import { unmuteAllAlertRoute } from './unmute_all'; const { server, alertsClient } = createMockServer(); -unmuteAllAlertRoute(server); +server.route(unmuteAllAlertRoute); test('unmutes an alert', async () => { const request = { diff --git a/x-pack/legacy/plugins/alerting/server/routes/unmute_all.ts b/x-pack/legacy/plugins/alerting/server/routes/unmute_all.ts index 8a72f1d9e08f9..8bb119c600096 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/unmute_all.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/unmute_all.ts @@ -12,20 +12,18 @@ interface UnmuteAllRequest extends Hapi.Request { }; } -export function unmuteAllAlertRoute(server: Hapi.Server) { - server.route({ - method: 'POST', - path: '/api/alert/{id}/_unmute_all', - options: { - tags: ['access:alerting-all'], - response: { - emptyStatusCode: 204, - }, +export const unmuteAllAlertRoute = { + method: 'POST', + path: '/api/alert/{id}/_unmute_all', + config: { + tags: ['access:alerting-all'], + response: { + emptyStatusCode: 204, }, - async handler(request: UnmuteAllRequest, h: Hapi.ResponseToolkit) { - const alertsClient = request.getAlertsClient!(); - await alertsClient.unmuteAll(request.params); - return h.response(); - }, - }); -} + }, + async handler(request: UnmuteAllRequest, h: Hapi.ResponseToolkit) { + const alertsClient = request.getAlertsClient!(); + await alertsClient.unmuteAll(request.params); + return h.response(); + }, +}; diff --git a/x-pack/legacy/plugins/alerting/server/routes/unmute_instance.test.ts b/x-pack/legacy/plugins/alerting/server/routes/unmute_instance.test.ts index 002cfdd3d8051..5c8f23236e2b0 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/unmute_instance.test.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/unmute_instance.test.ts @@ -8,7 +8,7 @@ import { createMockServer } from './_mock_server'; import { unmuteAlertInstanceRoute } from './unmute_instance'; const { server, alertsClient } = createMockServer(); -unmuteAlertInstanceRoute(server); +server.route(unmuteAlertInstanceRoute); test('unmutes an alert instance', async () => { const request = { diff --git a/x-pack/legacy/plugins/alerting/server/routes/unmute_instance.ts b/x-pack/legacy/plugins/alerting/server/routes/unmute_instance.ts index 2adc847d02629..1d1145e010741 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/unmute_instance.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/unmute_instance.ts @@ -13,20 +13,18 @@ interface UnmuteInstanceRequest extends Hapi.Request { }; } -export function unmuteAlertInstanceRoute(server: Hapi.Server) { - server.route({ - method: 'POST', - path: '/api/alert/{alertId}/alert_instance/{alertInstanceId}/_unmute', - options: { - tags: ['access:alerting-all'], - response: { - emptyStatusCode: 204, - }, +export const unmuteAlertInstanceRoute = { + method: 'POST', + path: '/api/alert/{alertId}/alert_instance/{alertInstanceId}/_unmute', + config: { + tags: ['access:alerting-all'], + response: { + emptyStatusCode: 204, }, - async handler(request: UnmuteInstanceRequest, h: Hapi.ResponseToolkit) { - const alertsClient = request.getAlertsClient!(); - await alertsClient.unmuteInstance(request.params); - return h.response(); - }, - }); -} + }, + async handler(request: UnmuteInstanceRequest, h: Hapi.ResponseToolkit) { + const alertsClient = request.getAlertsClient!(); + await alertsClient.unmuteInstance(request.params); + return h.response(); + }, +}; diff --git a/x-pack/legacy/plugins/alerting/server/routes/update.test.ts b/x-pack/legacy/plugins/alerting/server/routes/update.test.ts index d4e25fc6f11e3..9e4f18fa1b40d 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/update.test.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/update.test.ts @@ -8,7 +8,7 @@ import { createMockServer } from './_mock_server'; import { updateAlertRoute } from './update'; const { server, alertsClient } = createMockServer(); -updateAlertRoute(server); +server.route(updateAlertRoute); beforeEach(() => jest.resetAllMocks()); diff --git a/x-pack/legacy/plugins/alerting/server/routes/update.ts b/x-pack/legacy/plugins/alerting/server/routes/update.ts index fc4d89fc6648a..2b95b7bc34054 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/update.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/update.ts @@ -22,40 +22,38 @@ interface UpdateRequest extends Hapi.Request { }; } -export function updateAlertRoute(server: Hapi.Server) { - server.route({ - method: 'PUT', - path: '/api/alert/{id}', - options: { - tags: ['access:alerting-all'], - validate: { - options: { - abortEarly: false, - }, - payload: Joi.object() - .keys({ - throttle: getDurationSchema() - .required() - .allow(null), - interval: getDurationSchema().required(), - alertTypeParams: Joi.object().required(), - actions: Joi.array() - .items( - Joi.object().keys({ - group: Joi.string().required(), - id: Joi.string().required(), - params: Joi.object().required(), - }) - ) - .required(), - }) - .required(), +export const updateAlertRoute = { + method: 'PUT', + path: '/api/alert/{id}', + options: { + tags: ['access:alerting-all'], + validate: { + options: { + abortEarly: false, }, + payload: Joi.object() + .keys({ + throttle: getDurationSchema() + .required() + .allow(null), + interval: getDurationSchema().required(), + alertTypeParams: Joi.object().required(), + actions: Joi.array() + .items( + Joi.object().keys({ + group: Joi.string().required(), + id: Joi.string().required(), + params: Joi.object().required(), + }) + ) + .required(), + }) + .required(), }, - async handler(request: UpdateRequest) { - const { id } = request.params; - const alertsClient = request.getAlertsClient!(); - return await alertsClient.update({ id, data: request.payload }); - }, - }); -} + }, + async handler(request: UpdateRequest) { + const { id } = request.params; + const alertsClient = request.getAlertsClient!(); + return await alertsClient.update({ id, data: request.payload }); + }, +}; diff --git a/x-pack/legacy/plugins/alerting/server/routes/update_api_key.test.ts b/x-pack/legacy/plugins/alerting/server/routes/update_api_key.test.ts index 428a9be93f57b..9bfe26d56dabf 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/update_api_key.test.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/update_api_key.test.ts @@ -8,7 +8,7 @@ import { createMockServer } from './_mock_server'; import { updateApiKeyRoute } from './update_api_key'; const { server, alertsClient } = createMockServer(); -updateApiKeyRoute(server); +server.route(updateApiKeyRoute); test('updates api key for an alert', async () => { const request = { diff --git a/x-pack/legacy/plugins/alerting/server/routes/update_api_key.ts b/x-pack/legacy/plugins/alerting/server/routes/update_api_key.ts index 7841baf92b42e..754ea453a27cb 100644 --- a/x-pack/legacy/plugins/alerting/server/routes/update_api_key.ts +++ b/x-pack/legacy/plugins/alerting/server/routes/update_api_key.ts @@ -6,20 +6,18 @@ import Hapi from 'hapi'; -export function updateApiKeyRoute(server: Hapi.Server) { - server.route({ - method: 'POST', - path: '/api/alert/{id}/_update_api_key', - options: { - tags: ['access:alerting-all'], - response: { - emptyStatusCode: 204, - }, +export const updateApiKeyRoute = { + method: 'POST', + path: '/api/alert/{id}/_update_api_key', + config: { + tags: ['access:alerting-all'], + response: { + emptyStatusCode: 204, }, - async handler(request: Hapi.Request, h: Hapi.ResponseToolkit) { - const alertsClient = request.getAlertsClient!(); - await alertsClient.updateApiKey({ id: request.params.id }); - return h.response(); - }, - }); -} + }, + async handler(request: Hapi.Request, h: Hapi.ResponseToolkit) { + const alertsClient = request.getAlertsClient!(); + await alertsClient.updateApiKey({ id: request.params.id }); + return h.response(); + }, +}; diff --git a/x-pack/legacy/plugins/alerting/server/shim.ts b/x-pack/legacy/plugins/alerting/server/shim.ts new file mode 100644 index 0000000000000..eb21181e0b3a7 --- /dev/null +++ b/x-pack/legacy/plugins/alerting/server/shim.ts @@ -0,0 +1,143 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import Hapi from 'hapi'; +import { Legacy } from 'kibana'; +import { SpacesPlugin as SpacesPluginStartContract } from '../../spaces'; +import { ActionsPlugin } from '../../actions'; +import { TaskManager } from '../../task_manager'; +import { XPackMainPlugin } from '../../xpack_main/xpack_main'; +import KbnServer from '../../../../../src/legacy/server/kbn_server'; +import { EncryptedSavedObjectsPlugin } from '../../encrypted_saved_objects'; +import { PluginSetupContract as SecurityPlugin } from '../../../../plugins/security/server'; +import { + CoreSetup, + LoggerFactory, + SavedObjectsLegacyService, +} from '../../../../../src/core/server'; + +// Extend PluginProperties to indicate which plugins are guaranteed to exist +// due to being marked as dependencies +interface Plugins extends Hapi.PluginProperties { + actions: ActionsPlugin; + task_manager: TaskManager; + encrypted_saved_objects: EncryptedSavedObjectsPlugin; +} + +export interface Server extends Legacy.Server { + plugins: Plugins; +} + +/** + * Shim what we're thinking setup and start contracts will look like + */ +export type ActionsPluginSetupContract = Pick; +export type ActionsPluginStartContract = Pick; +export type TaskManagerStartContract = Pick; +export type SecurityPluginSetupContract = Pick; +export type SecurityPluginStartContract = Pick; +export type EncryptedSavedObjectsSetupContract = Pick; +export type XPackMainPluginSetupContract = Pick; +export type TaskManagerSetupContract = Pick< + TaskManager, + 'addMiddleware' | 'registerTaskDefinitions' +>; +export type EncryptedSavedObjectsStartContract = Pick< + EncryptedSavedObjectsPlugin, + 'isEncryptionError' | 'getDecryptedAsInternalUser' +>; + +/** + * New platform interfaces + */ +export interface AlertingPluginInitializerContext { + logger: LoggerFactory; +} +export interface AlertingCoreSetup { + elasticsearch: CoreSetup['elasticsearch']; + http: { + route: (route: Hapi.ServerRoute) => void; + basePath: { + serverBasePath: string; + }; + }; +} +export interface AlertingCoreStart { + savedObjects: SavedObjectsLegacyService; +} +export interface AlertingPluginsSetup { + security?: SecurityPluginSetupContract; + task_manager: TaskManagerSetupContract; + actions: ActionsPluginSetupContract; + xpack_main: XPackMainPluginSetupContract; + encrypted_saved_objects: EncryptedSavedObjectsSetupContract; +} +export interface AlertingPluginsStart { + actions: ActionsPluginStartContract; + security?: SecurityPluginStartContract; + spaces: () => SpacesPluginStartContract | undefined; + encrypted_saved_objects: EncryptedSavedObjectsStartContract; + task_manager: TaskManagerStartContract; +} + +/** + * Shim + * + * @param server Hapi server instance + */ +export function shim( + server: Server +): { + initializerContext: AlertingPluginInitializerContext; + coreSetup: AlertingCoreSetup; + coreStart: AlertingCoreStart; + pluginsSetup: AlertingPluginsSetup; + pluginsStart: AlertingPluginsStart; +} { + const newPlatform = ((server as unknown) as KbnServer).newPlatform; + + const initializerContext: AlertingPluginInitializerContext = { + logger: newPlatform.coreContext.logger, + }; + + const coreSetup: AlertingCoreSetup = { + elasticsearch: newPlatform.setup.core.elasticsearch, + http: { + route: server.route.bind(server), + basePath: newPlatform.setup.core.http.basePath, + }, + }; + + const coreStart: AlertingCoreStart = { + savedObjects: server.savedObjects, + }; + + const pluginsSetup: AlertingPluginsSetup = { + security: newPlatform.setup.plugins.security as SecurityPluginSetupContract | undefined, + task_manager: server.plugins.task_manager, + actions: server.plugins.actions, + xpack_main: server.plugins.xpack_main, + encrypted_saved_objects: server.plugins.encrypted_saved_objects, + }; + + const pluginsStart: AlertingPluginsStart = { + security: newPlatform.setup.plugins.security as SecurityPluginStartContract | undefined, + actions: server.plugins.actions, + // TODO: Currently a function because it's an optional dependency that + // initializes after this function is called + spaces: () => server.plugins.spaces, + encrypted_saved_objects: server.plugins.encrypted_saved_objects, + task_manager: server.plugins.task_manager, + }; + + return { + initializerContext, + coreSetup, + coreStart, + pluginsSetup, + pluginsStart, + }; +} diff --git a/x-pack/legacy/plugins/alerting/server/types.ts b/x-pack/legacy/plugins/alerting/server/types.ts index 723436c4f1c70..4bc6be160f0e9 100644 --- a/x-pack/legacy/plugins/alerting/server/types.ts +++ b/x-pack/legacy/plugins/alerting/server/types.ts @@ -4,9 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SavedObjectAttributes, SavedObjectsClientContract } from 'src/core/server'; import { AlertInstance } from './lib'; import { AlertTypeRegistry } from './alert_type_registry'; +import { PluginSetupContract, PluginStartContract } from './plugin'; +import { SavedObjectAttributes, SavedObjectsClientContract } from '../../../../../src/core/server'; export type State = Record; export type Context = Record; @@ -15,14 +16,7 @@ export type GetServicesFunction = (request: any) => Services; export type GetBasePathFunction = (spaceId?: string) => string; export type SpaceIdToNamespaceFunction = (spaceId?: string) => string | undefined; -export type Log = ( - tags: string | string[], - data?: string | object | (() => any), - timestamp?: number -) => void; - export interface Services { - log: Log; callCluster(path: string, opts: any): Promise; savedObjectsClient: SavedObjectsClientContract; } @@ -96,8 +90,8 @@ export interface RawAlert extends SavedObjectAttributes { } export interface AlertingPlugin { - registerType: AlertTypeRegistry['register']; - listTypes: AlertTypeRegistry['list']; + setup: PluginSetupContract; + start: PluginStartContract; } export type AlertTypeRegistry = PublicMethodsOf; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/ui.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/ui.ts index 7082bba3b6b2a..776b0738a1625 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/ui.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/ui.ts @@ -35,25 +35,25 @@ export const ArgumentStrings = { i18n.translate('xpack.canvas.uis.arguments.axisConfigLabel', { defaultMessage: 'Visualization axis configuration', }), + getPositionBottom: () => + i18n.translate('xpack.canvas.uis.arguments.axisConfig.position.options.bottomDropDown', { + defaultMessage: 'bottom', + }), getPositionLabel: () => i18n.translate('xpack.canvas.uis.arguments.axisConfig.positionLabel', { defaultMessage: 'Position', }), - getPositionTop: () => - i18n.translate('xpack.canvas.uis.arguments.axisConfig.position.options.topDropDown', { - defaultMessage: 'top', - }), - getPositionBottom: () => - i18n.translate('xpack.canvas.uis.arguments.axisConfig.position.options.bottomDropDown', { - defaultMessage: 'bottom', + getPositionLeft: () => + i18n.translate('xpack.canvas.uis.arguments.axisConfig.position.options.leftDropDown', { + defaultMessage: 'left', }), getPositionRight: () => i18n.translate('xpack.canvas.uis.arguments.axisConfig.position.options.rightDropDown', { defaultMessage: 'right', }), - getPositionLeft: () => - i18n.translate('xpack.canvas.uis.arguments.axisConfig.position.options.leftDropDown', { - defaultMessage: 'left', + getPositionTop: () => + i18n.translate('xpack.canvas.uis.arguments.axisConfig.position.options.topDropDown', { + defaultMessage: 'top', }), }, DataColumn: { @@ -120,6 +120,10 @@ export const ArgumentStrings = { }), }, FilterGroup: { + getCreateNewGroup: () => + i18n.translate('xpack.canvas.uis.arguments.filterGroup.createNewGroupLinkText', { + defaultMessage: 'Create new group', + }), getDisplayName: () => i18n.translate('xpack.canvas.uis.arguments.filterGroupTitle', { defaultMessage: 'Filter Group', @@ -128,16 +132,24 @@ export const ArgumentStrings = { i18n.translate('xpack.canvas.uis.arguments.filterGroupLabel', { defaultMessage: 'Create or select a filter group', }), - getCreateNewGroup: () => - i18n.translate('xpack.canvas.uis.arguments.filterGroup.createNewGroupLinkText', { - defaultMessage: 'Create new group', - }), }, ImageUpload: { + getAssetUrlType: () => + i18n.translate('xpack.canvas.uis.arguments.imageUpload.urlTypes.assetDropDown', { + defaultMessage: 'Asset', + }), getDisplayName: () => i18n.translate('xpack.canvas.uis.arguments.imageUploadTitle', { defaultMessage: 'Image upload', }), + getFileUploadPrompt: () => + i18n.translate('xpack.canvas.uis.arguments.imageUpload.fileUploadPromptLabel', { + defaultMessage: 'Select or drag and drop an image', + }), + getFileUrlType: () => + i18n.translate('xpack.canvas.uis.arguments.imageUpload.urlTypes.fileDropDown', { + defaultMessage: 'Import', + }), getHelp: () => i18n.translate('xpack.canvas.uis.arguments.imageUploadLabel', { defaultMessage: 'Select or upload an image', @@ -146,9 +158,9 @@ export const ArgumentStrings = { i18n.translate('xpack.canvas.uis.arguments.imageUpload.imageUploadingLabel', { defaultMessage: 'Image uploading', }), - getFileUploadPrompt: () => - i18n.translate('xpack.canvas.uis.arguments.imageUpload.fileUploadPromptLabel', { - defaultMessage: 'Select or drag and drop an image', + getLinkUrlType: () => + i18n.translate('xpack.canvas.uis.arguments.imageUpload.urlTypes.linkDropDown', { + defaultMessage: 'Link', }), getUrlFieldPlaceholder: () => i18n.translate('xpack.canvas.uis.arguments.imageUpload.urlFieldPlaceholder', { @@ -157,18 +169,6 @@ export const ArgumentStrings = { url: URL, }, }), - getFileUrlType: () => - i18n.translate('xpack.canvas.uis.arguments.imageUpload.urlTypes.fileDropDown', { - defaultMessage: 'Import', - }), - getLinkUrlType: () => - i18n.translate('xpack.canvas.uis.arguments.imageUpload.urlTypes.linkDropDown', { - defaultMessage: 'Link', - }), - getAssetUrlType: () => - i18n.translate('xpack.canvas.uis.arguments.imageUpload.urlTypes.assetDropDown', { - defaultMessage: 'Asset', - }), }, Number: { getDisplayName: () => @@ -185,20 +185,9 @@ export const ArgumentStrings = { i18n.translate('xpack.canvas.uis.arguments.numberFormatTitle', { defaultMessage: 'Number Format', }), - getHelp: () => - i18n.translate('xpack.canvas.uis.arguments.numberFormatLabel', { - defaultMessage: 'Select or enter a valid {numeralJS} format', - values: { - numeralJS: NUMERALJS, - }, - }), - getFormatNumber: () => - i18n.translate('xpack.canvas.uis.arguments.numberFormat.format.numberDropDown', { - defaultMessage: 'Number', - }), - getFormatPercent: () => - i18n.translate('xpack.canvas.uis.arguments.numberFormat.format.percentDropDown', { - defaultMessage: 'Percent', + getFormatBytes: () => + i18n.translate('xpack.canvas.uis.arguments.numberFormat.format.bytesDropDown', { + defaultMessage: 'Bytes', }), getFormatCurrency: () => i18n.translate('xpack.canvas.uis.arguments.numberFormat.format.currencyDropDown', { @@ -208,9 +197,20 @@ export const ArgumentStrings = { i18n.translate('xpack.canvas.uis.arguments.numberFormat.format.durationDropDown', { defaultMessage: 'Duration', }), - getFormatBytes: () => - i18n.translate('xpack.canvas.uis.arguments.numberFormat.format.bytesDropDown', { - defaultMessage: 'Bytes', + getFormatNumber: () => + i18n.translate('xpack.canvas.uis.arguments.numberFormat.format.numberDropDown', { + defaultMessage: 'Number', + }), + getFormatPercent: () => + i18n.translate('xpack.canvas.uis.arguments.numberFormat.format.percentDropDown', { + defaultMessage: 'Percent', + }), + getHelp: () => + i18n.translate('xpack.canvas.uis.arguments.numberFormatLabel', { + defaultMessage: 'Select or enter a valid {numeralJS} format', + values: { + numeralJS: NUMERALJS, + }, }), }, Palette: { @@ -301,14 +301,14 @@ export const DataSourceStrings = { i18n.translate('xpack.canvas.uis.dataSources.demoDataTitle', { defaultMessage: 'Demo data', }), - getHelp: () => - i18n.translate('xpack.canvas.uis.dataSources.demoDataLabel', { - defaultMessage: 'Mock data set with usernames, prices, projects, countries, and phases', - }), getHeading: () => i18n.translate('xpack.canvas.uis.dataSources.demoData.headingTitle', { defaultMessage: 'You are using demo data', }), + getHelp: () => + i18n.translate('xpack.canvas.uis.dataSources.demoDataLabel', { + defaultMessage: 'Mock data set with usernames, prices, projects, countries, and phases', + }), }, Essql: { getDisplayName: () => @@ -337,13 +337,6 @@ export const DataSourceStrings = { }), }, Timelion: { - getHelp: () => - i18n.translate('xpack.canvas.uis.dataSources.timelionLabel', { - defaultMessage: 'Use {timelion} syntax to retrieve a timeseries', - values: { - timelion: TIMELION, - }, - }), getAbout: () => i18n.translate('xpack.canvas.uis.dataSources.timelion.aboutDetail', { defaultMessage: @@ -354,21 +347,13 @@ export const DataSourceStrings = { canvas: CANVAS, }, }), - getQueryLabel: () => - i18n.translate('xpack.canvas.uis.dataSources.timelion.queryTitle', { - defaultMessage: 'Query', - }), - getQueryHelp: () => - i18n.translate('xpack.canvas.uis.dataSources.timelion.queryLabel', { - defaultMessage: '{lucene} Query String syntax', + getHelp: () => + i18n.translate('xpack.canvas.uis.dataSources.timelionLabel', { + defaultMessage: 'Use {timelion} syntax to retrieve a timeseries', values: { - lucene: LUCENE, + timelion: TIMELION, }, }), - getIntervalLabel: () => - i18n.translate('xpack.canvas.uis.dataSources.timelion.intervalTitle', { - defaultMessage: 'Interval', - }), getIntervalHelp: () => i18n.translate('xpack.canvas.uis.dataSources.timelion.intervalLabel', { defaultMessage: @@ -381,6 +366,21 @@ export const DataSourceStrings = { auto: 'auto', }, }), + getIntervalLabel: () => + i18n.translate('xpack.canvas.uis.dataSources.timelion.intervalTitle', { + defaultMessage: 'Interval', + }), + getQueryHelp: () => + i18n.translate('xpack.canvas.uis.dataSources.timelion.queryLabel', { + defaultMessage: '{lucene} Query String syntax', + values: { + lucene: LUCENE, + }, + }), + getQueryLabel: () => + i18n.translate('xpack.canvas.uis.dataSources.timelion.queryTitle', { + defaultMessage: 'Query', + }), getTipsHeading: () => i18n.translate('xpack.canvas.uis.dataSources.timelion.tipsTitle', { defaultMessage: 'Some tips', @@ -390,26 +390,6 @@ export const DataSourceStrings = { export const ModelStrings = { PointSeries: { - getDisplayName: () => - i18n.translate('xpack.canvas.uis.models.pointSeriesTitle', { - defaultMessage: 'Dimensions & measures', - }), - getXAxisDisplayName: () => - i18n.translate('xpack.canvas.uis.models.pointSeries.args.xaxisTitle', { - defaultMessage: 'X-axis', - }), - getXAxisHelp: () => - i18n.translate('xpack.canvas.uis.models.pointSeries.args.xaxisLabel', { - defaultMessage: 'Data along the horizontal axis. Usually a number, string or date', - }), - getYaxisDisplayName: () => - i18n.translate('xpack.canvas.uis.models.pointSeries.args.yaxisTitle', { - defaultMessage: 'Y-axis', - }), - getYaxisHelp: () => - i18n.translate('xpack.canvas.uis.models.pointSeries.args.yaxisLabel', { - defaultMessage: 'Data along the vertical axis. Usually a number', - }), getColorDisplayName: () => i18n.translate('xpack.canvas.uis.models.pointSeries.args.colorTitle', { defaultMessage: 'Color', @@ -418,6 +398,10 @@ export const ModelStrings = { i18n.translate('xpack.canvas.uis.models.pointSeries.args.colorLabel', { defaultMessage: 'Determines the color of a mark or series', }), + getDisplayName: () => + i18n.translate('xpack.canvas.uis.models.pointSeriesTitle', { + defaultMessage: 'Dimensions & measures', + }), getSizeDisplayName: () => i18n.translate('xpack.canvas.uis.models.pointSeries.args.sizeTitle', { defaultMessage: 'Size', @@ -434,6 +418,22 @@ export const ModelStrings = { i18n.translate('xpack.canvas.uis.models.pointSeries.args.textLabel', { defaultMessage: 'Set the text to use as, or around, the mark', }), + getXAxisDisplayName: () => + i18n.translate('xpack.canvas.uis.models.pointSeries.args.xaxisTitle', { + defaultMessage: 'X-axis', + }), + getXAxisHelp: () => + i18n.translate('xpack.canvas.uis.models.pointSeries.args.xaxisLabel', { + defaultMessage: 'Data along the horizontal axis. Usually a number, string or date', + }), + getYaxisDisplayName: () => + i18n.translate('xpack.canvas.uis.models.pointSeries.args.yaxisTitle', { + defaultMessage: 'Y-axis', + }), + getYaxisHelp: () => + i18n.translate('xpack.canvas.uis.models.pointSeries.args.yaxisLabel', { + defaultMessage: 'Data along the vertical axis. Usually a number', + }), }, }; @@ -480,14 +480,14 @@ export const TransformStrings = { i18n.translate('xpack.canvas.uis.transforms.sortTitle', { defaultMessage: 'Datatable sorting', }), - getSortFieldDisplayName: () => - i18n.translate('xpack.canvas.uis.transforms.sort.args.sortFieldTitle', { - defaultMessage: 'Sort field', - }), getReverseDisplayName: () => i18n.translate('xpack.canvas.uis.transforms.sort.args.reverseToggleSwitch', { defaultMessage: 'Descending', }), + getSortFieldDisplayName: () => + i18n.translate('xpack.canvas.uis.transforms.sort.args.sortFieldTitle', { + defaultMessage: 'Sort field', + }), }, }; @@ -497,22 +497,10 @@ export const ViewStrings = { i18n.translate('xpack.canvas.uis.views.dropdownControlTitle', { defaultMessage: 'Dropdown filter', }), - getValueDisplayName: () => - i18n.translate('xpack.canvas.uis.views.dropdownControl.args.valueColumnTitle', { - defaultMessage: 'Values column', - }), - getValueHelp: () => - i18n.translate('xpack.canvas.uis.views.dropdownControl.args.valueColumnLabel', { - defaultMessage: 'Column from which to extract values to make available in the dropdown', - }), getFilterDisplayName: () => i18n.translate('xpack.canvas.uis.views.dropdownControl.args.filterColumnTitle', { defaultMessage: 'Filter column', }), - getFilterHelp: () => - i18n.translate('xpack.canvas.uis.views.dropdownControl.args.filterColumnLabel', { - defaultMessage: 'Column to which the value selected from the dropdown is applied', - }), getFilterGroupDisplayName: () => i18n.translate('xpack.canvas.uis.views.dropdownControl.args.filterGroupTitle', { defaultMessage: 'Filter group', @@ -522,6 +510,18 @@ export const ViewStrings = { defaultMessage: "Apply the selected group name to an element's filters function to target this filter", }), + getFilterHelp: () => + i18n.translate('xpack.canvas.uis.views.dropdownControl.args.filterColumnLabel', { + defaultMessage: 'Column to which the value selected from the dropdown is applied', + }), + getValueDisplayName: () => + i18n.translate('xpack.canvas.uis.views.dropdownControl.args.valueColumnTitle', { + defaultMessage: 'Values column', + }), + getValueHelp: () => + i18n.translate('xpack.canvas.uis.views.dropdownControl.args.valueColumnLabel', { + defaultMessage: 'Column from which to extract values to make available in the dropdown', + }), }, GetCell: { getDisplayName: () => @@ -534,6 +534,14 @@ export const ViewStrings = { }), }, Image: { + getContainMode: () => + i18n.translate('xpack.canvas.uis.views.image.args.mode.containDropDown', { + defaultMessage: 'Contain', + }), + getCoverMode: () => + i18n.translate('xpack.canvas.uis.views.image.args.mode.coverDropDown', { + defaultMessage: 'Cover', + }), getDisplayName: () => i18n.translate('xpack.canvas.uis.views.imageTitle', { defaultMessage: 'Image', @@ -546,44 +554,36 @@ export const ViewStrings = { i18n.translate('xpack.canvas.uis.views.image.args.modeLabel', { defaultMessage: 'Note: Stretched fill may not work with vector images', }), - getContainMode: () => - i18n.translate('xpack.canvas.uis.views.image.args.mode.containDropDown', { - defaultMessage: 'Contain', - }), - getCoverMode: () => - i18n.translate('xpack.canvas.uis.views.image.args.mode.coverDropDown', { - defaultMessage: 'Cover', - }), getStretchMode: () => i18n.translate('xpack.canvas.uis.views.image.args.mode.stretchDropDown', { defaultMessage: 'Stretch', }), }, Markdown: { - getDisplayName: () => - i18n.translate('xpack.canvas.uis.views.markdownTitle', { - defaultMessage: '{markdown}', + getContentDisplayName: () => + i18n.translate('xpack.canvas.uis.views.markdown.args.contentTitle', { + defaultMessage: '{markdown} content', values: { markdown: MARKDOWN, }, }), - getHelp: () => - i18n.translate('xpack.canvas.uis.views.markdownLabel', { - defaultMessage: 'Generate markup using {markdown}', + getContentHelp: () => + i18n.translate('xpack.canvas.uis.views.markdown.args.contentLabel', { + defaultMessage: '{markdown} formatted text', values: { markdown: MARKDOWN, }, }), - getContentDisplayName: () => - i18n.translate('xpack.canvas.uis.views.markdown.args.contentTitle', { - defaultMessage: '{markdown} content', + getDisplayName: () => + i18n.translate('xpack.canvas.uis.views.markdownTitle', { + defaultMessage: '{markdown}', values: { markdown: MARKDOWN, }, }), - getContentHelp: () => - i18n.translate('xpack.canvas.uis.views.markdown.args.contentLabel', { - defaultMessage: '{markdown} formatted text', + getHelp: () => + i18n.translate('xpack.canvas.uis.views.markdownLabel', { + defaultMessage: 'Generate markup using {markdown}', values: { markdown: MARKDOWN, }, @@ -598,10 +598,6 @@ export const ViewStrings = { i18n.translate('xpack.canvas.uis.views.metric.args.labelArgTitle', { defaultMessage: 'Label', }), - getLabelHelp: () => - i18n.translate('xpack.canvas.uis.views.metric.args.labelArgLabel', { - defaultMessage: 'Describes the metric', - }), getLabelFontDisplayName: () => i18n.translate('xpack.canvas.uis.views.metric.args.labelFontTitle', { defaultMessage: 'Label text settings', @@ -610,6 +606,10 @@ export const ViewStrings = { i18n.translate('xpack.canvas.uis.views.metric.args.labelFontLabel', { defaultMessage: 'Fonts, alignment and color', }), + getLabelHelp: () => + i18n.translate('xpack.canvas.uis.views.metric.args.labelArgLabel', { + defaultMessage: 'Describes the metric', + }), getMetricFontDisplayName: () => i18n.translate('xpack.canvas.uis.views.metric.args.metricFontTitle', { defaultMessage: 'Metric text settings', @@ -640,14 +640,6 @@ export const ViewStrings = { i18n.translate('xpack.canvas.uis.views.pie.args.holeLabel', { defaultMessage: 'Radius of the hole', }), - getLabelsDisplayName: () => - i18n.translate('xpack.canvas.uis.views.pie.args.labelsTitle', { - defaultMessage: 'Labels', - }), - getLabelsHelp: () => - i18n.translate('xpack.canvas.uis.views.pie.args.labelsToggleSwitch', { - defaultMessage: 'Show/hide labels', - }), getLabelRadiusDisplayName: () => i18n.translate('xpack.canvas.uis.views.pie.args.labelRadiusTitle', { defaultMessage: 'Label radius', @@ -656,6 +648,14 @@ export const ViewStrings = { i18n.translate('xpack.canvas.uis.views.pie.args.labelRadiusLabel', { defaultMessage: 'Distance of the labels from the center of the pie', }), + getLabelsDisplayName: () => + i18n.translate('xpack.canvas.uis.views.pie.args.labelsTitle', { + defaultMessage: 'Labels', + }), + getLabelsHelp: () => + i18n.translate('xpack.canvas.uis.views.pie.args.labelsToggleSwitch', { + defaultMessage: 'Show/hide labels', + }), getLegendDisplayName: () => i18n.translate('xpack.canvas.uis.views.pie.args.legendTitle', { defaultMessage: 'Legend position', @@ -682,6 +682,14 @@ export const ViewStrings = { }), }, Plot: { + getDefaultStyleDisplayName: () => + i18n.translate('xpack.canvas.uis.views.plot.args.defaultStyleTitle', { + defaultMessage: 'Default style', + }), + getDefaultStyleHelp: () => + i18n.translate('xpack.canvas.uis.views.plot.args.defaultStyleLabel', { + defaultMessage: 'Set the style to be used by default by every series, unless overridden', + }), getDisplayName: () => i18n.translate('xpack.canvas.uis.views.plotTitle', { defaultMessage: 'Chart style', @@ -710,27 +718,48 @@ export const ViewStrings = { i18n.translate('xpack.canvas.uis.views.plot.args.yaxisLabel', { defaultMessage: 'Configure or disable the Y-axis', }), - getDefaultStyleDisplayName: () => - i18n.translate('xpack.canvas.uis.views.plot.args.defaultStyleTitle', { - defaultMessage: 'Default style', - }), - getDefaultStyleHelp: () => - i18n.translate('xpack.canvas.uis.views.plot.args.defaultStyleLabel', { - defaultMessage: 'Set the style to be used by default by every series, unless overridden', - }), }, Progress: { + getBarColorDisplayName: () => + i18n.translate('xpack.canvas.uis.views.progress.args.barColorTitle', { + defaultMessage: 'Background color', + }), + getBarColorHelp: () => + i18n.translate('xpack.canvas.uis.views.progress.args.barColorLabel', { + defaultMessage: 'Accepts HEX, RGB or HTML Color names', + }), + getBarWeightDisplayName: () => + i18n.translate('xpack.canvas.uis.views.progress.args.barWeightTitle', { + defaultMessage: 'Background weight', + }), + getBarWeightHelp: () => + i18n.translate('xpack.canvas.uis.views.progress.args.barWeightLabel', { + defaultMessage: 'Thickness of the background bar', + }), getDisplayName: () => i18n.translate('xpack.canvas.uis.views.progressTitle', { defaultMessage: 'Progress', }), - getShapeDisplayName: () => - i18n.translate('xpack.canvas.uis.views.progress.args.shapeTitle', { - defaultMessage: 'Shape', + getFontDisplayName: () => + i18n.translate('xpack.canvas.uis.views.progress.args.fontTitle', { + defaultMessage: 'Label settings', }), - getShapeHelp: () => - i18n.translate('xpack.canvas.uis.views.progress.args.shapeLabel', { - defaultMessage: 'Shape of the progress indicator', + getFontHelp: () => + i18n.translate('xpack.canvas.uis.views.progress.args.fontLabel', { + defaultMessage: + 'Font settings for the label. Technically, you can add other styles as well', + }), + getLabelDisplayName: () => + i18n.translate('xpack.canvas.uis.views.progress.args.labelArgTitle', { + defaultMessage: 'Label', + }), + getLabelHelp: () => + i18n.translate('xpack.canvas.uis.views.progress.args.labelArgLabel', { + defaultMessage: `Set {true}/{false} to show/hide label or provide a string to display as the label`, + values: { + true: BOOLEAN_TRUE, + false: BOOLEAN_FALSE, + }, }), getMaxDisplayName: () => i18n.translate('xpack.canvas.uis.views.progress.args.maxTitle', { @@ -740,6 +769,14 @@ export const ViewStrings = { i18n.translate('xpack.canvas.uis.views.progress.args.maxLabel', { defaultMessage: 'Maximum value of the progress element', }), + getShapeDisplayName: () => + i18n.translate('xpack.canvas.uis.views.progress.args.shapeTitle', { + defaultMessage: 'Shape', + }), + getShapeHelp: () => + i18n.translate('xpack.canvas.uis.views.progress.args.shapeLabel', { + defaultMessage: 'Shape of the progress indicator', + }), getValueColorDisplayName: () => i18n.translate('xpack.canvas.uis.views.progress.args.valueColorTitle', { defaultMessage: 'Progress color', @@ -761,45 +798,19 @@ export const ViewStrings = { i18n.translate('xpack.canvas.uis.views.progress.args.valueWeightLabel', { defaultMessage: 'Thickness of the progress bar', }), - getBarColorDisplayName: () => - i18n.translate('xpack.canvas.uis.views.progress.args.barColorTitle', { - defaultMessage: 'Background color', - }), - getBarColorHelp: () => - i18n.translate('xpack.canvas.uis.views.progress.args.barColorLabel', { - defaultMessage: 'Accepts HEX, RGB or HTML Color names', - }), - getBarWeightDisplayName: () => - i18n.translate('xpack.canvas.uis.views.progress.args.barWeightTitle', { - defaultMessage: 'Background weight', - }), - getBarWeightHelp: () => - i18n.translate('xpack.canvas.uis.views.progress.args.barWeightLabel', { - defaultMessage: 'Thickness of the background bar', - }), - getLabelDisplayName: () => - i18n.translate('xpack.canvas.uis.views.progress.args.labelArgTitle', { - defaultMessage: 'Label', + }, + Render: { + getCssApply: () => + i18n.translate('xpack.canvas.uis.views.render.args.css.applyButtonLabel', { + defaultMessage: 'Apply Stylesheet', }), - getLabelHelp: () => - i18n.translate('xpack.canvas.uis.views.progress.args.labelArgLabel', { - defaultMessage: `Set {true}/{false} to show/hide label or provide a string to display as the label`, + getCssHelp: () => + i18n.translate('xpack.canvas.uis.views.render.args.cssLabel', { + defaultMessage: 'A {css} stylesheet scoped to your element', values: { - true: BOOLEAN_TRUE, - false: BOOLEAN_FALSE, + css: CSS, }, }), - getFontDisplayName: () => - i18n.translate('xpack.canvas.uis.views.progress.args.fontTitle', { - defaultMessage: 'Label settings', - }), - getFontHelp: () => - i18n.translate('xpack.canvas.uis.views.progress.args.fontLabel', { - defaultMessage: - 'Font settings for the label. Technically, you can add other styles as well', - }), - }, - Render: { getDisplayName: () => i18n.translate('xpack.canvas.uis.views.renderTitle', { defaultMessage: 'Element style', @@ -808,23 +819,20 @@ export const ViewStrings = { i18n.translate('xpack.canvas.uis.views.renderLabel', { defaultMessage: 'Setting for the container around your element', }), - getCssHelp: () => - i18n.translate('xpack.canvas.uis.views.render.args.cssLabel', { - defaultMessage: 'A {css} stylesheet scoped to your element', - values: { - css: CSS, - }, - }), - getCssApply: () => - i18n.translate('xpack.canvas.uis.views.render.args.css.applyButtonLabel', { - defaultMessage: 'Apply Stylesheet', - }), }, RepeatImage: { getDisplayName: () => i18n.translate('xpack.canvas.uis.views.repeatImageTitle', { defaultMessage: 'Repeating image', }), + getEmptyImageDisplayName: () => + i18n.translate('xpack.canvas.uis.views.repeatImage.args.emptyImageTitle', { + defaultMessage: 'Empty image', + }), + getEmptyImageHelp: () => + i18n.translate('xpack.canvas.uis.views.repeatImage.args.emptyImageLabel', { + defaultMessage: 'An image to fill up the difference between the value and the max count', + }), getImageDisplayName: () => i18n.translate('xpack.canvas.uis.views.repeatImage.args.imageTitle', { defaultMessage: 'Image', @@ -833,13 +841,13 @@ export const ViewStrings = { i18n.translate('xpack.canvas.uis.views.repeatImage.args.imageLabel', { defaultMessage: 'An image to repeat', }), - getEmptyImageDisplayName: () => - i18n.translate('xpack.canvas.uis.views.repeatImage.args.emptyImageTitle', { - defaultMessage: 'Empty image', + getMaxDisplayName: () => + i18n.translate('xpack.canvas.uis.views.repeatImage.args.maxTitle', { + defaultMessage: 'Max count', }), - getEmptyImageHelp: () => - i18n.translate('xpack.canvas.uis.views.repeatImage.args.emptyImageLabel', { - defaultMessage: 'An image to fill up the difference between the value and the max count', + getMaxHelp: () => + i18n.translate('xpack.canvas.uis.views.repeatImage.args.maxLabel', { + defaultMessage: 'The maximum number of repeated images', }), getSizeDisplayName: () => i18n.translate('xpack.canvas.uis.views.repeatImage.args.sizeTitle', { @@ -850,20 +858,20 @@ export const ViewStrings = { defaultMessage: 'The size of the largest dimension of the image. Eg, if the image is tall but not wide, this is the height', }), - getMaxDisplayName: () => - i18n.translate('xpack.canvas.uis.views.repeatImage.args.maxTitle', { - defaultMessage: 'Max count', - }), - getMaxHelp: () => - i18n.translate('xpack.canvas.uis.views.repeatImage.args.maxLabel', { - defaultMessage: 'The maximum number of repeated images', - }), }, RevealImage: { getDisplayName: () => i18n.translate('xpack.canvas.uis.views.revealImageTitle', { defaultMessage: 'Reveal image', }), + getEmptyImageDisplayName: () => + i18n.translate('xpack.canvas.uis.views.revealImage.args.emptyImageTitle', { + defaultMessage: 'Background image', + }), + getEmptyImageHelp: () => + i18n.translate('xpack.canvas.uis.views.revealImage.args.emptyImageLabel', { + defaultMessage: 'A background image. Eg, an empty glass', + }), getImageDisplayName: () => i18n.translate('xpack.canvas.uis.views.revealImage.args.imageTitle', { defaultMessage: 'Image', @@ -872,13 +880,9 @@ export const ViewStrings = { i18n.translate('xpack.canvas.uis.views.revealImage.args.imageLabel', { defaultMessage: 'An image to reveal given the function input. Eg, a full glass', }), - getEmptyImageDisplayName: () => - i18n.translate('xpack.canvas.uis.views.revealImage.args.emptyImageTitle', { - defaultMessage: 'Background image', - }), - getEmptyImageHelp: () => - i18n.translate('xpack.canvas.uis.views.revealImage.args.emptyImageLabel', { - defaultMessage: 'A background image. Eg, an empty glass', + getOriginBottom: () => + i18n.translate('xpack.canvas.uis.views.revealImage.args.origin.bottomDropDown', { + defaultMessage: 'Bottom', }), getOriginDisplayName: () => i18n.translate('xpack.canvas.uis.views.revealImage.args.originTitle', { @@ -888,40 +892,20 @@ export const ViewStrings = { i18n.translate('xpack.canvas.uis.views.revealImage.args.originLabel', { defaultMessage: 'The direction from which to start the reveal', }), - getOriginTop: () => - i18n.translate('xpack.canvas.uis.views.revealImage.args.origin.topDropDown', { - defaultMessage: 'Top', - }), getOriginLeft: () => i18n.translate('xpack.canvas.uis.views.revealImage.args.origin.leftDropDown', { defaultMessage: 'Left', }), - getOriginBottom: () => - i18n.translate('xpack.canvas.uis.views.revealImage.args.origin.bottomDropDown', { - defaultMessage: 'Bottom', - }), getOriginRight: () => i18n.translate('xpack.canvas.uis.views.revealImage.args.origin.rightDropDown', { defaultMessage: 'Right', }), + getOriginTop: () => + i18n.translate('xpack.canvas.uis.views.revealImage.args.origin.topDropDown', { + defaultMessage: 'Top', + }), }, Shape: { - getDisplayName: () => - i18n.translate('xpack.canvas.uis.views.shapeTitle', { - defaultMessage: 'Shape', - }), - getShapeDisplayName: () => - i18n.translate('xpack.canvas.uis.views.shape.args.shapeTitle', { - defaultMessage: 'Select a shape', - }), - getFillDisplayName: () => - i18n.translate('xpack.canvas.uis.views.shape.args.fillTitle', { - defaultMessage: 'Fill', - }), - getFillHelp: () => - i18n.translate('xpack.canvas.uis.views.shape.args.fillLabel', { - defaultMessage: 'Accepts HEX, RGB or HTML Color names', - }), getBorderDisplayName: () => i18n.translate('xpack.canvas.uis.views.shape.args.borderTitle', { defaultMessage: 'Border', @@ -938,6 +922,18 @@ export const ViewStrings = { i18n.translate('xpack.canvas.uis.views.shape.args.borderWidthLabel', { defaultMessage: 'Border width', }), + getDisplayName: () => + i18n.translate('xpack.canvas.uis.views.shapeTitle', { + defaultMessage: 'Shape', + }), + getFillDisplayName: () => + i18n.translate('xpack.canvas.uis.views.shape.args.fillTitle', { + defaultMessage: 'Fill', + }), + getFillHelp: () => + i18n.translate('xpack.canvas.uis.views.shape.args.fillLabel', { + defaultMessage: 'Accepts HEX, RGB or HTML Color names', + }), getMaintainAspectDisplayName: () => i18n.translate('xpack.canvas.uis.views.shape.args.maintainAspectTitle', { defaultMessage: 'Maintain aspect ratio', @@ -949,6 +945,10 @@ export const ViewStrings = { true: BOOLEAN_TRUE, }, }), + getShapeDisplayName: () => + i18n.translate('xpack.canvas.uis.views.shape.args.shapeTitle', { + defaultMessage: 'Select a shape', + }), }, Table: { getDisplayName: () => @@ -986,9 +986,9 @@ export const ViewStrings = { }), }, Timefilter: { - getDisplayName: () => - i18n.translate('xpack.canvas.uis.views.timefilterTitle', { - defaultMessage: 'Time filter', + getColumnConfirm: () => + i18n.translate('xpack.canvas.uis.views.timefilter.args.columnConfirmButtonLabel', { + defaultMessage: 'Set', }), getColumnDisplayName: () => i18n.translate('xpack.canvas.uis.views.timefilter.args.columnTitle', { @@ -998,9 +998,9 @@ export const ViewStrings = { i18n.translate('xpack.canvas.uis.views.timefilter.args.columnLabel', { defaultMessage: 'Column to which selected time is applied', }), - getColumnConfirm: () => - i18n.translate('xpack.canvas.uis.views.timefilter.args.columnConfirmButtonLabel', { - defaultMessage: 'Set', + getDisplayName: () => + i18n.translate('xpack.canvas.uis.views.timefilterTitle', { + defaultMessage: 'Time filter', }), getFilterGroupDisplayName: () => i18n.translate('xpack.canvas.uis.views.timefilter.args.filterGroupTitle', { diff --git a/x-pack/legacy/plugins/canvas/i18n/components.ts b/x-pack/legacy/plugins/canvas/i18n/components.ts index b8f75a2f8c135..b5334974cb853 100644 --- a/x-pack/legacy/plugins/canvas/i18n/components.ts +++ b/x-pack/legacy/plugins/canvas/i18n/components.ts @@ -8,6 +8,16 @@ import { i18n } from '@kbn/i18n'; import { CANVAS, JSON, KIBANA, PDF, POST, URL } from './constants'; export const ComponentStrings = { + AddEmbeddableFlyout: { + getNoItemsText: () => + i18n.translate('xpack.canvas.embedObject.noMatchingObjectsMessage', { + defaultMessage: 'No matching objects found.', + }), + getTitleText: () => + i18n.translate('xpack.canvas.embedObject.titleText', { + defaultMessage: 'Embed Object', + }), + }, App: { getLoadErrorMessage: (error: string) => i18n.translate('xpack.canvas.app.loadErrorMessage', { @@ -25,16 +35,6 @@ export const ComponentStrings = { defaultMessage: 'Canvas is loading', }), }, - AddEmbeddableFlyout: { - getNoItemsText: () => - i18n.translate('xpack.canvas.embedObject.noMatchingObjectsMessage', { - defaultMessage: 'No matching objects found.', - }), - getTitleText: () => - i18n.translate('xpack.canvas.embedObject.titleText', { - defaultMessage: 'Embed Object', - }), - }, ArgAddPopover: { getAddAriaLabel: () => i18n.translate('xpack.canvas.argAddPopover.addAriaLabel', { @@ -46,14 +46,14 @@ export const ComponentStrings = { i18n.translate('xpack.canvas.argFormAdvancedFailure.applyButtonLabel', { defaultMessage: 'Apply', }), - getRowErrorMessage: () => - i18n.translate('xpack.canvas.argFormAdvancedFailure.rowErrorMessage', { - defaultMessage: 'Invalid Expression', - }), getResetButtonLabel: () => i18n.translate('xpack.canvas.argFormAdvancedFailure.resetButtonLabel', { defaultMessage: 'Reset', }), + getRowErrorMessage: () => + i18n.translate('xpack.canvas.argFormAdvancedFailure.rowErrorMessage', { + defaultMessage: 'Invalid Expression', + }), }, ArgFormArgSimpleForm: { getRemoveAriaLabel: () => @@ -196,15 +196,15 @@ export const ComponentStrings = { i18n.translate('xpack.canvas.customElementModal.imageFilePickerPlaceholder', { defaultMessage: 'Select or drag and drop an image', }), - getImageInputLabel: () => - i18n.translate('xpack.canvas.customElementModal.imageInputLabel', { - defaultMessage: 'Thumbnail image', - }), getImageInputDescription: () => i18n.translate('xpack.canvas.customElementModal.imageInputDescription', { defaultMessage: 'Take a screenshot of your element and upload it here. This can also be done after saving.', }), + getImageInputLabel: () => + i18n.translate('xpack.canvas.customElementModal.imageInputLabel', { + defaultMessage: 'Thumbnail image', + }), getNameInputLabel: () => i18n.translate('xpack.canvas.customElementModal.nameInputLabel', { defaultMessage: 'Name', @@ -228,17 +228,6 @@ export const ComponentStrings = { defaultMessage: 'Save', }), }, - DatasourceNoDatasource: { - getPanelDescription: () => - i18n.translate('xpack.canvas.datasourceNoDatasource.panelDescription', { - defaultMessage: - "This element does not have an attached data source. This is usually because the element is an image or other static asset. If that's not the case you might want to check your expression to make sure it is not malformed.", - }), - getPanelTitle: () => - i18n.translate('xpack.canvas.datasourceNoDatasource.panelTitle', { - defaultMessage: 'No data source present', - }), - }, DatasourceDatasourcePreview: { getEmptyFirstLineDescription: () => i18n.translate('xpack.canvas.datasourceDatasourcePreview.emptyFirstLineDescription', { @@ -257,7 +246,17 @@ export const ComponentStrings = { defaultMessage: 'Datasource preview', }), }, - + DatasourceNoDatasource: { + getPanelDescription: () => + i18n.translate('xpack.canvas.datasourceNoDatasource.panelDescription', { + defaultMessage: + "This element does not have an attached data source. This is usually because the element is an image or other static asset. If that's not the case you might want to check your expression to make sure it is not malformed.", + }), + getPanelTitle: () => + i18n.translate('xpack.canvas.datasourceNoDatasource.panelTitle', { + defaultMessage: 'No data source present', + }), + }, ElementConfig: { getFailedLabel: () => i18n.translate('xpack.canvas.elementConfig.failedLabel', { @@ -397,6 +396,33 @@ export const ComponentStrings = { description: 'This is the label for a preview of the transition effect selected.', }), }, + PageManager: { + getPageNumberAriaLabel: (pageNumber: number) => + i18n.translate('xpack.canvas.pageManager.pageNumberAriaLabel', { + defaultMessage: 'Load page number {pageNumber}', + values: { + pageNumber, + }, + }), + }, + PagePreviewPageControls: { + getClonePageAriaLabel: () => + i18n.translate('xpack.canvas.pagePreviewPageControls.clonePageAriaLabel', { + defaultMessage: 'Clone page', + }), + getClonePageTooltip: () => + i18n.translate('xpack.canvas.pagePreviewPageControls.clonePageTooltip', { + defaultMessage: 'Clone', + }), + getDeletePageAriaLabel: () => + i18n.translate('xpack.canvas.pagePreviewPageControls.deletePageAriaLabel', { + defaultMessage: 'Delete page', + }), + getDeletePageTooltip: () => + i18n.translate('xpack.canvas.pagePreviewPageControls.deletePageTooltip', { + defaultMessage: 'Delete', + }), + }, SidebarContent: { getGroupedElementSidebarTitle: () => i18n.translate('xpack.canvas.sidebarContent.groupedElementSidebarTitle', { @@ -513,6 +539,38 @@ export const ComponentStrings = { defaultMessage: 'Vertical', }), }, + Toolbar: { + getEditorButtonLabel: () => + i18n.translate('xpack.canvas.toolbar.editorButtonLabel', { + defaultMessage: 'Expression editor', + }), + getNextPageAriaLabel: () => + i18n.translate('xpack.canvas.toolbar.nextPageAriaLabel', { + defaultMessage: 'Next Page', + }), + getPageButtonLabel: (pageNum: number, totalPages: number) => + i18n.translate('xpack.canvas.toolbar.pageButtonLabel', { + defaultMessage: 'Page {pageNum}{rest}', + values: { + pageNum, + rest: totalPages > 1 ? ` of ${totalPages}` : '', + }, + }), + getPreviousPageAriaLabel: () => + i18n.translate('xpack.canvas.toolbar.previousPageAriaLabel', { + defaultMessage: 'Previous Page', + }), + getWorkpadManagerCloseButtonLabel: () => + i18n.translate('xpack.canvas.toolbar.workpadManagerCloseButtonLabel', { + defaultMessage: 'Close', + }), + }, + ToolbarTray: { + getCloseTrayAriaLabel: () => + i18n.translate('xpack.canvas.toolbarTray.closeTrayAriaLabel', { + defaultMessage: 'Close tray', + }), + }, WorkpadConfig: { getApplyStylesheetButtonLabel: () => i18n.translate('xpack.canvas.workpadConfig.applyStylesheetButtonLabel', { @@ -568,65 +626,6 @@ export const ComponentStrings = { description: 'This is referring to the dimentions of U.S. standard letter paper.', }), }, - PageManager: { - getPageNumberAriaLabel: (pageNumber: number) => - i18n.translate('xpack.canvas.pageManager.pageNumberAriaLabel', { - defaultMessage: 'Load page number {pageNumber}', - values: { - pageNumber, - }, - }), - }, - PagePreviewPageControls: { - getClonePageAriaLabel: () => - i18n.translate('xpack.canvas.pagePreviewPageControls.clonePageAriaLabel', { - defaultMessage: 'Clone page', - }), - getClonePageTooltip: () => - i18n.translate('xpack.canvas.pagePreviewPageControls.clonePageTooltip', { - defaultMessage: 'Clone', - }), - getDeletePageAriaLabel: () => - i18n.translate('xpack.canvas.pagePreviewPageControls.deletePageAriaLabel', { - defaultMessage: 'Delete page', - }), - getDeletePageTooltip: () => - i18n.translate('xpack.canvas.pagePreviewPageControls.deletePageTooltip', { - defaultMessage: 'Delete', - }), - }, - Toolbar: { - getEditorButtonLabel: () => - i18n.translate('xpack.canvas.toolbar.editorButtonLabel', { - defaultMessage: 'Expression editor', - }), - getNextPageAriaLabel: () => - i18n.translate('xpack.canvas.toolbar.nextPageAriaLabel', { - defaultMessage: 'Next Page', - }), - getPageButtonLabel: (pageNum: number, totalPages: number) => - i18n.translate('xpack.canvas.toolbar.pageButtonLabel', { - defaultMessage: 'Page {pageNum}{rest}', - values: { - pageNum, - rest: totalPages > 1 ? ` of ${totalPages}` : '', - }, - }), - getPreviousPageAriaLabel: () => - i18n.translate('xpack.canvas.toolbar.previousPageAriaLabel', { - defaultMessage: 'Previous Page', - }), - getWorkpadManagerCloseButtonLabel: () => - i18n.translate('xpack.canvas.toolbar.workpadManagerCloseButtonLabel', { - defaultMessage: 'Close', - }), - }, - ToolbarTray: { - getCloseTrayAriaLabel: () => - i18n.translate('xpack.canvas.toolbarTray.closeTrayAriaLabel', { - defaultMessage: 'Close tray', - }), - }, WorkpadCreate: { getWorkpadCreateButtonLabel: () => i18n.translate('xpack.canvas.workpadCreate.createButtonLabel', { @@ -801,17 +800,17 @@ export const ComponentStrings = { URL, }, }), - getPDFPanelGenerateDescription: () => - i18n.translate('xpack.canvas.workpadHeaderWorkpadExport.pdfPanelGenerateDescription', { - defaultMessage: - '{PDF}s can take a minute or two to generate based on the size of your workpad.', + getPDFPanelGenerateButtonLabel: () => + i18n.translate('xpack.canvas.workpadHeaderWorkpadExport.pdfPanelGenerateButtonLabel', { + defaultMessage: 'Generate {PDF}', values: { PDF, }, }), - getPDFPanelGenerateButtonLabel: () => - i18n.translate('xpack.canvas.workpadHeaderWorkpadExport.pdfPanelGenerateButtonLabel', { - defaultMessage: 'Generate {PDF}', + getPDFPanelGenerateDescription: () => + i18n.translate('xpack.canvas.workpadHeaderWorkpadExport.pdfPanelGenerateDescription', { + defaultMessage: + '{PDF}s can take a minute or two to generate based on the size of your workpad.', values: { PDF, }, @@ -914,6 +913,14 @@ export const ComponentStrings = { numberOfWorkpads, }, }), + getDeleteModalConfirmButtonLabel: () => + i18n.translate('xpack.canvas.workpadLoader.deleteModalConfirmButtonLabel', { + defaultMessage: 'Delete', + }), + getDeleteModalDescription: () => + i18n.translate('xpack.canvas.workpadLoader.deleteModalDescription', { + defaultMessage: `You can't recover deleted workpads.`, + }), getDeleteMultipleWorkpadModalTitle: (numberOfWorkpads: string) => i18n.translate('xpack.canvas.workpadLoader.deleteMultipleWorkpadsModalTitle', { defaultMessage: 'Delete {numberOfWorkpads} workpads?', @@ -928,18 +935,6 @@ export const ComponentStrings = { workpadName, }, }), - getDeleteModalConfirmButtonLabel: () => - i18n.translate('xpack.canvas.workpadLoader.deleteModalConfirmButtonLabel', { - defaultMessage: 'Delete', - }), - getDeleteModalDescription: () => - i18n.translate('xpack.canvas.workpadLoader.deleteModalDescription', { - defaultMessage: `You can't recover deleted workpads.`, - }), - getEmptyPromptTitle: () => - i18n.translate('xpack.canvas.workpadLoader.emptyPromptTitle', { - defaultMessage: 'Add your first workpad', - }), getEmptyPromptGettingStartedDescription: () => i18n.translate('xpack.canvas.workpadLoader.emptyPromptGettingStartedDescription', { defaultMessage: @@ -955,6 +950,10 @@ export const ComponentStrings = { CANVAS, }, }), + getEmptyPromptTitle: () => + i18n.translate('xpack.canvas.workpadLoader.emptyPromptTitle', { + defaultMessage: 'Add your first workpad', + }), getExportButtonAriaLabel: (numberOfWorkpads: number) => i18n.translate('xpack.canvas.workpadLoader.exportButtonAriaLabel', { defaultMessage: 'Export {numberOfWorkpads} workpads', diff --git a/x-pack/legacy/plugins/canvas/i18n/errors.ts b/x-pack/legacy/plugins/canvas/i18n/errors.ts index e3064b74ec2a2..1e7aadb6a5a9f 100644 --- a/x-pack/legacy/plugins/canvas/i18n/errors.ts +++ b/x-pack/legacy/plugins/canvas/i18n/errors.ts @@ -8,25 +8,14 @@ import { i18n } from '@kbn/i18n'; import { CANVAS, JSON } from './constants'; export const ErrorStrings = { - WorkpadLoader: { - getCloneFailureErrorMessage: () => - i18n.translate('xpack.canvas.error.workpadLoader.cloneFailureErrorMessage', { - defaultMessage: `Couldn't clone workpad`, - }), - getDeleteFailureErrorMessage: () => - i18n.translate('xpack.canvas.error.workpadLoader.deleteFailureErrorMessage', { - defaultMessage: `Couldn't delete all workpads`, - }), - getFindFailureErrorMessage: () => - i18n.translate('xpack.canvas.error.workpadLoader.findFailureErrorMessage', { - defaultMessage: `Couldn't find workpad`, - }), - getUploadFailureErrorMessage: () => - i18n.translate('xpack.canvas.error.workpadLoader.uploadFailureErrorMessage', { - defaultMessage: `Couldn't upload workpad`, - }), - }, WorkpadFileUpload: { + getAcceptJSONOnlyErrorMessage: () => + i18n.translate('xpack.canvas.error.workpadUpload.acceptJSONOnlyErrorMessage', { + defaultMessage: 'Only {JSON} files are accepted', + values: { + JSON, + }, + }), getFileUploadFailureWithFileNameErrorMessage: (fileName: string) => i18n.translate('xpack.canvas.errors.workpadUpload.fileUploadFileWithFileNameErrorMessage', { defaultMessage: `Couldn't upload '{fileName}'`, @@ -41,13 +30,6 @@ export const ErrorStrings = { defaultMessage: `Couldn't upload file`, } ), - getAcceptJSONOnlyErrorMessage: () => - i18n.translate('xpack.canvas.error.workpadUpload.acceptJSONOnlyErrorMessage', { - defaultMessage: 'Only {JSON} files are accepted', - values: { - JSON, - }, - }), getMissingPropertiesErrorMessage: () => i18n.translate('xpack.canvas.error.workpadUpload.missingPropertiesErrorMessage', { defaultMessage: @@ -58,4 +40,22 @@ export const ErrorStrings = { }, }), }, + WorkpadLoader: { + getCloneFailureErrorMessage: () => + i18n.translate('xpack.canvas.error.workpadLoader.cloneFailureErrorMessage', { + defaultMessage: `Couldn't clone workpad`, + }), + getDeleteFailureErrorMessage: () => + i18n.translate('xpack.canvas.error.workpadLoader.deleteFailureErrorMessage', { + defaultMessage: `Couldn't delete all workpads`, + }), + getFindFailureErrorMessage: () => + i18n.translate('xpack.canvas.error.workpadLoader.findFailureErrorMessage', { + defaultMessage: `Couldn't find workpad`, + }), + getUploadFailureErrorMessage: () => + i18n.translate('xpack.canvas.error.workpadLoader.uploadFailureErrorMessage', { + defaultMessage: `Couldn't upload workpad`, + }), + }, }; diff --git a/x-pack/legacy/plugins/canvas/i18n/units.ts b/x-pack/legacy/plugins/canvas/i18n/units.ts index 06ce0684778cb..400e61915c2cc 100644 --- a/x-pack/legacy/plugins/canvas/i18n/units.ts +++ b/x-pack/legacy/plugins/canvas/i18n/units.ts @@ -7,49 +7,68 @@ import { i18n } from '@kbn/i18n'; export const UnitStrings = { time: { - getSecondsText: (seconds: number) => - i18n.translate('xpack.canvas.units.time.seconds', { - defaultMessage: '{seconds, plural, one {# second} other {# seconds}}', - values: { seconds }, - }), - getMinutesText: (minutes: number) => - i18n.translate('xpack.canvas.units.time.minutes', { - defaultMessage: '{minutes, plural, one {# minute} other {# minutes}}', - values: { minutes }, - }), - getHoursText: (hours: number) => - i18n.translate('xpack.canvas.units.time.hours', { - defaultMessage: '{hours, plural, one {# hour} other {# hours}}', - values: { hours }, - }), - getDaysText: (days: number) => - i18n.translate('xpack.canvas.units.time.days', { - defaultMessage: '{days, plural, one {# day} other {# days}}', - values: { days }, - }), getCycleTimeText: (length: number, format: 'seconds' | 'days' | 'hours' | 'minutes') => { switch (format) { case 'seconds': return i18n.translate('xpack.canvas.workpadHeader.cycleIntervalSecondsText', { defaultMessage: 'Every {seconds} {seconds, plural, one {second} other {seconds}}', - values: { seconds: length }, + values: { + seconds: length, + }, }); + case 'minutes': return i18n.translate('xpack.canvas.workpadHeader.cycleIntervalMinutesText', { defaultMessage: 'Every {minutes} {minutes, plural, one {minute} other {minutes}}', - values: { minutes: length }, + values: { + minutes: length, + }, }); + case 'hours': return i18n.translate('xpack.canvas.workpadHeader.cycleIntervalHoursText', { defaultMessage: 'Every {hours} {hours, plural, one {hour} other {hours}}', - values: { hours: length }, + values: { + hours: length, + }, }); + case 'days': return i18n.translate('xpack.canvas.workpadHeader.cycleIntervalDaysText', { defaultMessage: 'Every {days} {days, plural, one {day} other {days}}', - values: { days: length }, + values: { + days: length, + }, }); } }, + getDaysText: (days: number) => + i18n.translate('xpack.canvas.units.time.days', { + defaultMessage: '{days, plural, one {# day} other {# days}}', + values: { + days, + }, + }), + getHoursText: (hours: number) => + i18n.translate('xpack.canvas.units.time.hours', { + defaultMessage: '{hours, plural, one {# hour} other {# hours}}', + values: { + hours, + }, + }), + getMinutesText: (minutes: number) => + i18n.translate('xpack.canvas.units.time.minutes', { + defaultMessage: '{minutes, plural, one {# minute} other {# minutes}}', + values: { + minutes, + }, + }), + getSecondsText: (seconds: number) => + i18n.translate('xpack.canvas.units.time.seconds', { + defaultMessage: '{seconds, plural, one {# second} other {# seconds}}', + values: { + seconds, + }, + }), }, }; diff --git a/x-pack/legacy/plugins/file_upload/public/components/json_index_file_picker.js b/x-pack/legacy/plugins/file_upload/public/components/json_index_file_picker.js index 1c38ec32e1097..54d77b2aa1d05 100644 --- a/x-pack/legacy/plugins/file_upload/public/components/json_index_file_picker.js +++ b/x-pack/legacy/plugins/file_upload/public/components/json_index_file_picker.js @@ -39,13 +39,28 @@ export class JsonIndexFilePicker extends Component { return; } const file = fileArr[0]; - let initIndexName; + + this._parseFile(file); + }; + + _checkFileSize = ({ size }) => { + const fileSizeValid = true; try { - initIndexName = this._getIndexName(file); + if (size > MAX_FILE_SIZE) { + const humanReadableSize = bytesToSize(size); + const humanReadableMaxSize = bytesToSize(MAX_FILE_SIZE); + throw new Error(i18n.translate('xpack.fileUpload.jsonIndexFilePicker.acceptableFileSize', { + defaultMessage: 'File size {fileSize} exceeds max file size of {maxFileSize}', + values: { + fileSize: humanReadableSize, + maxFileSize: humanReadableMaxSize + } + })); + } } catch (error) { this.setState({ - fileUploadError: i18n.translate('xpack.fileUpload.jsonIndexFilePicker.errorGettingIndexName', { - defaultMessage: 'Error retrieving index name: {errorMessage}', + fileUploadError: i18n.translate('xpack.fileUpload.jsonIndexFilePicker.fileSizeError', { + defaultMessage: 'File size error: {errorMessage}', values: { errorMessage: error.message } @@ -53,46 +68,56 @@ export class JsonIndexFilePicker extends Component { }); return; } + return fileSizeValid; + } - this.props.setIndexName(initIndexName); - this._parseFile(file); - }; - - _getIndexName({ name, size }) { - if (!name) { - throw new Error(i18n.translate('xpack.fileUpload.jsonIndexFilePicker.noFileNameError', { - defaultMessage: 'No file name provided' - })); - } + _getFileNameAndCheckType({ name }) { + let fileNameOnly; + try { + if (!name) { + throw new Error(i18n.translate('xpack.fileUpload.jsonIndexFilePicker.noFileNameError', { + defaultMessage: 'No file name provided' + })); + } - const splitNameArr = name.split('.'); - const fileType = splitNameArr.pop(); - if (!ACCEPTABLE_FILETYPES.includes(fileType)) { - throw new Error(i18n.translate('xpack.fileUpload.jsonIndexFilePicker.acceptableTypesError', { - defaultMessage: 'File is not one of acceptable types: {types}', - values: { - types: ACCEPTABLE_FILETYPES.join(', ') - } - })); - } + const splitNameArr = name.split('.'); + const fileType = splitNameArr.pop(); + if (!ACCEPTABLE_FILETYPES.includes(fileType)) { + throw new Error(i18n.translate('xpack.fileUpload.jsonIndexFilePicker.acceptableTypesError', { + defaultMessage: 'File is not one of acceptable types: {types}', + values: { + types: ACCEPTABLE_FILETYPES.join(', ') + } + })); + } - if (size > MAX_FILE_SIZE) { - throw new Error(i18n.translate('xpack.fileUpload.jsonIndexFilePicker.acceptableFileSize', { - defaultMessage: 'File size {fileSize} bytes exceeds max file size of {maxFileSize}', - values: { - fileSize: size, - maxFileSize: MAX_FILE_SIZE - } - })); + fileNameOnly = splitNameArr[0]; + } catch (error) { + this.setState({ + fileUploadError: i18n.translate('xpack.fileUpload.jsonIndexFilePicker.fileProcessingError', { + defaultMessage: 'File processing error: {errorMessage}', + values: { + errorMessage: error.message + } + }) + }); + return; } - - return splitNameArr[0]; + return fileNameOnly.toLowerCase(); } async _parseFile(file) { const { - setFileRef, setParsedFile, resetFileAndIndexSettings, onFileUpload, transformDetails + setFileRef, setParsedFile, resetFileAndIndexSettings, onFileUpload, + transformDetails, setIndexName } = this.props; + + const fileSizeValid = this._checkFileSize(file); + const defaultIndexName = this._getFileNameAndCheckType(file); + if (!fileSizeValid || !defaultIndexName) { + resetFileAndIndexSettings(); + return; + } // Parse file this.setState({ fileParsingProgress: i18n.translate( 'xpack.fileUpload.jsonIndexFilePicker.parsingFile', @@ -123,10 +148,14 @@ export class JsonIndexFilePicker extends Component { resetFileAndIndexSettings(); return; } + + setIndexName(defaultIndexName); setFileRef(file); setParsedFile(parsedFileResult); } + + render() { const { fileParsingProgress, fileUploadError } = this.state; diff --git a/x-pack/legacy/plugins/monitoring/public/services/__tests__/executor_provider.js b/x-pack/legacy/plugins/monitoring/public/services/__tests__/executor_provider.js index 4c72902c294bc..b4db1fb8c0f29 100644 --- a/x-pack/legacy/plugins/monitoring/public/services/__tests__/executor_provider.js +++ b/x-pack/legacy/plugins/monitoring/public/services/__tests__/executor_provider.js @@ -8,7 +8,7 @@ import ngMock from 'ng_mock'; import expect from '@kbn/expect'; import sinon from 'sinon'; import { executorProvider } from '../executor_provider'; -import Promise from 'bluebird'; +import Bluebird from 'bluebird'; import { timefilter } from 'ui/timefilter'; describe('$executor service', () => { @@ -32,7 +32,7 @@ describe('$executor service', () => { value: 0 }); - executor = executorProvider(Promise, $timeout); + executor = executorProvider(Bluebird, $timeout); }); afterEach(() => executor.destroy()); @@ -56,7 +56,7 @@ describe('$executor service', () => { pause: false, value: 1000 }); - executor.register({ execute: () => Promise.resolve().then(() => done(), done) }); + executor.register({ execute: () => Bluebird.resolve().then(() => done(), done) }); executor.start(scope); }); @@ -68,7 +68,7 @@ describe('$executor service', () => { }); executor.register({ execute: () => { if (calls++ > 1) { done(); } - return Promise.resolve(); + return Bluebird.resolve(); } }); executor.start(scope); }); @@ -79,7 +79,7 @@ describe('$executor service', () => { value: 10 }); executor.register({ - execute: () => Promise.resolve(), + execute: () => Bluebird.resolve(), handleResponse: () => done() }); executor.start(scope); @@ -91,7 +91,7 @@ describe('$executor service', () => { value: 10 }); executor.register({ - execute: () => Promise.reject(new Error('reject test')), + execute: () => Bluebird.reject(new Error('reject test')), handleError: () => done() }); executor.start(scope); diff --git a/x-pack/legacy/plugins/monitoring/server/lib/details/get_metrics.js b/x-pack/legacy/plugins/monitoring/server/lib/details/get_metrics.js index e11de68b55c1f..fea3f85b4250b 100644 --- a/x-pack/legacy/plugins/monitoring/server/lib/details/get_metrics.js +++ b/x-pack/legacy/plugins/monitoring/server/lib/details/get_metrics.js @@ -6,7 +6,7 @@ import moment from 'moment'; import { isPlainObject } from 'lodash'; -import Promise from 'bluebird'; +import Bluebird from 'bluebird'; import { checkParam } from '../error_missing_required'; import { getSeries } from './get_series'; import { calculateTimeseriesInterval } from '../calculate_timeseries_interval'; @@ -29,7 +29,7 @@ export async function getMetrics(req, indexPattern, metricSet = [], filters = [] min = max - (numOfBuckets * bucketSize * 1000); } - return Promise.map(metricSet, metric => { + return Bluebird.map(metricSet, metric => { // metric names match the literal metric name, but they can be supplied in groups or individually let metricNames; @@ -39,7 +39,7 @@ export async function getMetrics(req, indexPattern, metricSet = [], filters = [] metricNames = [ metric ]; } - return Promise.map(metricNames, metricName => { + return Bluebird.map(metricNames, metricName => { return getSeries(req, indexPattern, metricName, metricOptions, filters, { min, max, bucketSize, timezone }); }); }) diff --git a/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/get_ml_jobs.js b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/get_ml_jobs.js index 26088c4569318..ba58684915fc8 100644 --- a/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/get_ml_jobs.js +++ b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/get_ml_jobs.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Promise from 'bluebird'; +import Bluebird from 'bluebird'; import { contains, get } from 'lodash'; import { checkParam } from '../error_missing_required'; import { createQuery } from '../create_query'; @@ -88,5 +88,5 @@ export function getMlJobsForCluster(req, esIndexPattern, cluster) { } // ML is not supported - return Promise.resolve(null); + return Bluebird.resolve(null); } diff --git a/x-pack/legacy/plugins/monitoring/server/lib/kibana/get_kibanas_for_clusters.js b/x-pack/legacy/plugins/monitoring/server/lib/kibana/get_kibanas_for_clusters.js index 545b961c55c02..8eae217323a26 100644 --- a/x-pack/legacy/plugins/monitoring/server/lib/kibana/get_kibanas_for_clusters.js +++ b/x-pack/legacy/plugins/monitoring/server/lib/kibana/get_kibanas_for_clusters.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Promise from 'bluebird'; +import Bluebird from 'bluebird'; import { chain, find, get } from 'lodash'; import { checkParam } from '../error_missing_required'; import { createQuery } from '../create_query.js'; @@ -30,7 +30,7 @@ export function getKibanasForClusters(req, kbnIndexPattern, clusters) { const start = req.payload.timeRange.min; const end = req.payload.timeRange.max; - return Promise.map(clusters, cluster => { + return Bluebird.map(clusters, cluster => { const clusterUuid = cluster.cluster_uuid; const metric = KibanaClusterMetric.getMetricFields(); const params = { diff --git a/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_logstash_for_clusters.js b/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_logstash_for_clusters.js index 0bd527523ad7d..9179cc180c2d4 100644 --- a/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_logstash_for_clusters.js +++ b/x-pack/legacy/plugins/monitoring/server/lib/logstash/get_logstash_for_clusters.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Promise from 'bluebird'; +import Bluebird from 'bluebird'; import { get } from 'lodash'; import { checkParam } from '../error_missing_required'; import { createQuery } from '../create_query.js'; @@ -45,7 +45,7 @@ export function getLogstashForClusters(req, lsIndexPattern, clusters) { const end = req.payload.timeRange.max; const config = req.server.config(); - return Promise.map(clusters, cluster => { + return Bluebird.map(clusters, cluster => { const clusterUuid = cluster.cluster_uuid; const params = { index: lsIndexPattern, diff --git a/x-pack/legacy/plugins/siem/common/constants.ts b/x-pack/legacy/plugins/siem/common/constants.ts index 1641ee983bee9..6845648ee921d 100644 --- a/x-pack/legacy/plugins/siem/common/constants.ts +++ b/x-pack/legacy/plugins/siem/common/constants.ts @@ -25,3 +25,8 @@ export const DEFAULT_TO = 'now'; export const DEFAULT_INTERVAL_PAUSE = true; export const DEFAULT_INTERVAL_TYPE = 'manual'; export const DEFAULT_INTERVAL_VALUE = 300000; // ms + +/** + * Id for the SIGNALS alerting type + */ +export const SIGNALS_ID = `${APP_ID}.signals`; diff --git a/x-pack/legacy/plugins/siem/index.test.ts b/x-pack/legacy/plugins/siem/index.test.ts new file mode 100644 index 0000000000000..702676cc202d5 --- /dev/null +++ b/x-pack/legacy/plugins/siem/index.test.ts @@ -0,0 +1,30 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { siem } from '.'; + +describe('siem plugin tests', () => { + // This test is a temporary test which is so we do not accidentally check-in + // feature flags turned on from "alerting" and "actions". If those get + // turned on during a check-in it will cause everyone's Kibana to not start. + // Once alerting and actions are part of the plugins by default this test + // should be removed. + test(` + You have accidentally tried to check-in a feature flag with alerting located + here: x-pack/legacy/plugins/siem/index.ts, please change the plugin require to + NOT have these two inside of the require array." + `, () => { + class MockPlugin { + require: string[]; + constructor({ require }: { require: string[] }) { + this.require = require; + } + } + const plugin = siem({ Plugin: MockPlugin }); + expect(plugin.require.includes('alerting')).toBe(false); + expect(plugin.require.includes('actions')).toBe(false); + }); +}); diff --git a/x-pack/legacy/plugins/siem/index.ts b/x-pack/legacy/plugins/siem/index.ts index c3e2c2b0e119d..eadb680c030e5 100644 --- a/x-pack/legacy/plugins/siem/index.ts +++ b/x-pack/legacy/plugins/siem/index.ts @@ -8,6 +8,7 @@ import { i18n } from '@kbn/i18n'; import { resolve } from 'path'; import { Server } from 'hapi'; +import KbnServer from '../../../../src/legacy/server/kbn_server'; import { initServerWithKibana } from './server/kibana.index'; import { savedObjectMappings } from './server/saved_objects'; @@ -122,8 +123,11 @@ export function siem(kibana: any) { mappings: savedObjectMappings, }, init(server: Server) { + const newPlatform = ((server as unknown) as KbnServer).newPlatform; if (server.plugins.alerting != null) { - server.plugins.alerting.registerType(signalsAlertType); + server.plugins.alerting.setup.registerType( + signalsAlertType({ logger: newPlatform.coreContext.logger.get('plugins', APP_ID) }) + ); } server.injectUiAppVars('siem', async () => server.getInjectedUiAppVars('kibana')); initServerWithKibana(server); diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.test.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.test.tsx index 5796723ad6320..e345760fb2248 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.test.tsx @@ -63,5 +63,13 @@ describe('embedded_map_helpers', () => { await createEmbeddable([], '', 0, 0, setQueryMock); expect(setQueryMock).toHaveBeenCalledTimes(1); }); + + test('attaches refresh action with correct reference', async () => { + const setQueryMock = jest.fn(({ id, inspect, loading, refetch }) => refetch); + const embeddable = await createEmbeddable([], '', 0, 0, setQueryMock); + expect(setQueryMock.mock.calls[0][0].refetch).not.toBe(embeddable.reload); + setQueryMock.mock.results[0].value(); + expect(embeddable.reload).toHaveBeenCalledTimes(1); + }); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.tsx index 1ecb478ebe244..1540cfdd0ef5a 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map_helpers.tsx @@ -129,7 +129,7 @@ export const createEmbeddable = async ( id: 'embeddedMap', // Scope to page type if using map elsewhere inspect: null, loading: false, - refetch: embeddableObject.reload, + refetch: () => embeddableObject.reload(), }); return embeddableObject; diff --git a/x-pack/legacy/plugins/siem/server/kibana.index.ts b/x-pack/legacy/plugins/siem/server/kibana.index.ts index 8d0e8d56cfaf3..ea29b7cdeef81 100644 --- a/x-pack/legacy/plugins/siem/server/kibana.index.ts +++ b/x-pack/legacy/plugins/siem/server/kibana.index.ts @@ -16,6 +16,8 @@ import { timelineSavedObjectType, } from './saved_objects'; +import { createSignalsRoute } from './lib/detection_engine/routes/create_signals_route'; + const APP_ID = 'siem'; export const amMocking = (): boolean => process.env.INGEST_MOCKS === 'true'; @@ -34,7 +36,17 @@ export const initServerWithKibana = (kbnServer: Server) => { const libs = compose(kbnServer); initServer(libs, { mocking, logger }); - + if ( + kbnServer.config().has('xpack.actions.enabled') && + kbnServer.config().get('xpack.actions.enabled') === true && + kbnServer.config().has('xpack.alerting.enabled') && + kbnServer.config().has('xpack.alerting.enabled') === true + ) { + logger.info( + 'Detected feature flags for actions and alerting and enabling signals API endpoints' + ); + createSignalsRoute(kbnServer); + } logger.info('Plugin done initializing'); const xpackMainPlugin = kbnServer.plugins.xpack_main; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/README.md b/x-pack/legacy/plugins/siem/server/lib/detection_engine/README.md index 063e7c1975b25..3f18f95223408 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/README.md +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/README.md @@ -9,23 +9,20 @@ Since there is no UI yet and a lot of backend areas that are not created, you should install the kbn-action and kbn-alert project from here: https://github.com/pmuellr/kbn-action -Add your signal mappings into your Kibana instance manually by opening - -``` -x-pack/legacy/plugins/siem/server/lib/detection_engine/signals_mapping.json +Open up your .zshrc/.bashrc and add these lines with the variables filled in: ``` +export ELASTICSEARCH_USERNAME=${user} +export ELASTICSEARCH_PASSWORD=${password} +export ELASTICSEARCH_URL=https://${ip}:9200 +export KIBANA_URL=http://localhost:5601 +export SIGNALS_INDEX=.siem-signals-${your user id} +export TASK_MANAGER_INDEX=.kibana-task-manager-${your user id} -And copying that to your DEV tools so it looks something like: -``` -PUT /.siem-signals-10-01-2019 -{ - "mappings": { - "dynamic": false, -... +# This is for the kbn-action and kbn-alert tool +export KBN_URLBASE=http://${user}:${password}@localhost:5601 ``` -We will solve the above issue here: -https://github.com/elastic/kibana/issues/47002 +source your .zhsrc/.bashrc or open a new terminal to ensure you get the new values set. Add these lines to your `kibana.dev.yml` to turn on the feature toggles of alerting and actions: ``` @@ -56,42 +53,34 @@ server log [22:05:22.277] [info][status][plugin:alerting@8.0.0] Status chan server log [22:05:22.270] [info][status][plugin:actions@8.0.0] Status changed from uninitialized to green - Ready ``` -Open a terminal and run +You should also see the SIEM detect the feature flags and start the API endpoints for signals -```sh -kbn-alert ls-types +``` +server log [11:39:05.561] [info][siem] Detected feature flags for actions and alerting and enabling signals API endpoints ``` -You should see the new alert type of: +Open a terminal and go into the scripts folder `cd kibana/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts` and run: -```ts -[ - { - "id": "siem.signals", - "name": "SIEM Signals" - } -] +``` +./delete_signal_index.sh +./put_signal_index.sh +./post_signal.sh ``` -Setup SIEM Alerts Log action through +which will: -```ts -kbn-action create .server-log "SIEM Alerts Log" {} {} -{ - "id": "7edd7e98-9286-4fdb-a5c5-16de776bc7c7", - "actionTypeId": ".server-log", - "description": "SIEM Alerts Log", - "config": {} -} -``` +* Delete any existing signal mapping you might have had. +* Add the latest signal index and its mappings +* Posts a sample signal which checks for root or admin every 5 minutes -Take note of the `id` GUID above and copy and paste that into a create alert like so -```ts -kbn-alert create siem.signals 5m '{}' "[{group:default id:'7edd7e98-9286-4fdb-a5c5-16de776bc7c7' params:{message: 'SIEM Alert Fired'}}]" +Now you can run + +```sh +./get_alert_instances.sh ``` -You should get back a response like so +You should see the new alert instance created like so: ```ts { "id": "908a6af1-ac63-4d52-a856-fc635a00db0f", @@ -122,5 +111,10 @@ Every 5 minutes you should see this message in your terminal now: server log [22:17:33.945] [info][alerting] SIEM Alert Fired ``` -Add the `.siem-signals-10-01-2019` to your advanced SIEM settings to see any signals -created which should update once every 5 minutes at this point. \ No newline at end of file +See the scripts folder and the tools for more command line fun. + +Add the `.siem-signals-${your user id}` to your advanced SIEM settings to see any signals +created which should update once every 5 minutes at this point. + +Also add the `.siem-signals-${your user id}` as a kibana index for Maps to be able to see the +signals diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/alerts/build_events_reindex.ts b/x-pack/legacy/plugins/siem/server/lib/detection_engine/alerts/build_events_reindex.ts index 84cedca0855e0..c48be695756af 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/alerts/build_events_reindex.ts +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/alerts/build_events_reindex.ts @@ -4,48 +4,64 @@ * you may not use this file except in compliance with the Elastic License. */ +import { fromKueryExpression, toElasticsearchQuery } from '@kbn/es-query'; + // TODO: Re-index is just a temporary solution in order to speed up development // of any front end pieces. This should be replaced with a combination of the file // build_events_query.ts and any scrolling/scaling solutions from that particular // file. interface BuildEventsReIndexParams { + description: string; index: string[]; from: number; to: number; signalsIndex: string; maxDocs: number; - kqlFilter: {}; + filter: Record | undefined; + kql: string | undefined; severity: number; - description: string; name: string; timeDetected: number; ruleRevision: number; - ruleId: string; - ruleType: string; + id: string; + type: string; references: string[]; } +export const getFilter = (kql: string | undefined, filter: Record | undefined) => { + if (kql != null) { + return toElasticsearchQuery(fromKueryExpression(kql), null); + } else if (filter != null) { + return filter; + } else { + // TODO: Re-visit this error (which should never happen) when we do signal errors for the UI + throw new TypeError('either kql or filter should be set'); + } +}; + export const buildEventsReIndex = ({ + description, index, from, to, signalsIndex, maxDocs, - kqlFilter, + filter, + kql, severity, - description, name, timeDetected, ruleRevision, - ruleId, - ruleType, + id, + type, references, }: BuildEventsReIndexParams) => { + const kqlOrFilter = getFilter(kql, filter); const indexPatterns = index.map(element => `"${element}"`).join(','); const refs = references.map(element => `"${element}"`).join(','); - const filter = [ - kqlFilter, + const filterWithTime = [ + kqlOrFilter, { bool: { filter: [ @@ -96,7 +112,7 @@ export const buildEventsReIndex = ({ query: { bool: { filter: [ - ...filter, + ...filterWithTime, { match_all: {}, }, @@ -120,8 +136,8 @@ export const buildEventsReIndex = ({ def signal = [ "rule_revision": "${ruleRevision}", - "rule_id": "${ruleId}", - "rule_type": "${ruleType}", + "rule_id": "${id}", + "rule_type": "${type}", "parent": parent, "name": "${name}", "severity": ${severity}, diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/alerts/create_signal.ts b/x-pack/legacy/plugins/siem/server/lib/detection_engine/alerts/create_signal.ts new file mode 100644 index 0000000000000..6ebdecfeeba83 --- /dev/null +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/alerts/create_signal.ts @@ -0,0 +1,91 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { SIGNALS_ID } from '../../../../common/constants'; +import { AlertsClient } from '../../../../../alerting/server/alerts_client'; +import { ActionsClient } from '../../../../../actions/server/actions_client'; + +export interface SignalParams { + alertsClient: AlertsClient; + actionsClient: ActionsClient; + description: string; + from: string; + id: string; + index: string[]; + interval: string; + enabled: boolean; + filter: Record | undefined; + kql: string | undefined; + maxSignals: string; + name: string; + severity: number; + type: string; // TODO: Replace this type with a static enum type + to: string; + references: string[]; +} + +export const createSignal = async ({ + alertsClient, + actionsClient, + description, + enabled, + filter, + from, + id, + index, + interval, + kql, + name, + severity, + to, + type, + references, +}: SignalParams) => { + // TODO: Right now we are using the .server-log as the default action as each alert has to have + // at least one action or it will not be able to do in-memory persistence. When adding in actions + // such as email, slack, etc... this should be the default action if not action is specified to + // create signals + + const actionResults = await actionsClient.create({ + action: { + actionTypeId: '.server-log', + description: 'SIEM Alerts Log', + config: {}, + secrets: {}, + }, + }); + + return alertsClient.create({ + data: { + alertTypeId: SIGNALS_ID, + alertTypeParams: { + description, + id, + index, + from, + filter, + kql, + name, + severity, + to, + type, + references, + }, + interval, + enabled, + actions: [ + { + group: 'default', + id: actionResults.id, + params: { + message: 'SIEM Alert Fired', + }, + }, + ], + throttle: null, + }, + }); +}; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/alerts/signals_alert_type.ts b/x-pack/legacy/plugins/siem/server/lib/detection_engine/alerts/signals_alert_type.ts index d0b631f66d54d..5872e555ca344 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/alerts/signals_alert_type.ts +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/alerts/signals_alert_type.ts @@ -4,8 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import moment from 'moment'; -import { APP_ID } from '../../../../common/constants'; +import { schema } from '@kbn/config-schema'; +import { SIGNALS_ID } from '../../../../common/constants'; +import { Logger } from '../../../../../../../../src/core/server'; import { AlertType, AlertExecutorOptions } from '../../../../../alerting'; // TODO: Remove this for the build_events_query call eventually @@ -15,68 +16,87 @@ import { buildEventsReIndex } from './build_events_reindex'; // once scrolling and other things are done with it. // import { buildEventsQuery } from './build_events_query'; -export const signalsAlertType: AlertType = { - id: `${APP_ID}.signals`, - name: 'SIEM Signals', - actionGroups: ['default'], - async executor({ services, params, state }: AlertExecutorOptions) { - // TODO: We need to swap out this arbitrary number of siem-signal id for an injected - // data driven instance id through passed in parameters. - const instance = services.alertInstanceFactory('siem-signals'); +export const signalsAlertType = ({ logger }: { logger: Logger }): AlertType => { + return { + id: SIGNALS_ID, + name: 'SIEM Signals', + actionGroups: ['default'], + validate: { + params: schema.object({ + description: schema.string(), + from: schema.string(), + filter: schema.maybe(schema.object({}, { allowUnknowns: true })), + id: schema.number(), + index: schema.arrayOf(schema.string()), + kql: schema.maybe(schema.string({ defaultValue: undefined })), + maxSignals: schema.number({ defaultValue: 100 }), + name: schema.string(), + severity: schema.number(), + to: schema.string(), + type: schema.string(), + references: schema.arrayOf(schema.string(), { defaultValue: [] }), + }), + }, + // TODO: Type the params as it is all filled with any + async executor({ services, params, state }: AlertExecutorOptions) { + const instance = services.alertInstanceFactory('siem-signals'); - // TODO: Comment this in eventually and use the buildEventsQuery() - // for scrolling and other fun stuff instead of using the buildEventsReIndex() - // const query = buildEventsQuery(); + // TODO: Comment this in eventually and use the buildEventsQuery() + // for scrolling and other fun stuff instead of using the buildEventsReIndex() + // const query = buildEventsQuery(); - // TODO: Turn these options being sent in into a template for the alert type - const reIndex = buildEventsReIndex({ - index: ['auditbeat-*', 'filebeat-*', 'packetbeat-*', 'winlogbeat-*'], - from: moment() - .subtract(5, 'minutes') - .valueOf(), - to: Date.now(), - signalsIndex: '.siem-signals-10-01-2019', - severity: 2, - description: 'User root activity', - name: 'User Rule', - timeDetected: Date.now(), - kqlFilter: { - bool: { - should: [ - { - match_phrase: { - 'user.name': 'root', - }, - }, - ], - minimum_should_match: 1, - }, - }, - maxDocs: 100, - ruleRevision: 1, - ruleId: '1', - ruleType: 'KQL', - references: ['https://www.elastic.co', 'https://example.com'], - }); + const { + description, + filter, + from, + id, + index, + kql, + maxSignals, + name, + references, + severity, + to, + type, + } = params; + const reIndex = buildEventsReIndex({ + index, + from, + kql, + to, + // TODO: Change this out once we have solved + // https://github.com/elastic/kibana/issues/47002 + signalsIndex: process.env.SIGNALS_INDEX || '.siem-signals-10-01-2019', + severity, + description, + name, + timeDetected: Date.now(), + filter, + maxDocs: maxSignals, + ruleRevision: 1, + id, + type, + references, + }); - try { - services.log(['info', 'SIEM'], 'Starting SIEM signal job'); + try { + logger.info('Starting SIEM signal job'); - // TODO: Comment this in eventually and use this for manual insertion of the - // signals instead of the ReIndex() api - // const result = await services.callCluster('search', query); - // eslint-disable-next-line - const result = await services.callCluster('reindex', reIndex); + // TODO: Comment this in eventually and use this for manual insertion of the + // signals instead of the ReIndex() api + // const result = await services.callCluster('search', query); + const result = await services.callCluster('reindex', reIndex); - // TODO: Error handling here and writing of any errors that come back from ES by - services.log(['info', 'SIEM'], `Result of reindex: ${JSON.stringify(result, null, 2)}`); - } catch (err) { - // TODO: Error handling and writing of errors into a signal that has error - // handling/conditions - services.log(['error', 'SIEM'], `You encountered an error of: ${err.message}`); - } + // TODO: Error handling here and writing of any errors that come back from ES by + logger.info(`Result of reindex: ${JSON.stringify(result, null, 2)}`); + } catch (err) { + // TODO: Error handling and writing of errors into a signal that has error + // handling/conditions + logger.error(`You encountered an error of: ${err.message}`); + } - // Schedule the default action which is nothing if it's a plain signal. - instance.scheduleActions('default'); - }, + // Schedule the default action which is nothing if it's a plain signal. + instance.scheduleActions('default'); + }, + }; }; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/create_signals_route.ts b/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/create_signals_route.ts new file mode 100644 index 0000000000000..19070243520b8 --- /dev/null +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/create_signals_route.ts @@ -0,0 +1,108 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import Hapi from 'hapi'; +import Joi from 'joi'; +import { isFunction } from 'lodash/fp'; +import { createSignal } from '../alerts/create_signal'; + +interface SignalsRequest extends Hapi.Request { + payload: { + description: string; + enabled: boolean; + filter: Record | undefined; + from: string; + id: string; + index: string[]; + interval: string; + kql: string | undefined; + max_signals: string; + name: string; + severity: number; + type: string; + to: string; + references: string[]; + }; +} + +export const createSignalsRoute = (server: Hapi.Server) => { + server.route({ + method: 'POST', + path: '/api/siem/signals', + options: { + tags: ['access:signals-all'], + validate: { + options: { + abortEarly: false, + }, + payload: Joi.object({ + description: Joi.string().required(), + enabled: Joi.boolean().default(true), + filter: Joi.object(), + from: Joi.string().required(), + id: Joi.string().required(), + index: Joi.array().required(), + interval: Joi.string().default('5m'), + kql: Joi.string(), + max_signals: Joi.array().default([]), + name: Joi.string().required(), + severity: Joi.number().required(), + to: Joi.string().required(), + type: Joi.string().required(), // TODO: Restrict this to only be kql or filter for the moment + references: Joi.array().default([]), + }).xor('filter', 'kql'), + }, + }, + async handler(request: SignalsRequest, headers) { + const { + description, + enabled, + filter, + kql, + from, + id, + index, + interval, + // eslint-disable-next-line @typescript-eslint/camelcase + max_signals: maxSignals, + name, + severity, + to, + type, + references, + } = request.payload; + + const alertsClient = isFunction(request.getAlertsClient) ? request.getAlertsClient() : null; + + const actionsClient = isFunction(request.getActionsClient) + ? request.getActionsClient() + : null; + + if (!alertsClient || !actionsClient) { + return headers.response().code(404); + } + + return createSignal({ + alertsClient, + actionsClient, + description, + enabled, + filter, + from, + id, + index, + interval, + kql, + maxSignals, + name, + severity, + to, + type, + references, + }); + }, + }); +}; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/README.md b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/README.md new file mode 100644 index 0000000000000..0258f5455ca87 --- /dev/null +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/README.md @@ -0,0 +1,37 @@ +A set of scripts for developers to utilize command line functionality of Kibana/Elastic +search which is not available in the DEV console for the detection engine. + +Before beginning ensure in your .zshrc/.bashrc you have your user, password, and url set: + +Open up your .zshrc/.bashrc and add these lines with the variables filled in: +``` +export ELASTICSEARCH_USERNAME=${user} +export ELASTICSEARCH_PASSWORD=${password} +export ELASTICSEARCH_URL=https://${ip}:9200 +export KIBANA_URL=http://localhost:5601 +export SIGNALS_INDEX=.siem-signals-${your user id} +export TASK_MANAGER_INDEX=.kibana-task-manager-${your user id} + +# This is for the kbn-action and kbn-alert tool +export KBN_URLBASE=http://${user}:${password}@localhost:5601 +``` + +And that you have the latest version of [NodeJS](https://nodejs.org/en/), +[CURL](https://curl.haxx.se), and [jq](https://stedolan.github.io/jq/) installed. + +If you have homebrew you can install using brew like so +``` +brew install jq +``` + +After that you can execute scripts within this folder by first ensuring +your current working directory is `./scripts` and then running any scripts within +that folder. + +Example to add a signal to the system + +``` +cd ./scripts +./post_signal.sh ./signals/root_or_admin_1.json +``` + diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/delete_signal_index.sh b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/delete_signal_index.sh new file mode 100755 index 0000000000000..edb88d8b9338c --- /dev/null +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/delete_signal_index.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# Example: ./delete_signal_index.sh +# https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html +curl -s -k \ + -H "Content-Type: application/json" \ + -u ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD} \ + -X DELETE ${ELASTICSEARCH_URL}/${SIGNALS_INDEX} \ + | jq . diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/find_saved_object.sh b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/find_saved_object.sh new file mode 100755 index 0000000000000..3b9b8686df9a6 --- /dev/null +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/find_saved_object.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# Uses a default of alert if no argument is specified +TYPE=${1:-alert} + +# Example: ./find_saved_object.sh alert +# Example: ./find_saved_object.sh action +# Example: ./find_saved_object.sh action_task_params +# https://www.elastic.co/guide/en/kibana/master/saved-objects-api-find.html#saved-objects-api-find-request +curl -s -k \ + -u ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD} \ + -X GET ${KIBANA_URL}/api/saved_objects/_find?type=$TYPE \ + | jq . diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_action_instances.sh b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_action_instances.sh new file mode 100755 index 0000000000000..e04bdba4f1073 --- /dev/null +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_action_instances.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +# Example: ./get_action_instances.sh +# https://github.com/elastic/kibana/blob/master/x-pack/legacy/plugins/actions/README.md#get-apiaction_find-find-actions +curl -s -k \ + -u ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD} \ + -X GET ${KIBANA_URL}/api/action/_find \ + | jq . diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_action_types.sh b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_action_types.sh new file mode 100755 index 0000000000000..47a571f47bf68 --- /dev/null +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_action_types.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +# Example: ./get_action_types.sh +# https://github.com/elastic/kibana/blob/master/x-pack/legacy/plugins/actions/README.md +curl -s -k \ + -u ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD} \ + -X GET ${KIBANA_URL}/api/action/types \ + | jq . diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_alert_instances.sh b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_alert_instances.sh new file mode 100755 index 0000000000000..a3c03d56d6506 --- /dev/null +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_alert_instances.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +# Example: ./get_alert_instances.sh +# https://github.com/elastic/kibana/blob/master/x-pack/legacy/plugins/alerting/README.md#get-apialert_find-find-alerts +curl -s -k \ + -u ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD} \ + -X GET ${KIBANA_URL}/api/alert/_find \ + | jq . diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_alert_tasks.sh b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_alert_tasks.sh new file mode 100755 index 0000000000000..210fc2d532b7d --- /dev/null +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_alert_tasks.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +# Example: ./get_alert_tasks.sh +# https://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html +curl -s -k \ + -H "Content-Type: application/json" \ + -u ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD} \ + -X GET ${ELASTICSEARCH_URL}/${TASK_MANAGER_INDEX}*/_search \ + --data '{ + "query": { + "term" : { "task.taskType" : "alerting:siem.signals" } + }, + "size": 100 + } + ' \ +| jq . diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_alert_types.sh b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_alert_types.sh new file mode 100755 index 0000000000000..e70bbb9e882c3 --- /dev/null +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_alert_types.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +# Example: ./get_alert_types.sh +# https://github.com/elastic/kibana/blob/master/x-pack/legacy/plugins/alerting/README.md#get-apialerttypes-list-alert-types +curl -s -k \ + -u ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD} \ + -X GET ${KIBANA_URL}/api/alert/types \ + | jq . diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_saved_objects.sh b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_saved_objects.sh new file mode 100755 index 0000000000000..71725ed308a85 --- /dev/null +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_saved_objects.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +# Example: ./get_saved_object.sh +# https://www.elastic.co/guide/en/kibana/master/saved-objects-api-get.html +curl -s -k \ + -u ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD} \ + -X GET ${KIBANA_URL}/api/saved_objects/$1/$2 \ + | jq . diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_signal_mapping.sh b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_signal_mapping.sh new file mode 100755 index 0000000000000..d30f66df72eda --- /dev/null +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_signal_mapping.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +# Example: ./get_signal_mapping.sh +# https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html +curl -s -k \ + -u ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD} \ + -X GET ${ELASTICSEARCH_URL}/${SIGNALS_INDEX}/_mapping \ + | jq . diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/post_signal.sh b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/post_signal.sh new file mode 100755 index 0000000000000..3393084c56c96 --- /dev/null +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/post_signal.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +# Uses a default if no argument is specified +SIGNAL=${1:-./signals/root_or_admin_1.json} + +# Example: ./post_signal.sh +# Example: ./post_signal.sh ./signals/root_or_admin_1.json +curl -s -k \ + -H 'Content-Type: application/json' \ + -H 'kbn-xsrf: 123' \ + -u ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD} \ + -X POST ${KIBANA_URL}/api/siem/signals \ + -d @${SIGNAL} \ + | jq . diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/put_signal_index.sh b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/put_signal_index.sh new file mode 100755 index 0000000000000..54b60c7ccdbe6 --- /dev/null +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/put_signal_index.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Example: ./put_signal_index.sh +# https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html +curl -s -k \ + -H "Content-Type: application/json" \ + -u ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD} \ + -d @../signals_mapping.json \ + -X PUT ${ELASTICSEARCH_URL}/${SIGNALS_INDEX} \ + | jq . diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/root_or_admin_1.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/root_or_admin_1.json new file mode 100644 index 0000000000000..8b07d2d0ee86c --- /dev/null +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/root_or_admin_1.json @@ -0,0 +1,12 @@ +{ + "id": "1", + "description": "Detecting root and admin users", + "index": ["auditbeat-*", "filebeat-*", "packetbeat-*", "winlogbeat-*"], + "interval": "5m", + "name": "Detect Root/Admin Users", + "severity": 1, + "type": "kql", + "from": "now-6m", + "to": "now", + "kql": "user.name: root or user.name: admin" +} diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/root_or_admin_2.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/root_or_admin_2.json new file mode 100644 index 0000000000000..bc206cb8b846e --- /dev/null +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/root_or_admin_2.json @@ -0,0 +1,12 @@ +{ + "id": "2", + "description": "Detecting root and admin users over a long period of time", + "index": ["auditbeat-*", "filebeat-*", "packetbeat-*", "winlogbeat-*"], + "interval": "24h", + "name": "Detect Root/Admin Users over a long period of time", + "severity": 1, + "type": "kql", + "from": "now-1y", + "to": "now", + "kql": "user.name: root or user.name: admin" +} diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/root_or_admin_filter_9999.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/root_or_admin_filter_9999.json new file mode 100644 index 0000000000000..04d4315f8a868 --- /dev/null +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/root_or_admin_filter_9999.json @@ -0,0 +1,42 @@ +{ + "id": "9999", + "description": "Detecting root and admin users", + "index": ["auditbeat-*", "filebeat-*", "packetbeat-*", "winlogbeat-*"], + "interval": "5m", + "name": "Detect Root/Admin Users", + "severity": 1, + "type": "filter", + "from": "now-6m", + "to": "now", + "filter": { + "bool": { + "should": [ + { + "bool": { + "should": [ + { + "match_phrase": { + "user.name": "root" + } + } + ], + "minimum_should_match": 1 + } + }, + { + "bool": { + "should": [ + { + "match_phrase": { + "user.name": "admin" + } + } + ], + "minimum_should_match": 1 + } + } + ], + "minimum_should_match": 1 + } + } +} diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/watch_longmont_3.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/watch_longmont_3.json new file mode 100644 index 0000000000000..21ca9f8ba73b8 --- /dev/null +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/watch_longmont_3.json @@ -0,0 +1,12 @@ +{ + "id": "3", + "description": "Detect Longmont activity", + "index": ["auditbeat-*", "filebeat-*", "packetbeat-*", "winlogbeat-*"], + "interval": "24h", + "name": "Detect Longmont activity", + "severity": 2, + "type": "kql", + "from": "now-1y", + "to": "now", + "kql": "source.as.organization.name: \"Longmont Power & Communications\"" +} diff --git a/x-pack/legacy/plugins/task_manager/index.ts b/x-pack/legacy/plugins/task_manager/index.ts index 192c8a309b0ea..d7fa097894efb 100644 --- a/x-pack/legacy/plugins/task_manager/index.ts +++ b/x-pack/legacy/plugins/task_manager/index.ts @@ -12,7 +12,7 @@ import mappings from './mappings.json'; import { migrations } from './migrations'; export { PluginSetupContract as TaskManager }; -export { TaskInstance, ConcreteTaskInstance, TaskRunCreatorFunction } from './task'; +export { TaskInstance, ConcreteTaskInstance, TaskRunCreatorFunction, RunContext } from './task'; export function taskManager(kibana: any) { return new kibana.Plugin({ diff --git a/x-pack/legacy/plugins/task_manager/task_store.ts b/x-pack/legacy/plugins/task_manager/task_store.ts index 2314d705544d2..9b5253d8be7f9 100644 --- a/x-pack/legacy/plugins/task_manager/task_store.ts +++ b/x-pack/legacy/plugins/task_manager/task_store.ts @@ -481,7 +481,9 @@ function taskInstanceToAttributes(doc: TaskInstance): SavedObjectAttributes { }; } -function savedObjectToConcreteTaskInstance(savedObject: SavedObject): ConcreteTaskInstance { +function savedObjectToConcreteTaskInstance( + savedObject: Omit +): ConcreteTaskInstance { return { ...savedObject.attributes, id: savedObject.id, diff --git a/x-pack/legacy/plugins/uptime/common/constants/context_defaults.ts b/x-pack/legacy/plugins/uptime/common/constants/context_defaults.ts index 0c6304a5cbf0e..3a42df8c5e9ab 100644 --- a/x-pack/legacy/plugins/uptime/common/constants/context_defaults.ts +++ b/x-pack/legacy/plugins/uptime/common/constants/context_defaults.ts @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +import { SortOrder, CursorDirection } from '../graphql/types'; + /** * The Uptime UI utilizes a settings context, the defaults for which are stored here. */ @@ -28,4 +30,9 @@ export const CONTEXT_DEFAULTS = { * The end of the default date range is now. */ DATE_RANGE_END: 'now', + + CURSOR_PAGINATION: { + cursorDirection: CursorDirection.AFTER, + sortOrder: SortOrder.ASC, + }, }; diff --git a/x-pack/legacy/plugins/uptime/common/constants/query.ts b/x-pack/legacy/plugins/uptime/common/constants/query.ts index 42da7fc5249e6..d728f114aae76 100644 --- a/x-pack/legacy/plugins/uptime/common/constants/query.ts +++ b/x-pack/legacy/plugins/uptime/common/constants/query.ts @@ -27,8 +27,8 @@ export const QUERY = { }; export const STATES = { - // Number of results returned for a legacy states query - LEGACY_STATES_QUERY_SIZE: 50, + // Number of results returned for a states query + LEGACY_STATES_QUERY_SIZE: 10, // The maximum number of monitors that should be supported MAX_MONITORS: 35000, }; diff --git a/x-pack/legacy/plugins/uptime/common/graphql/introspection.json b/x-pack/legacy/plugins/uptime/common/graphql/introspection.json index 8da0597c393da..4d1993233e9ca 100644 --- a/x-pack/legacy/plugins/uptime/common/graphql/introspection.json +++ b/x-pack/legacy/plugins/uptime/common/graphql/introspection.json @@ -395,6 +395,12 @@ }, "defaultValue": null }, + { + "name": "pagination", + "description": "", + "type": { "kind": "SCALAR", "name": "String", "ofType": null }, + "defaultValue": null + }, { "name": "filters", "description": "", @@ -2599,6 +2605,22 @@ "name": "MonitorSummaryResult", "description": "The primary object returned for monitor states.", "fields": [ + { + "name": "prevPagePagination", + "description": "Used to go to the next page of results", + "args": [], + "type": { "kind": "SCALAR", "name": "String", "ofType": null }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nextPagePagination", + "description": "Used to go to the previous page of results", + "args": [], + "type": { "kind": "SCALAR", "name": "String", "ofType": null }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "summaries", "description": "The objects representing the state of a series of heartbeat monitors.", @@ -4148,6 +4170,32 @@ "interfaces": [], "enumValues": null, "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "CursorDirection", + "description": "", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { "name": "AFTER", "description": "", "isDeprecated": false, "deprecationReason": null }, + { "name": "BEFORE", "description": "", "isDeprecated": false, "deprecationReason": null } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "SortOrder", + "description": "", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { "name": "ASC", "description": "", "isDeprecated": false, "deprecationReason": null }, + { "name": "DESC", "description": "", "isDeprecated": false, "deprecationReason": null } + ], + "possibleTypes": null } ], "directives": [ diff --git a/x-pack/legacy/plugins/uptime/common/graphql/types.ts b/x-pack/legacy/plugins/uptime/common/graphql/types.ts index a5b55526ffdac..ed7c9ef19f484 100644 --- a/x-pack/legacy/plugins/uptime/common/graphql/types.ts +++ b/x-pack/legacy/plugins/uptime/common/graphql/types.ts @@ -495,6 +495,10 @@ export interface MonitorPageTitle { } /** The primary object returned for monitor states. */ export interface MonitorSummaryResult { + /** Used to go to the next page of results */ + prevPagePagination?: string | null; + /** Used to go to the previous page of results */ + nextPagePagination?: string | null; /** The objects representing the state of a series of heartbeat monitors. */ summaries?: MonitorSummary[] | null; /** The number of summaries. */ @@ -757,11 +761,27 @@ export interface GetMonitorStatesQueryArgs { dateRangeEnd: string; + pagination?: string | null; + filters?: string | null; statusFilter?: string | null; } +// ==================================================== +// Enums +// ==================================================== + +export enum CursorDirection { + AFTER = 'AFTER', + BEFORE = 'BEFORE', +} + +export enum SortOrder { + ASC = 'ASC', + DESC = 'DESC', +} + // ==================================================== // END: Typescript template // ==================================================== diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/filter_group/filter_status_button.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/filter_group/filter_status_button.tsx index 34661a49f78c9..6f2659ddbc83e 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/filter_group/filter_status_button.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/functional/filter_group/filter_status_button.tsx @@ -21,11 +21,8 @@ export const FilterStatusButton = ({ content, value, withNext }: FilterStatusBut { - if (urlValue === value) { - setUrlParams({ statusFilter: '' }); - } else { - setUrlParams({ statusFilter: value }); - } + const nextFilter = { statusFilter: urlValue === value ? '' : value, pagination: '' }; + setUrlParams(nextFilter); }} withNext={withNext} > diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list.test.tsx.snap b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list.test.tsx.snap index 3e4f2378788ac..e53d73fb5a461 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list.test.tsx.snap +++ b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list.test.tsx.snap @@ -80,6 +80,25 @@ exports[`MonitorList component renders a no items message when no data is provid noItemsMessage="No uptime monitors found" responsive={true} /> + + + + + + + + + `; @@ -226,6 +245,25 @@ exports[`MonitorList component renders the monitor list 1`] = ` noItemsMessage="No uptime monitors found" responsive={true} /> + + + + + + + + + `; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list_pagination.test.tsx.snap b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list_pagination.test.tsx.snap new file mode 100644 index 0000000000000..cd03c6aad5611 --- /dev/null +++ b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list_pagination.test.tsx.snap @@ -0,0 +1,271 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`MonitorList component renders a no items message when no data is provided 1`] = ` + + + +
+ +
+
+ + + + + + + + + + + +
+
+`; + +exports[`MonitorList component renders the monitor list 1`] = ` + + + +
+ +
+
+ + + + + + + + + + + +
+
+`; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list_pagination.test.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list_pagination.test.tsx new file mode 100644 index 0000000000000..a172513409455 --- /dev/null +++ b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list_pagination.test.tsx @@ -0,0 +1,128 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { shallowWithIntl } from 'test_utils/enzyme_helpers'; +import React from 'react'; +import { + CursorDirection, + MonitorSummaryResult, + SortOrder, +} from '../../../../../common/graphql/types'; +import { MonitorListComponent } from '../monitor_list'; + +describe('MonitorList component', () => { + let result: MonitorSummaryResult; + + beforeEach(() => { + result = { + prevPagePagination: JSON.stringify({ + cursorKey: { monitor_id: 123 }, + cursorDirection: CursorDirection.BEFORE, + sortOrder: SortOrder.ASC, + }), + nextPagePagination: JSON.stringify({ + cursorKey: { monitor_id: 456 }, + cursorDirection: CursorDirection.AFTER, + sortOrder: SortOrder.ASC, + }), + summaries: [ + { + monitor_id: 'foo', + state: { + checks: [ + { + monitor: { + ip: '127.0.0.1', + status: 'up', + }, + timestamp: '124', + }, + { + monitor: { + ip: '127.0.0.2', + status: 'down', + }, + timestamp: '125', + }, + { + monitor: { + ip: '127.0.0.3', + status: 'down', + }, + timestamp: '126', + }, + ], + summary: { + up: 1, + down: 2, + }, + timestamp: '123', + }, + }, + { + monitor_id: 'bar', + state: { + checks: [ + { + monitor: { + ip: '127.0.0.1', + status: 'up', + }, + timestamp: '125', + }, + { + monitor: { + ip: '127.0.0.2', + status: 'up', + }, + timestamp: '126', + }, + ], + summary: { + up: 2, + down: 0, + }, + timestamp: '125', + }, + }, + ], + totalSummaryCount: { + count: 2, + }, + }; + }); + + it('renders the monitor list', () => { + const component = shallowWithIntl( + + ); + + expect(component).toMatchSnapshot(); + }); + + it('renders a no items message when no data is provided', () => { + const component = shallowWithIntl( + + ); + expect(component).toMatchSnapshot(); + }); +}); diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list.tsx index 0df545951a721..cf3a0ef4e37e7 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list.tsx @@ -4,8 +4,17 @@ * you may not use this file except in compliance with the Elastic License. */ -import { EuiBasicTable, EuiPanel, EuiTitle, EuiButtonIcon, EuiIcon, EuiLink } from '@elastic/eui'; -import { EuiSpacer } from '@elastic/eui'; +import { + EuiBasicTable, + EuiFlexGroup, + EuiPanel, + EuiTitle, + EuiButtonIcon, + EuiIcon, + EuiLink, + EuiFlexItem, + EuiSpacer, +} from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; import { get } from 'lodash'; @@ -25,6 +34,7 @@ import { CLIENT_DEFAULTS } from '../../../../common/constants'; import { MonitorBarSeries } from '../charts'; import { MonitorPageLink } from '../monitor_page_link'; import { MonitorListActionsPopover } from './monitor_list_actions_popover'; +import { OverviewPageLink } from '../overview_page_link'; interface MonitorListQueryResult { monitorStates?: MonitorSummaryResult; @@ -37,14 +47,6 @@ interface MonitorListProps { hasActiveFilters: boolean; successColor: string; linkParameters?: string; - // TODO: reintegrate pagination in a future release - // pageIndex: number; - // pageSize: number; - // TODO: reintroduce for pagination and sorting - // onChange: (criteria: Criteria) => void; - // TODO: reintegrate sorting in a future release - // sortField: string; - // sortDirection: string; } type Props = UptimeGraphQLQueryProps & MonitorListProps; @@ -60,37 +62,12 @@ export const MonitorListComponent = (props: Props) => { hasActiveFilters, linkParameters, loading, - // TODO: reintroduce for pagination and sorting - // onChange, - // TODO: reintegrate pagination in future release - // pageIndex, - // pageSize, - // TODO: reintegrate sorting in future release - // sortDirection, - // sortField, } = props; const [drawerIds, updateDrawerIds] = useState([]); - const items = get(data, 'monitorStates.summaries', []); - // TODO: use with pagination - // const count = get(data, 'monitorStates.totalSummaryCount.count', 0); - // TODO: reintegrate pagination in future release - // const pagination: Pagination = { - // pageIndex, - // pageSize, - // pageSizeOptions: [5, 10, 20, 50], - // totalItemCount: count, - // hidePerPageOptions: false, - // }; - - // TODO: reintegrate sorting in future release - // const sorting = { - // sort: { - // field: sortField, - // direction: sortDirection, - // }, - // }; + const nextPagePagination = get(data, 'monitorStates.nextPagePagination'); + const prevPagePagination = get(data, 'monitorStates.prevPagePagination'); return ( @@ -268,6 +245,15 @@ export const MonitorListComponent = (props: Props) => { }, ]} /> + + + + + + + + + ); diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/overview_page_link.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/overview_page_link.tsx new file mode 100644 index 0000000000000..9153b6018ce72 --- /dev/null +++ b/x-pack/legacy/plugins/uptime/public/components/functional/overview_page_link.tsx @@ -0,0 +1,54 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { EuiLink, EuiIcon, EuiButtonIcon } from '@elastic/eui'; +import React, { FunctionComponent } from 'react'; +import { i18n } from '@kbn/i18n'; +import { useUrlParams } from '../../hooks'; + +interface OverviewPageLinkProps { + pagination: string; + direction: string; +} + +export const OverviewPageLink: FunctionComponent = ({ + pagination, + direction, +}) => { + const [, updateUrlParams] = useUrlParams(); + const icon = direction === 'prev' ? 'arrowLeft' : 'arrowRight'; + + const color = pagination ? 'primary' : 'ghost'; + const ariaLabel = + direction === 'next' + ? i18n.translate('xpack.uptime.overviewPageLink.next.ariaLabel', { + defaultMessage: 'Next page of results', + }) + : i18n.translate('xpack.uptime.overviewPageLink.prev.ariaLabel', { + defaultMessage: 'Prev page of results', + }); + + return !!pagination ? ( + { + updateUrlParams({ pagination }); + }} + > + + + ) : ( + + ); +}; diff --git a/x-pack/legacy/plugins/uptime/public/hooks/use_url_params.ts b/x-pack/legacy/plugins/uptime/public/hooks/use_url_params.ts index d4e18f5a39e0f..31343e6a1883c 100644 --- a/x-pack/legacy/plugins/uptime/public/hooks/use_url_params.ts +++ b/x-pack/legacy/plugins/uptime/public/hooks/use_url_params.ts @@ -34,12 +34,26 @@ export const useUrlParams: UptimeUrlParamsHook = () => { location: { pathname, search }, } = refreshContext; const currentParams: any = qs.parse(search[0] === '?' ? search.slice(1) : search); + const mergedParams = { + ...currentParams, + ...updatedParams, + }; + history.push({ pathname, - search: qs.stringify({ - ...currentParams, - ...updatedParams, - }), + search: qs.stringify( + // drop any parameters that have no value + Object.keys(mergedParams).reduce((params, key) => { + const value = mergedParams[key]; + if (value === undefined || value === '') { + return params; + } + return { + ...params, + [key]: value, + }; + }, {}) + ), }); }; diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/url_params/__tests__/__snapshots__/get_supported_url_params.test.ts.snap b/x-pack/legacy/plugins/uptime/public/lib/helper/url_params/__tests__/__snapshots__/get_supported_url_params.test.ts.snap index 26a408c63419f..5e6e9dd05f722 100644 --- a/x-pack/legacy/plugins/uptime/public/lib/helper/url_params/__tests__/__snapshots__/get_supported_url_params.test.ts.snap +++ b/x-pack/legacy/plugins/uptime/public/lib/helper/url_params/__tests__/__snapshots__/get_supported_url_params.test.ts.snap @@ -9,6 +9,7 @@ Object { "dateRangeEnd": "now", "dateRangeStart": "now-15m", "filters": "", + "pagination": undefined, "search": "", "selectedPingStatus": "", "statusFilter": "", @@ -24,6 +25,7 @@ Object { "dateRangeEnd": "now", "dateRangeStart": "now-15m", "filters": "", + "pagination": undefined, "search": "", "selectedPingStatus": "", "statusFilter": "", @@ -39,6 +41,7 @@ Object { "dateRangeEnd": "now", "dateRangeStart": "now-15m", "filters": "", + "pagination": undefined, "search": "monitor.status: down", "selectedPingStatus": "up", "statusFilter": "", @@ -54,6 +57,7 @@ Object { "dateRangeEnd": "now", "dateRangeStart": "now-15m", "filters": "", + "pagination": undefined, "search": "", "selectedPingStatus": "", "statusFilter": "", @@ -69,6 +73,7 @@ Object { "dateRangeEnd": "now", "dateRangeStart": "now-18d", "filters": "", + "pagination": undefined, "search": "", "selectedPingStatus": "", "statusFilter": "", diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/url_params/get_supported_url_params.ts b/x-pack/legacy/plugins/uptime/public/lib/helper/url_params/get_supported_url_params.ts index 5fd56c3b5a54f..c1382d455313f 100644 --- a/x-pack/legacy/plugins/uptime/public/lib/helper/url_params/get_supported_url_params.ts +++ b/x-pack/legacy/plugins/uptime/public/lib/helper/url_params/get_supported_url_params.ts @@ -16,12 +16,8 @@ export interface UptimeUrlParams { autorefreshIsPaused: boolean; dateRangeStart: string; dateRangeEnd: string; + pagination?: string; filters: string; - // TODO: reintroduce for pagination and sorting - // monitorListPageIndex: number; - // monitorListPageSize: number; - // monitorListSortDirection: string; - // monitorListSortField: string; search: string; selectedPingStatus: string; statusFilter: string; @@ -34,14 +30,9 @@ const { AUTOREFRESH_IS_PAUSED, DATE_RANGE_START, DATE_RANGE_END, - FILTERS, - // TODO: reintroduce for pagination and sorting - // MONITOR_LIST_PAGE_INDEX, - // MONITOR_LIST_PAGE_SIZE, - // MONITOR_LIST_SORT_DIRECTION, - // MONITOR_LIST_SORT_FIELD, SEARCH, SELECTED_PING_LIST_STATUS, + FILTERS, STATUS_FILTER, } = CLIENT_DEFAULTS; @@ -80,14 +71,10 @@ export const getSupportedUrlParams = (params: { dateRangeStart, dateRangeEnd, filters, - // TODO: reintroduce for pagination and sorting - // monitorListPageIndex, - // monitorListPageSize, - // monitorListSortDirection, - // monitorListSortField, search, selectedPingStatus, statusFilter, + pagination, } = filteredParams; return { @@ -104,14 +91,10 @@ export const getSupportedUrlParams = (params: { dateRangeStart: dateRangeStart || DATE_RANGE_START, dateRangeEnd: dateRangeEnd || DATE_RANGE_END, filters: filters || FILTERS, - // TODO: reintroduce for pagination and sorting - // monitorListPageIndex: parseUrlInt(monitorListPageIndex, MONITOR_LIST_PAGE_INDEX), - // monitorListPageSize: parseUrlInt(monitorListPageSize, MONITOR_LIST_PAGE_SIZE), - // monitorListSortDirection: monitorListSortDirection || MONITOR_LIST_SORT_DIRECTION, - // monitorListSortField: monitorListSortField || MONITOR_LIST_SORT_FIELD, search: search || SEARCH, selectedPingStatus: selectedPingStatus === undefined ? SELECTED_PING_LIST_STATUS : selectedPingStatus, statusFilter: statusFilter || STATUS_FILTER, + pagination, }; }; diff --git a/x-pack/legacy/plugins/uptime/public/pages/overview.tsx b/x-pack/legacy/plugins/uptime/public/pages/overview.tsx index 7c1b81b0e15c8..2591fc3d71c4c 100644 --- a/x-pack/legacy/plugins/uptime/public/pages/overview.tsx +++ b/x-pack/legacy/plugins/uptime/public/pages/overview.tsx @@ -65,7 +65,14 @@ export const OverviewPage = ({ const { colors, setHeadingText } = useContext(UptimeSettingsContext); const [getUrlParams, updateUrl] = useUrlParams(); const { absoluteDateRangeStart, absoluteDateRangeEnd, ...params } = getUrlParams(); - const { dateRangeStart, dateRangeEnd, filters: urlFilters, search, statusFilter } = params; + const { + dateRangeStart, + dateRangeEnd, + search, + pagination, + statusFilter, + filters: urlFilters, + } = params; const [indexPattern, setIndexPattern] = useState(undefined); useEffect(() => { @@ -121,16 +128,6 @@ export const OverviewPage = ({ const linkParameters = stringifyUrlParams(params); - // TODO: reintroduce for pagination and sorting - // const onMonitorListChange = ({ page: { index, size }, sort: { field, direction } }: Criteria) => { - // updateUrl({ - // monitorListPageIndex: index, - // monitorListPageSize: size, - // monitorListSortDirection: direction, - // monitorListSortField: field, - // }); - // }; - return ( @@ -143,7 +140,7 @@ export const OverviewPage = ({ currentFilter={urlFilters} onFilterUpdate={(filtersKuery: string) => { if (urlFilters !== filtersKuery) { - updateUrl({ filters: filtersKuery }); + updateUrl({ filters: filtersKuery, pagination: '' }); } }} variables={sharedProps} @@ -174,22 +171,9 @@ export const OverviewPage = ({ implementsCustomErrorState={true} linkParameters={linkParameters} successColor={colors.success} - // TODO: reintegrate pagination in future release - // pageIndex={monitorListPageIndex} - // pageSize={monitorListPageSize} - // TODO: reintegrate sorting in future release - // sortDirection={monitorListSortDirection} - // sortField={monitorListSortField} - // TODO: reintroduce for pagination and sorting - // onChange={onMonitorListChange} variables={{ ...sharedProps, - // TODO: reintegrate pagination in future release - // pageIndex: monitorListPageIndex, - // pageSize: monitorListPageSize, - // TODO: reintegrate sorting in future release - // sortField: monitorListSortField, - // sortDirection: monitorListSortDirection, + pagination, }} /> diff --git a/x-pack/legacy/plugins/uptime/public/queries/monitor_states_query.ts b/x-pack/legacy/plugins/uptime/public/queries/monitor_states_query.ts index 48e7adad4cc9c..76f62ad453bd9 100644 --- a/x-pack/legacy/plugins/uptime/public/queries/monitor_states_query.ts +++ b/x-pack/legacy/plugins/uptime/public/queries/monitor_states_query.ts @@ -7,13 +7,16 @@ import gql from 'graphql-tag'; export const monitorStatesQueryString = ` -query MonitorStates($dateRangeStart: String!, $dateRangeEnd: String!, $filters: String, $statusFilter: String) { +query MonitorStates($dateRangeStart: String!, $dateRangeEnd: String!, $pagination: String, $filters: String, $statusFilter: String) { monitorStates: getMonitorStates( dateRangeStart: $dateRangeStart dateRangeEnd: $dateRangeEnd + pagination: $pagination filters: $filters statusFilter: $statusFilter ) { + prevPagePagination + nextPagePagination totalSummaryCount { count } diff --git a/x-pack/legacy/plugins/uptime/server/graphql/monitor_states/resolvers.ts b/x-pack/legacy/plugins/uptime/server/graphql/monitor_states/resolvers.ts index ba430b5ffe612..8fbf3529dbe24 100644 --- a/x-pack/legacy/plugins/uptime/server/graphql/monitor_states/resolvers.ts +++ b/x-pack/legacy/plugins/uptime/server/graphql/monitor_states/resolvers.ts @@ -12,6 +12,7 @@ import { MonitorSummaryResult, StatesIndexStatus, } from '../../../common/graphql/types'; +import { CONTEXT_DEFAULTS } from '../../../common/constants/context_defaults'; export type UMGetMonitorStatesResolver = UMResolver< MonitorSummaryResult | Promise, @@ -39,28 +40,30 @@ export const createMonitorStatesResolvers: CreateUMGraphQLResolvers = ( Query: { async getMonitorStates( resolver, - { dateRangeStart, dateRangeEnd, filters, statusFilter }, + { dateRangeStart, dateRangeEnd, filters, pagination, statusFilter }, { req } ): Promise { + const decodedPagination = pagination + ? JSON.parse(decodeURIComponent(pagination)) + : CONTEXT_DEFAULTS.CURSOR_PAGINATION; const [ - // TODO: rely on new summaries adapter function once continuous data frame is available - // summaries, totalSummaryCount, - legacySummaries, + { summaries, nextPagePagination, prevPagePagination }, ] = await Promise.all([ - // TODO: rely on new summaries adapter function once continuous data frame is available - // libs.monitorStates.getMonitorStates(req, pageIndex, pageSize, sortField, sortDirection), libs.pings.getDocCount(req), - libs.monitorStates.legacyGetMonitorStates( + libs.monitorStates.getMonitorStates( req, dateRangeStart, dateRangeEnd, + decodedPagination, filters, statusFilter ), ]); return { - summaries: legacySummaries, + summaries, + nextPagePagination, + prevPagePagination, totalSummaryCount, }; }, diff --git a/x-pack/legacy/plugins/uptime/server/graphql/monitor_states/schema.gql.ts b/x-pack/legacy/plugins/uptime/server/graphql/monitor_states/schema.gql.ts index f92a2edf6d9e5..198f97eab9652 100644 --- a/x-pack/legacy/plugins/uptime/server/graphql/monitor_states/schema.gql.ts +++ b/x-pack/legacy/plugins/uptime/server/graphql/monitor_states/schema.gql.ts @@ -149,6 +149,10 @@ export const monitorStatesSchema = gql` "The primary object returned for monitor states." type MonitorSummaryResult { + "Used to go to the next page of results" + prevPagePagination: String + "Used to go to the previous page of results" + nextPagePagination: String "The objects representing the state of a series of heartbeat monitors." summaries: [MonitorSummary!] "The number of summaries." @@ -163,11 +167,22 @@ export const monitorStatesSchema = gql` docCount: DocCount } + enum CursorDirection { + AFTER + BEFORE + } + + enum SortOrder { + ASC + DESC + } + extend type Query { "Fetches the current state of Uptime monitors for the given parameters." getMonitorStates( dateRangeStart: String! dateRangeEnd: String! + pagination: String filters: String statusFilter: String ): MonitorSummaryResult diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/__tests__/__snapshots__/elasticsearch_monitor_states_adapter.test.ts.snap b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/__tests__/__snapshots__/elasticsearch_monitor_states_adapter.test.ts.snap deleted file mode 100644 index 839ff540ec52c..0000000000000 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/__tests__/__snapshots__/elasticsearch_monitor_states_adapter.test.ts.snap +++ /dev/null @@ -1,741 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`ElasticsearchMonitorStatesAdapter applies an appropriate filter section to the query based on filters 1`] = ` -Array [ - Array [ - Object {}, - Object { - "body": Object { - "aggs": Object { - "monitors": Object { - "aggs": Object { - "top": Object { - "top_hits": Object { - "_source": Object { - "includes": Array [ - "monitor.check_group", - "@timestamp", - ], - }, - "size": 1, - "sort": Array [ - Object { - "@timestamp": "desc", - }, - ], - }, - }, - }, - "composite": Object { - "size": 100, - "sources": Array [ - Object { - "monitor_id": Object { - "terms": Object { - "field": "monitor.id", - }, - }, - }, - Object { - "location": Object { - "terms": Object { - "field": "observer.geo.name", - "missing_bucket": true, - }, - }, - }, - ], - }, - }, - }, - "query": Object { - "bool": Object { - "filter": Array [ - Object { - "range": Object { - "@timestamp": Object { - "gte": "now-15m", - "lte": "now", - }, - }, - }, - Object { - "exists": Object { - "field": "summary.up", - }, - }, - Object { - "bool": Object { - "filter": Array [ - Object { - "bool": Object { - "filter": Array [ - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match_phrase": Object { - "monitor.id": "green-0001", - }, - }, - ], - }, - }, - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match_phrase": Object { - "monitor.name": "", - }, - }, - ], - }, - }, - ], - }, - }, - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match": Object { - "monitor.id": "green-0000", - }, - }, - ], - }, - }, - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match": Object { - "monitor.id": "green-0001", - }, - }, - ], - }, - }, - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match": Object { - "monitor.id": "green-0002", - }, - }, - ], - }, - }, - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match": Object { - "monitor.id": "green-0003", - }, - }, - ], - }, - }, - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match": Object { - "monitor.id": "green-0004", - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - "size": 0, - "sort": Array [ - Object { - "@timestamp": "desc", - }, - ], - }, - "index": "heartbeat-8*", - }, - ], - Array [ - Object {}, - Object { - "body": Object { - "aggs": Object { - "monitors": Object { - "aggregations": Object { - "state": Object { - "scripted_metric": Object { - "combine_script": "return state;", - "init_script": " - // Globals are values that should be identical across all docs - // We can cheat a bit by always overwriting these and make the - // assumption that there is no variation in these across checks - state.globals = new HashMap(); - // Here we store stuff broken out by agent.id and monitor.id - // This should correspond to a unique check. - state.checksByAgentIdIP = new HashMap(); - ", - "map_script": " - Map curCheck = new HashMap(); - String agentId = doc[\\"agent.id\\"][0]; - String ip = null; - if (doc[\\"monitor.ip\\"].length > 0) { - ip = doc[\\"monitor.ip\\"][0]; - } - String agentIdIP = agentId + \\"-\\" + (ip == null ? \\"\\" : ip.toString()); - def ts = doc[\\"@timestamp\\"][0].toInstant().toEpochMilli(); - - def lastCheck = state.checksByAgentIdIP[agentId]; - Instant lastTs = lastCheck != null ? lastCheck[\\"@timestamp\\"] : null; - if (lastTs != null && lastTs > ts) { - return; - } - - curCheck.put(\\"@timestamp\\", ts); - - Map agent = new HashMap(); - agent.id = agentId; - curCheck.put(\\"agent\\", agent); - - if (state.globals.url == null) { - Map url = new HashMap(); - Collection fields = [\\"full\\", \\"original\\", \\"scheme\\", \\"username\\", \\"password\\", \\"domain\\", \\"port\\", \\"path\\", \\"query\\", \\"fragment\\"]; - for (field in fields) { - String docPath = \\"url.\\" + field; - def val = doc[docPath]; - if (!val.isEmpty()) { - url[field] = val[0]; - } - } - state.globals.url = url; - } - - Map monitor = new HashMap(); - monitor.status = doc[\\"monitor.status\\"][0]; - monitor.ip = ip; - if (!doc[\\"monitor.name\\"].isEmpty()) { - String monitorName = doc[\\"monitor.name\\"][0]; - if (monitor.name != \\"\\") { - monitor.name = monitorName; - } - } - curCheck.monitor = monitor; - - if (curCheck.observer == null) { - curCheck.observer = new HashMap(); - } - if (curCheck.observer.geo == null) { - curCheck.observer.geo = new HashMap(); - } - if (!doc[\\"observer.geo.name\\"].isEmpty()) { - curCheck.observer.geo.name = doc[\\"observer.geo.name\\"][0]; - } - if (!doc[\\"observer.geo.location\\"].isEmpty()) { - curCheck.observer.geo.location = doc[\\"observer.geo.location\\"][0]; - } - if (!doc[\\"kubernetes.pod.uid\\"].isEmpty() && curCheck.kubernetes == null) { - curCheck.kubernetes = new HashMap(); - curCheck.kubernetes.pod = new HashMap(); - curCheck.kubernetes.pod.uid = doc[\\"kubernetes.pod.uid\\"][0]; - } - if (!doc[\\"container.id\\"].isEmpty() && curCheck.container == null) { - curCheck.container = new HashMap(); - curCheck.container.id = doc[\\"container.id\\"][0]; - } - if (curCheck.tls == null) { - curCheck.tls = new HashMap(); - } - if (!doc[\\"tls.certificate_not_valid_after\\"].isEmpty()) { - curCheck.tls.certificate_not_valid_after = doc[\\"tls.certificate_not_valid_after\\"][0]; - } - if (!doc[\\"tls.certificate_not_valid_before\\"].isEmpty()) { - curCheck.tls.certificate_not_valid_before = doc[\\"tls.certificate_not_valid_before\\"][0]; - } - - state.checksByAgentIdIP[agentIdIP] = curCheck; - ", - "reduce_script": " - // The final document - Map result = new HashMap(); - - Map checks = new HashMap(); - Instant maxTs = Instant.ofEpochMilli(0); - Collection ips = new HashSet(); - Collection geoNames = new HashSet(); - Collection podUids = new HashSet(); - Collection containerIds = new HashSet(); - Collection tls = new HashSet(); - String name = null; - for (state in states) { - result.putAll(state.globals); - for (entry in state.checksByAgentIdIP.entrySet()) { - def agentIdIP = entry.getKey(); - def check = entry.getValue(); - def lastBestCheck = checks.get(agentIdIP); - def checkTs = Instant.ofEpochMilli(check.get(\\"@timestamp\\")); - - if (maxTs.isBefore(checkTs)) { maxTs = checkTs} - - if (lastBestCheck == null || lastBestCheck.get(\\"@timestamp\\") < checkTs) { - check[\\"@timestamp\\"] = check[\\"@timestamp\\"]; - checks[agentIdIP] = check - } - - if (check.monitor.name != null && check.monitor.name != \\"\\") { - name = check.monitor.name; - } - - ips.add(check.monitor.ip); - if (check.observer != null && check.observer.geo != null && check.observer.geo.name != null) { - geoNames.add(check.observer.geo.name); - } - if (check.kubernetes != null && check.kubernetes.pod != null) { - podUids.add(check.kubernetes.pod.uid); - } - if (check.container != null) { - containerIds.add(check.container.id); - } - if (check.tls != null) { - tls.add(check.tls); - } - } - } - - // We just use the values so we can store these as nested docs - result.checks = checks.values(); - result.put(\\"@timestamp\\", maxTs); - - - Map summary = new HashMap(); - summary.up = checks.entrySet().stream().filter(c -> c.getValue().monitor.status == \\"up\\").count(); - summary.down = checks.size() - summary.up; - result.summary = summary; - - Map monitor = new HashMap(); - monitor.ip = ips; - monitor.name = name; - monitor.status = summary.down > 0 ? (summary.up > 0 ? \\"mixed\\": \\"down\\") : \\"up\\"; - result.monitor = monitor; - - Map observer = new HashMap(); - Map geo = new HashMap(); - observer.geo = geo; - geo.name = geoNames; - result.observer = observer; - - if (!podUids.isEmpty()) { - result.kubernetes = new HashMap(); - result.kubernetes.pod = new HashMap(); - result.kubernetes.pod.uid = podUids; - } - - if (!containerIds.isEmpty()) { - result.container = new HashMap(); - result.container.id = containerIds; - } - - if (!tls.isEmpty()) { - result.tls = new HashMap(); - result.tls = tls; - } - - return result; - ", - }, - }, - }, - "composite": Object { - "size": 50, - "sources": Array [ - Object { - "monitor_id": Object { - "terms": Object { - "field": "monitor.id", - }, - }, - }, - ], - }, - }, - }, - "query": Object { - "bool": Object { - "filter": Array [ - Object { - "range": Object { - "@timestamp": Object { - "gte": "now-15m", - "lte": "now", - }, - }, - }, - Object { - "terms": Object { - "monitor.check_group": Array [ - undefined, - undefined, - ], - }, - }, - Object { - "bool": Object { - "filter": Array [ - Object { - "bool": Object { - "filter": Array [ - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match_phrase": Object { - "monitor.id": "green-0001", - }, - }, - ], - }, - }, - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match_phrase": Object { - "monitor.name": "", - }, - }, - ], - }, - }, - ], - }, - }, - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match": Object { - "monitor.id": "green-0000", - }, - }, - ], - }, - }, - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match": Object { - "monitor.id": "green-0001", - }, - }, - ], - }, - }, - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match": Object { - "monitor.id": "green-0002", - }, - }, - ], - }, - }, - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match": Object { - "monitor.id": "green-0003", - }, - }, - ], - }, - }, - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match": Object { - "monitor.id": "green-0004", - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - "size": 0, - "sort": Array [ - Object { - "@timestamp": "desc", - }, - ], - }, - "index": "heartbeat-8*", - }, - ], - Array [ - Object {}, - Object { - "body": Object { - "aggs": Object { - "by_id": Object { - "aggs": Object { - "histogram": Object { - "aggs": Object { - "status": Object { - "terms": Object { - "field": "monitor.status", - "shard_size": 2, - "size": 2, - }, - }, - }, - "date_histogram": Object { - "field": "@timestamp", - "fixed_interval": "36000ms", - "missing": 0, - }, - }, - }, - "terms": Object { - "field": "monitor.id", - "size": 50, - }, - }, - }, - "query": Object { - "bool": Object { - "filter": Array [ - Object { - "terms": Object { - "monitor.id": Array [ - "auto-http-0X21EE76EAC459873F", - "auto-http-0X2AF1D7DB9C490053", - ], - }, - }, - Object { - "range": Object { - "@timestamp": Object { - "gte": "now-15m", - "lte": "now", - }, - }, - }, - ], - }, - }, - "size": 0, - }, - "index": "heartbeat-8*", - }, - ], -] -`; - -exports[`ElasticsearchMonitorStatesAdapter returns properly formatted objects from raw es documents 1`] = ` -Array [ - Object { - "histogram": undefined, - "monitor_id": "auto-http-0X21EE76EAC459873F", - "state": Object { - "@timestamp": "2019-06-26T13:42:42.535Z", - "checks": Array [ - Object { - "@timestamp": 1561556562535, - "agent": Object { - "id": "5884d7f7-9a49-4b0e-bff2-72a475aa695f", - }, - "monitor": Object { - "ip": "127.0.0.1", - "name": "test-page", - "status": "down", - }, - "observer": Object { - "geo": Object { - "location": Object { - "lat": 39.952599965035915, - "lon": 75.1651999913156, - }, - "name": "us-east-2", - }, - }, - "timestamp": 1561556562535, - }, - ], - "monitor": Object { - "ip": Array [ - "127.0.0.1", - ], - "status": "down", - }, - "observer": Object { - "geo": Object { - "name": Array [ - "us-east-2", - ], - }, - }, - "summary": Object { - "down": 1, - "up": 0, - }, - "timestamp": "2019-06-26T13:42:42.535Z", - "url": Object { - "domain": "localhost", - "full": "http://localhost:12349/test-page", - "path": "/test-page", - "port": 12349, - "scheme": "http", - }, - }, - }, - Object { - "histogram": undefined, - "monitor_id": "auto-http-0X2AF1D7DB9C490053", - "state": Object { - "@timestamp": "2019-06-26T13:42:21.536Z", - "checks": Array [ - Object { - "@timestamp": 1561556541536, - "agent": Object { - "id": "5884d7f7-9a49-4b0e-bff2-72a475aa695f", - }, - "monitor": Object { - "ip": "35.245.22.113", - "name": "prod-site", - "status": "down", - }, - "observer": Object { - "geo": Object { - "location": Object { - "lat": 39.952599965035915, - "lon": 75.1651999913156, - }, - "name": "us-east-2", - }, - }, - "timestamp": 1561556541536, - }, - ], - "monitor": Object { - "ip": Array [ - "35.245.22.113", - ], - "status": "down", - }, - "observer": Object { - "geo": Object { - "name": Array [ - "us-east-2", - ], - }, - }, - "summary": Object { - "down": 1, - "up": 0, - }, - "timestamp": "2019-06-26T13:42:21.536Z", - "tls": Array [ - Object { - "certificate_not_valid_after": "2019-11-09T18:04:06.000Z", - "certificate_not_valid_before": "2019-11-08T17:03:23.000Z", - }, - ], - "url": Object { - "domain": "35.245.22.113", - "full": "http://35.245.22.113:12349/", - "path": "/", - "port": 12349, - "scheme": "http", - }, - }, - }, -] -`; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/__tests__/elasticsearch_monitor_states_adapter.test.ts b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/__tests__/elasticsearch_monitor_states_adapter.test.ts deleted file mode 100644 index 1a90699090b29..0000000000000 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/__tests__/elasticsearch_monitor_states_adapter.test.ts +++ /dev/null @@ -1,75 +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; - * you may not use this file except in compliance with the Elastic License. - */ - -import { DatabaseAdapter } from '../../database'; -import exampleFilter from './example_filter.json'; -import monitorState from './monitor_states_docs.json'; -import { ElasticsearchMonitorStatesAdapter } from '../elasticsearch_monitor_states_adapter'; -import { get, set } from 'lodash'; -import { assertCloseTo } from '../../../helper'; - -describe('ElasticsearchMonitorStatesAdapter', () => { - let database: DatabaseAdapter; - let searchMock: jest.Mock, [any, any]>; - beforeAll(() => { - database = { - count: jest.fn(async (request: any, params: any): Promise => 0), - search: jest.fn(async (request: any, params: any): Promise => {}), - head: jest.fn(async (request: any, params: any): Promise => {}), - }; - }); - - beforeEach(() => { - searchMock = jest.fn(async (request: any, params: any): Promise => monitorState); - database.search = searchMock; - }); - - afterAll(() => { - jest.clearAllMocks(); - }); - - it('returns properly formatted objects from raw es documents', async () => { - expect.assertions(1); - const adapter = new ElasticsearchMonitorStatesAdapter(database); - const result = await adapter.legacyGetMonitorStates({}, 'now-15m', 'now'); - expect(result).toMatchSnapshot(); - }); - - it('applies an appropriate filter section to the query based on filters', async () => { - expect.assertions(3); - const adapter = new ElasticsearchMonitorStatesAdapter(database); - await adapter.legacyGetMonitorStates( - {}, - 'now-15m', - 'now', - JSON.stringify(exampleFilter), - 'down' - ); - expect(searchMock).toHaveBeenCalledTimes(3); - const fixedInterval = parseInt( - get( - searchMock.mock.calls[2][1], - 'body.aggs.by_id.aggs.histogram.date_histogram.fixed_interval', - '' - ).split('ms')[0], - 10 - ); - expect(fixedInterval).not.toBeNaN(); - /** - * This value can sometimes be off by 1 as a result of fuzzy calculation. - * - * It had no implications in practice, but from a test standpoint can cause flaky - * snapshot failures. - */ - assertCloseTo(fixedInterval, 36000, 100); - set( - searchMock.mock.calls[2][1], - 'body.aggs.by_id.aggs.histogram.date_histogram.fixed_interval', - '36000ms' - ); - expect(searchMock.mock.calls).toMatchSnapshot(); - }); -}); diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/__tests__/monitor_states_docs.json b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/__tests__/monitor_states_docs.json deleted file mode 100644 index 9566a338460fe..0000000000000 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/__tests__/monitor_states_docs.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "took": 71, - "timed_out": false, - "_shards": { - "total": 1, - "successful": 1, - "skipped": 0, - "failed": 0 - }, - "hits": { - "total": { - "value": 6561, - "relation": "eq" - }, - "max_score": null, - "hits": [] - }, - "aggregations": { - "monitors": { - "after_key": null, - "buckets": [ - { - "key": { - "monitor_id": "auto-http-0X21EE76EAC459873F" - }, - "doc_count": 899, - "state": { - "value": { - "summary": { - "up": 0, - "down": 1 - }, - "observer": { - "geo": { - "name": ["us-east-2"] - } - }, - "monitor": { - "ip": ["127.0.0.1"], - "status": "down" - }, - "checks": [ - { - "observer": { - "geo": { - "name": "us-east-2", - "location": { - "lat": 39.952599965035915, - "lon": 75.1651999913156 - } - } - }, - "agent": { - "id": "5884d7f7-9a49-4b0e-bff2-72a475aa695f" - }, - "@timestamp": 1561556562535, - "monitor": { - "ip": "127.0.0.1", - "name": "test-page", - "status": "down" - } - } - ], - "@timestamp": "2019-06-26T13:42:42.535Z", - "url": { - "path": "/test-page", - "scheme": "http", - "port": 12349, - "domain": "localhost", - "full": "http://localhost:12349/test-page" - } - } - } - }, - { - "key": { - "monitor_id": "auto-http-0X2AF1D7DB9C490053" - }, - "doc_count": 52, - "state": { - "value": { - "summary": { - "up": 0, - "down": 1 - }, - "observer": { - "geo": { - "name": ["us-east-2"] - } - }, - "monitor": { - "ip": ["35.245.22.113"], - "status": "down" - }, - "checks": [ - { - "observer": { - "geo": { - "name": "us-east-2", - "location": { - "lat": 39.952599965035915, - "lon": 75.1651999913156 - } - } - }, - "agent": { - "id": "5884d7f7-9a49-4b0e-bff2-72a475aa695f" - }, - "@timestamp": 1561556541536, - "monitor": { - "ip": "35.245.22.113", - "name": "prod-site", - "status": "down" - } - } - ], - "tls": [ - { - "certificate_not_valid_after": "2019-11-09T18:04:06.000Z", - "certificate_not_valid_before": "2019-11-08T17:03:23.000Z" - } - ], - "@timestamp": "2019-06-26T13:42:21.536Z", - "url": { - "path": "/", - "scheme": "http", - "port": 12349, - "domain": "35.245.22.113", - "full": "http://35.245.22.113:12349/" - } - } - } - } - ] - } - } -} diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/adapter_types.ts b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/adapter_types.ts index 4751329b1ff3a..781f30314d350 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/adapter_types.ts +++ b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/adapter_types.ts @@ -4,33 +4,50 @@ * you may not use this file except in compliance with the Elastic License. */ -import { MonitorSummary, StatesIndexStatus } from '../../../../common/graphql/types'; +import { + MonitorSummary, + StatesIndexStatus, + CursorDirection, + SortOrder, +} from '../../../../common/graphql/types'; export interface UMMonitorStatesAdapter { getMonitorStates( - request: any, - pageIndex: number, - pageSize: number, - sortField?: string | null, - sortDirection?: string | null - ): Promise; - legacyGetMonitorStates( request: any, dateRangeStart: string, dateRangeEnd: string, + pagination?: CursorPagination, filters?: string | null, statusFilter?: string | null - ): Promise; + ): Promise; statesIndexExists(request: any): Promise; } +export interface CursorPagination { + cursorKey?: any; + cursorDirection: CursorDirection; + sortOrder: SortOrder; +} + +export interface GetMonitorStatesResult { + summaries: MonitorSummary[]; + nextPagePagination: string | null; + prevPagePagination: string | null; +} + export interface LegacyMonitorStatesQueryResult { result: any; statusFilter?: any; - afterKey: any | null; + searchAfter: any; } -export interface LegacyMonitorStatesRecentCheckGroupsQueryResult { +export interface MonitorStatesCheckGroupsResult { checkGroups: string[]; - afterKey: any | null; + searchAfter: any; +} + +export interface EnrichMonitorStatesResult { + monitors: any[]; + nextPagePagination: any | null; + prevPagePagination: any | null; } diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/elasticsearch_monitor_states_adapter.ts b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/elasticsearch_monitor_states_adapter.ts index 3ee25001445a5..59c3e022e7d04 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/elasticsearch_monitor_states_adapter.ts +++ b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/elasticsearch_monitor_states_adapter.ts @@ -4,607 +4,57 @@ * you may not use this file except in compliance with the Elastic License. */ -import { get, flatten, set, sortBy } from 'lodash'; import { DatabaseAdapter } from '../database'; -import { - UMMonitorStatesAdapter, - LegacyMonitorStatesRecentCheckGroupsQueryResult, - LegacyMonitorStatesQueryResult, -} from './adapter_types'; -import { - MonitorSummary, - SummaryHistogram, - Check, - StatesIndexStatus, -} from '../../../../common/graphql/types'; -import { INDEX_NAMES, STATES, QUERY } from '../../../../common/constants'; -import { getHistogramInterval, parseFilterQuery, getFilterClause } from '../../helper'; - -type SortChecks = (check: Check) => string[]; -const checksSortBy = (check: Check) => [ - get(check, 'observer.geo.name'), - get(check, 'monitor.ip'), -]; +import { UMMonitorStatesAdapter, GetMonitorStatesResult, CursorPagination } from './adapter_types'; +import { StatesIndexStatus } from '../../../../common/graphql/types'; +import { INDEX_NAMES, CONTEXT_DEFAULTS } from '../../../../common/constants'; +import { fetchPage } from './search'; + +export interface QueryContext { + database: any; + request: any; + dateRangeStart: string; + dateRangeEnd: string; + pagination: CursorPagination; + filterClause: any | null; + size: number; + statusFilter?: string; +} export class ElasticsearchMonitorStatesAdapter implements UMMonitorStatesAdapter { constructor(private readonly database: DatabaseAdapter) { this.database = database; } - // This query returns the most recent check groups for a given - // monitor ID. - private async runLegacyMonitorStatesRecentCheckGroupsQuery( - request: any, - query: any, - dateRangeStart: string, - dateRangeEnd: string, - searchAfter?: any, - size: number = 50 - ): Promise { - const checkGroupsById = new Map(); - let afterKey: any = searchAfter; - - const additionalFilters = [ - { - // We check for summary.up to ensure that the check group - // is complete. Summary fields are only present on - // completed check groups. - exists: { - field: 'summary.up', - }, - }, - ]; - if (query) { - additionalFilters.push(query); - } - const filter = getFilterClause(dateRangeStart, dateRangeEnd, additionalFilters); - - const body = { - query: { - bool: { - filter, - }, - }, - sort: [ - { - '@timestamp': 'desc', - }, - ], - size: 0, - aggs: { - monitors: { - composite: { - /** - * The goal here is to fetch more than enough check groups to reach the target - * amount in one query. - * - * For larger cardinalities, we can only count on being able to fetch max bucket - * size, so we will have to run this query multiple times. - * - * Multiplying `size` by 2 assumes that there will be less than three locations - * for the deployment, if needed the query will be run subsequently. - */ - size: Math.min(size * 2, QUERY.DEFAULT_AGGS_CAP), - sources: [ - { - monitor_id: { - terms: { - field: 'monitor.id', - }, - }, - }, - { - location: { - terms: { - field: 'observer.geo.name', - missing_bucket: true, - }, - }, - }, - ], - }, - aggs: { - top: { - top_hits: { - sort: [ - { - '@timestamp': 'desc', - }, - ], - _source: { - includes: ['monitor.check_group', '@timestamp'], - }, - size: 1, - }, - }, - }, - }, - }, - }; - if (afterKey) { - set(body, 'aggs.monitors.composite.after', afterKey); - } - const params = { - index: INDEX_NAMES.HEARTBEAT, - body, - }; - - const result = await this.database.search(request, params); - afterKey = get(result, 'aggregations.monitors.after_key', null); - get(result, 'aggregations.monitors.buckets', []).forEach((bucket: any) => { - const id = get(bucket, 'key.monitor_id'); - const checkGroup = get(bucket, 'top.hits.hits[0]._source.monitor.check_group'); - const value = checkGroupsById.get(id); - if (!value) { - checkGroupsById.set(id, [checkGroup]); - } else if (value.indexOf(checkGroup) < 0) { - checkGroupsById.set(id, [...value, checkGroup]); - } - }); - return { - checkGroups: flatten(Array.from(checkGroupsById.values())), - afterKey, - }; - } - - private async runLegacyMonitorStatesQuery( - request: any, - dateRangeStart: string, - dateRangeEnd: string, - filters?: string | null, - searchAfter?: any, - size: number = 50 - ): Promise { - size = Math.min(size, QUERY.DEFAULT_AGGS_CAP); - const query = parseFilterQuery(filters); - - // First we fetch the most recent check groups for this query - // This is a critical performance optimization. - // Without this the expensive scripted_metric agg below will run - // over large numbers of documents. - // It only really needs to run over the latest complete check group for each - // agent. - const { checkGroups, afterKey } = await this.runLegacyMonitorStatesRecentCheckGroupsQuery( - request, - query, - dateRangeStart, - dateRangeEnd, - searchAfter, - size - ); - const additionalFilters = [{ terms: { 'monitor.check_group': checkGroups } }]; - if (query) { - // Even though this work is already done when calculating the groups - // this helps the planner - additionalFilters.push(query); - } - const filter = getFilterClause(dateRangeStart, dateRangeEnd, additionalFilters); - const params = { - index: INDEX_NAMES.HEARTBEAT, - body: { - query: { - bool: { - filter, - }, - }, - sort: [{ '@timestamp': 'desc' }], - size: 0, - aggs: { - monitors: { - composite: { - size, - sources: [ - { - monitor_id: { - terms: { - field: 'monitor.id', - }, - }, - }, - ], - }, - aggregations: { - state: { - scripted_metric: { - init_script: ` - // Globals are values that should be identical across all docs - // We can cheat a bit by always overwriting these and make the - // assumption that there is no variation in these across checks - state.globals = new HashMap(); - // Here we store stuff broken out by agent.id and monitor.id - // This should correspond to a unique check. - state.checksByAgentIdIP = new HashMap(); - `, - map_script: ` - Map curCheck = new HashMap(); - String agentId = doc["agent.id"][0]; - String ip = null; - if (doc["monitor.ip"].length > 0) { - ip = doc["monitor.ip"][0]; - } - String agentIdIP = agentId + "-" + (ip == null ? "" : ip.toString()); - def ts = doc["@timestamp"][0].toInstant().toEpochMilli(); - - def lastCheck = state.checksByAgentIdIP[agentId]; - Instant lastTs = lastCheck != null ? lastCheck["@timestamp"] : null; - if (lastTs != null && lastTs > ts) { - return; - } - - curCheck.put("@timestamp", ts); - - Map agent = new HashMap(); - agent.id = agentId; - curCheck.put("agent", agent); - - if (state.globals.url == null) { - Map url = new HashMap(); - Collection fields = ["full", "original", "scheme", "username", "password", "domain", "port", "path", "query", "fragment"]; - for (field in fields) { - String docPath = "url." + field; - def val = doc[docPath]; - if (!val.isEmpty()) { - url[field] = val[0]; - } - } - state.globals.url = url; - } - - Map monitor = new HashMap(); - monitor.status = doc["monitor.status"][0]; - monitor.ip = ip; - if (!doc["monitor.name"].isEmpty()) { - String monitorName = doc["monitor.name"][0]; - if (monitor.name != "") { - monitor.name = monitorName; - } - } - curCheck.monitor = monitor; - - if (curCheck.observer == null) { - curCheck.observer = new HashMap(); - } - if (curCheck.observer.geo == null) { - curCheck.observer.geo = new HashMap(); - } - if (!doc["observer.geo.name"].isEmpty()) { - curCheck.observer.geo.name = doc["observer.geo.name"][0]; - } - if (!doc["observer.geo.location"].isEmpty()) { - curCheck.observer.geo.location = doc["observer.geo.location"][0]; - } - if (!doc["kubernetes.pod.uid"].isEmpty() && curCheck.kubernetes == null) { - curCheck.kubernetes = new HashMap(); - curCheck.kubernetes.pod = new HashMap(); - curCheck.kubernetes.pod.uid = doc["kubernetes.pod.uid"][0]; - } - if (!doc["container.id"].isEmpty() && curCheck.container == null) { - curCheck.container = new HashMap(); - curCheck.container.id = doc["container.id"][0]; - } - if (curCheck.tls == null) { - curCheck.tls = new HashMap(); - } - if (!doc["tls.certificate_not_valid_after"].isEmpty()) { - curCheck.tls.certificate_not_valid_after = doc["tls.certificate_not_valid_after"][0]; - } - if (!doc["tls.certificate_not_valid_before"].isEmpty()) { - curCheck.tls.certificate_not_valid_before = doc["tls.certificate_not_valid_before"][0]; - } - - state.checksByAgentIdIP[agentIdIP] = curCheck; - `, - combine_script: 'return state;', - reduce_script: ` - // The final document - Map result = new HashMap(); - - Map checks = new HashMap(); - Instant maxTs = Instant.ofEpochMilli(0); - Collection ips = new HashSet(); - Collection geoNames = new HashSet(); - Collection podUids = new HashSet(); - Collection containerIds = new HashSet(); - Collection tls = new HashSet(); - String name = null; - for (state in states) { - result.putAll(state.globals); - for (entry in state.checksByAgentIdIP.entrySet()) { - def agentIdIP = entry.getKey(); - def check = entry.getValue(); - def lastBestCheck = checks.get(agentIdIP); - def checkTs = Instant.ofEpochMilli(check.get("@timestamp")); - - if (maxTs.isBefore(checkTs)) { maxTs = checkTs} - - if (lastBestCheck == null || lastBestCheck.get("@timestamp") < checkTs) { - check["@timestamp"] = check["@timestamp"]; - checks[agentIdIP] = check - } - - if (check.monitor.name != null && check.monitor.name != "") { - name = check.monitor.name; - } - - ips.add(check.monitor.ip); - if (check.observer != null && check.observer.geo != null && check.observer.geo.name != null) { - geoNames.add(check.observer.geo.name); - } - if (check.kubernetes != null && check.kubernetes.pod != null) { - podUids.add(check.kubernetes.pod.uid); - } - if (check.container != null) { - containerIds.add(check.container.id); - } - if (check.tls != null) { - tls.add(check.tls); - } - } - } - - // We just use the values so we can store these as nested docs - result.checks = checks.values(); - result.put("@timestamp", maxTs); - - - Map summary = new HashMap(); - summary.up = checks.entrySet().stream().filter(c -> c.getValue().monitor.status == "up").count(); - summary.down = checks.size() - summary.up; - result.summary = summary; - - Map monitor = new HashMap(); - monitor.ip = ips; - monitor.name = name; - monitor.status = summary.down > 0 ? (summary.up > 0 ? "mixed": "down") : "up"; - result.monitor = monitor; - - Map observer = new HashMap(); - Map geo = new HashMap(); - observer.geo = geo; - geo.name = geoNames; - result.observer = observer; - - if (!podUids.isEmpty()) { - result.kubernetes = new HashMap(); - result.kubernetes.pod = new HashMap(); - result.kubernetes.pod.uid = podUids; - } - - if (!containerIds.isEmpty()) { - result.container = new HashMap(); - result.container.id = containerIds; - } - - if (!tls.isEmpty()) { - result.tls = new HashMap(); - result.tls = tls; - } - - return result; - `, - }, - }, - }, - }, - }, - }, - }; - - const result = await this.database.search(request, params); - return { afterKey, result }; - } - - private getMonitorBuckets(queryResult: any, statusFilter?: any) { - let monitors = get(queryResult, 'aggregations.monitors.buckets', []); - if (statusFilter) { - monitors = monitors.filter( - (monitor: any) => get(monitor, 'state.value.monitor.status') === statusFilter - ); - } - return monitors; - } - - public async legacyGetMonitorStates( + // Gets a page of monitor states. + public async getMonitorStates( request: any, dateRangeStart: string, dateRangeEnd: string, + pagination: CursorPagination = CONTEXT_DEFAULTS.CURSOR_PAGINATION, filters?: string | null, - statusFilter?: string | null - ): Promise { - const monitors: any[] = []; - let searchAfter: any | null = null; - do { - const { result, afterKey } = await this.runLegacyMonitorStatesQuery( - request, - dateRangeStart, - dateRangeEnd, - filters, - searchAfter - ); - monitors.push(...this.getMonitorBuckets(result, statusFilter)); - searchAfter = afterKey; - } while (searchAfter !== null && monitors.length < STATES.LEGACY_STATES_QUERY_SIZE); + statusFilter?: string + ): Promise { + const size = 10; - const monitorIds: string[] = []; - const summaries: MonitorSummary[] = monitors.map((monitor: any) => { - const monitorId = get(monitor, 'key.monitor_id'); - monitorIds.push(monitorId); - let state = get(monitor, 'state.value'); - state = { - ...state, - timestamp: state['@timestamp'], - }; - const { checks } = state; - if (checks) { - state.checks = sortBy(checks, checksSortBy); - state.checks = state.checks.map((check: any) => ({ - ...check, - timestamp: check['@timestamp'], - })); - } else { - state.checks = []; - } - return { - monitor_id: monitorId, - state, - }; - }); - const histogramMap = await this.getHistogramForMonitors( + const queryContext: QueryContext = { + database: this.database, request, dateRangeStart, dateRangeEnd, - monitorIds - ); - return summaries.map(summary => ({ - ...summary, - histogram: histogramMap[summary.monitor_id], - })); - } - - public async getMonitorStates( - request: any, - pageIndex: number, - pageSize: number, - sortField?: string | null, - sortDirection?: string | null - ): Promise { - const params = { - index: INDEX_NAMES.HEARTBEAT_STATES, - body: { - from: pageIndex * pageSize, - size: pageSize, - }, + pagination, + filterClause: filters && filters !== '' ? JSON.parse(filters) : null, + size, + statusFilter, }; - if (sortField) { - set(params, 'body.sort', [ - { - [sortField]: { - order: sortDirection || 'asc', - }, - }, - ]); - } - - const result = await this.database.search(request, params); - const hits = get(result, 'hits.hits', []); - const monitorIds: string[] = []; - const monitorStates = hits.map(({ _source }: any) => { - const { monitor_id } = _source; - monitorIds.push(monitor_id); - const sourceState = get(_source, 'state'); - const state = { - ...sourceState, - timestamp: sourceState['@timestamp'], - }; - if (state.checks) { - state.checks = sortBy(state.checks, checksSortBy).map( - (check: any): Check => ({ - ...check, - timestamp: check['@timestamp'], - }) - ); - } else { - state.checks = []; - } - return { - monitor_id, - state, - }; - }); + const page = await fetchPage(queryContext); - const histogramMap = await this.getHistogramForMonitors(request, 'now-15m', 'now', monitorIds); - return monitorStates.map(monitorState => ({ - ...monitorState, - histogram: histogramMap[monitorState.monitor_id], - })); - } - - private async getHistogramForMonitors( - request: any, - dateRangeStart: string, - dateRangeEnd: string, - monitorIds: string[] - ): Promise<{ [key: string]: SummaryHistogram }> { - const params = { - index: INDEX_NAMES.HEARTBEAT, - body: { - size: 0, - query: { - bool: { - filter: [ - { - terms: { - 'monitor.id': monitorIds, - }, - }, - { - range: { - '@timestamp': { - gte: dateRangeStart, - lte: dateRangeEnd, - }, - }, - }, - ], - }, - }, - aggs: { - by_id: { - terms: { - field: 'monitor.id', - size: STATES.LEGACY_STATES_QUERY_SIZE, - }, - aggs: { - histogram: { - date_histogram: { - field: '@timestamp', - fixed_interval: getHistogramInterval(dateRangeStart, dateRangeEnd), - missing: 0, - }, - aggs: { - status: { - terms: { - field: 'monitor.status', - size: 2, - shard_size: 2, - }, - }, - }, - }, - }, - }, - }, - }, + return { + summaries: page.items, + nextPagePagination: jsonifyPagination(page.nextPagePagination), + prevPagePagination: jsonifyPagination(page.prevPagePagination), }; - const result = await this.database.search(request, params); - - const buckets: any[] = get(result, 'aggregations.by_id.buckets', []); - return buckets.reduce((map: { [key: string]: any }, item: any) => { - const points = get(item, 'histogram.buckets', []).map((histogram: any) => { - const status = get(histogram, 'status.buckets', []).reduce( - (statuses: { up: number; down: number }, bucket: any) => { - if (bucket.key === 'up') { - statuses.up = bucket.doc_count; - } else if (bucket.key === 'down') { - statuses.down = bucket.doc_count; - } - return statuses; - }, - { up: 0, down: 0 } - ); - return { - timestamp: histogram.key, - ...status, - }; - }); - - map[item.key] = { - count: item.doc_count, - points, - }; - return map; - }, {}); } public async statesIndexExists(request: any): Promise { @@ -621,3 +71,12 @@ export class ElasticsearchMonitorStatesAdapter implements UMMonitorStatesAdapter }; } } + +// To simplify the handling of the group of pagination vars they're passed back to the client as a string +const jsonifyPagination = (p: any): string | null => { + if (!p) { + return null; + } + + return JSON.stringify(p); +}; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/fetch_page.test.ts b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/fetch_page.test.ts new file mode 100644 index 0000000000000..d571a5a902539 --- /dev/null +++ b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/fetch_page.test.ts @@ -0,0 +1,86 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { + fetchPage, + MonitorEnricher, + MonitorGroups, + MonitorGroupsFetcher, + MonitorGroupsPage, +} from '../fetch_page'; +import { QueryContext } from '../../elasticsearch_monitor_states_adapter'; +import { MonitorSummary } from '../../../../../../common/graphql/types'; +import { nextPagination, prevPagination, simpleQueryContext } from './test_helpers'; + +const simpleFixture: MonitorGroups[] = [ + { + id: 'foo', + groups: [ + { + monitorId: 'foo', + location: 'foo-loc', + checkGroup: 'foo-check', + status: 'up', + summaryTimestamp: new Date(), + }, + ], + }, + { + id: 'bar', + groups: [ + { + monitorId: 'bar', + location: 'bar-loc', + checkGroup: 'bar-check', + status: 'down', + summaryTimestamp: new Date(), + }, + ], + }, +]; + +const simpleFetcher = (monitorGroups: MonitorGroups[]): MonitorGroupsFetcher => { + return async (queryContext: QueryContext, size: number): Promise => { + return { + monitorGroups, + prevPagePagination: prevPagination(monitorGroups[0].id), + nextPagePagination: nextPagination(monitorGroups[monitorGroups.length - 1].id), + }; + }; +}; + +const simpleEnricher = (monitorGroups: MonitorGroups[]): MonitorEnricher => { + return async (queryContext: QueryContext, checkGroups: string[]): Promise => { + return checkGroups.map(cg => { + const monitorGroup = monitorGroups.find(mg => mg.groups.some(g => g.checkGroup === cg))!; + return { + monitor_id: monitorGroup.id, + state: { summary: {}, timestamp: new Date(Date.parse('1999-12-31')).toISOString() }, + }; + }); + }; +}; + +describe('fetching a page', () => { + it('returns the enriched groups', async () => { + const res = await fetchPage( + simpleQueryContext(), + simpleFetcher(simpleFixture), + simpleEnricher(simpleFixture) + ); + expect(res).toEqual({ + items: [ + { + monitor_id: 'foo', + state: { summary: {}, timestamp: '1999-12-31T00:00:00.000Z' }, + }, + { monitor_id: 'bar', state: { summary: {}, timestamp: '1999-12-31T00:00:00.000Z' } }, + ], + nextPagePagination: { cursorDirection: 'AFTER', sortOrder: 'ASC', cursorKey: 'bar' }, + prevPagePagination: { cursorDirection: 'BEFORE', sortOrder: 'ASC', cursorKey: 'foo' }, + }); + }); +}); diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/find_potential_matches_test.ts b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/find_potential_matches_test.ts new file mode 100644 index 0000000000000..41bc2aa258807 --- /dev/null +++ b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/find_potential_matches_test.ts @@ -0,0 +1,5 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/monitor_group_iterator.test.ts b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/monitor_group_iterator.test.ts new file mode 100644 index 0000000000000..b8df3b635dc6b --- /dev/null +++ b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/monitor_group_iterator.test.ts @@ -0,0 +1,100 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { + CHUNK_SIZE, + ChunkFetcher, + ChunkResult, + MonitorGroupIterator, +} from '../monitor_group_iterator'; +import { simpleQueryContext } from './test_helpers'; +import { QueryContext } from '../../elasticsearch_monitor_states_adapter'; +import { MonitorGroups } from '../fetch_page'; + +describe('iteration', () => { + let iterator: MonitorGroupIterator | null = null; + let fetched: MonitorGroups[]; + + const setup = async (numGroups: number) => { + fetched = []; + const expectedMonitorGroups = makeMonitorGroups(numGroups); + const chunkFetcher = mockChunkFetcher(expectedMonitorGroups); + iterator = new MonitorGroupIterator(simpleQueryContext(), [], -1, chunkFetcher); + + while (true) { + const got = await iterator.next(); + if (got) { + fetched.push(got); + } else { + break; + } + } + }; + + describe('matching', () => { + [ + { name: 'zero results', numGroups: 0 }, + { name: 'one result', numGroups: 1 }, + { name: 'less than chunk', numGroups: CHUNK_SIZE - 1 }, + { name: 'multiple full chunks', numGroups: CHUNK_SIZE * 3 }, + { name: 'multiple full chunks + partial', numGroups: CHUNK_SIZE * 3 + 3 }, + ].forEach(({ name, numGroups }) => { + describe(`scenario given ${name}`, () => { + beforeEach(async () => { + await setup(numGroups); + }); + + it('should receive the expected number of results', () => { + expect(fetched.length).toEqual(numGroups); + }); + + it('should have no remaining pages', async () => { + expect(await iterator!.paginationAfterCurrent()).toBeNull(); + }); + }); + }); + }); +}); + +const makeMonitorGroups = (count: number): MonitorGroups[] => { + const groups: MonitorGroups[] = []; + for (let i = 0; i < count; i++) { + const id = `monitor-${i}`; + + groups.push({ + id, + groups: [ + { + monitorId: id, + location: 'a-location', + status: 'up', + checkGroup: `check-group-${i}`, + summaryTimestamp: new Date(), + }, + ], + }); + } + return groups; +}; + +const mockChunkFetcher = (groups: MonitorGroups[]): ChunkFetcher => { + const buffer = groups.slice(0); // Clone it since we'll modify it + return async ( + queryContext: QueryContext, + searchAfter: any, + size: number + ): Promise => { + const resultMonitorGroups = buffer.splice(0, size); + const resultSearchAfter = + buffer.length === 0 + ? null + : { monitor_id: resultMonitorGroups[resultMonitorGroups.length - 1].id }; + return { + monitorGroups: resultMonitorGroups, + searchAfter: resultSearchAfter, + }; + }; +}; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/test_helpers.ts b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/test_helpers.ts new file mode 100644 index 0000000000000..0c3572604879e --- /dev/null +++ b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/test_helpers.ts @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { CursorPagination } from '../../adapter_types'; +import { CursorDirection, SortOrder } from '../../../../../../common/graphql/types'; +import { QueryContext } from '../../elasticsearch_monitor_states_adapter'; + +export const prevPagination = (key: any): CursorPagination => { + return { + cursorDirection: CursorDirection.BEFORE, + sortOrder: SortOrder.ASC, + cursorKey: key, + }; +}; +export const nextPagination = (key: any): CursorPagination => { + return { + cursorDirection: CursorDirection.AFTER, + sortOrder: SortOrder.ASC, + cursorKey: key, + }; +}; +export const simpleQueryContext = (): QueryContext => { + return { + database: undefined, + dateRangeEnd: '', + dateRangeStart: '', + filterClause: undefined, + pagination: nextPagination('something'), + request: undefined, + size: 0, + statusFilter: '', + }; +}; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/enrich_monitor_groups.ts b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/enrich_monitor_groups.ts new file mode 100644 index 0000000000000..2518264292cbd --- /dev/null +++ b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/enrich_monitor_groups.ts @@ -0,0 +1,386 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { get, sortBy } from 'lodash'; +import { QueryContext } from '../elasticsearch_monitor_states_adapter'; +import { getHistogramInterval } from '../../../helper'; +import { INDEX_NAMES, STATES } from '../../../../../common/constants'; +import { + MonitorSummary, + SummaryHistogram, + Check, + CursorDirection, + SortOrder, +} from '../../../../../common/graphql/types'; +import { MonitorEnricher } from './fetch_page'; + +export const enrichMonitorGroups: MonitorEnricher = async ( + queryContext: QueryContext, + checkGroups: string[] +): Promise => { + // TODO the scripted metric query here is totally unnecessary and largely + // redundant with the way the code works now. This could be simplified + // to a much simpler query + some JS processing. + const params = { + index: INDEX_NAMES.HEARTBEAT, + body: { + query: { + bool: { + filter: [{ terms: { 'monitor.check_group': checkGroups } }], + }, + }, + size: 0, + aggs: { + monitors: { + composite: { + /** + * TODO: extract this to a constant; we can't be looking for _only_ + * ten monitors, because it's possible our check groups selection will represent more than ten. + * + * We were previously passing the after key from the check groups query regardless of the number of monitors we had, + * it's important that the latest check group from the final monitor we use is what we return, or we will be way ahead in terms + * of check groups and end up skipping monitors on subsequent calls. + */ + size: 500, + sources: [ + { + monitor_id: { + terms: { + field: 'monitor.id', + order: cursorDirectionToOrder(queryContext.pagination.cursorDirection), + }, + }, + }, + ], + }, + aggregations: { + state: { + scripted_metric: { + init_script: ` + // Globals are values that should be identical across all docs + // We can cheat a bit by always overwriting these and make the + // assumption that there is no variation in these across checks + state.globals = new HashMap(); + // Here we store stuff broken out by agent.id and monitor.id + // This should correspond to a unique check. + state.checksByAgentIdIP = new HashMap(); + `, + map_script: ` + Map curCheck = new HashMap(); + String agentId = doc["agent.id"][0]; + String ip = null; + if (doc["monitor.ip"].length > 0) { + ip = doc["monitor.ip"][0]; + } + String agentIdIP = agentId + "-" + (ip == null ? "" : ip.toString()); + def ts = doc["@timestamp"][0].toInstant().toEpochMilli(); + + def lastCheck = state.checksByAgentIdIP[agentId]; + Instant lastTs = lastCheck != null ? lastCheck["@timestamp"] : null; + if (lastTs != null && lastTs > ts) { + return; + } + + curCheck.put("@timestamp", ts); + + Map agent = new HashMap(); + agent.id = agentId; + curCheck.put("agent", agent); + + if (state.globals.url == null) { + Map url = new HashMap(); + Collection fields = ["full", "original", "scheme", "username", "password", "domain", "port", "path", "query", "fragment"]; + for (field in fields) { + String docPath = "url." + field; + def val = doc[docPath]; + if (!val.isEmpty()) { + url[field] = val[0]; + } + } + state.globals.url = url; + } + + Map monitor = new HashMap(); + monitor.status = doc["monitor.status"][0]; + monitor.ip = ip; + if (!doc["monitor.name"].isEmpty()) { + String monitorName = doc["monitor.name"][0]; + if (monitor.name != "") { + monitor.name = monitorName; + } + } + curCheck.monitor = monitor; + + if (curCheck.observer == null) { + curCheck.observer = new HashMap(); + } + if (curCheck.observer.geo == null) { + curCheck.observer.geo = new HashMap(); + } + if (!doc["observer.geo.name"].isEmpty()) { + curCheck.observer.geo.name = doc["observer.geo.name"][0]; + } + if (!doc["observer.geo.location"].isEmpty()) { + curCheck.observer.geo.location = doc["observer.geo.location"][0]; + } + if (!doc["kubernetes.pod.uid"].isEmpty() && curCheck.kubernetes == null) { + curCheck.kubernetes = new HashMap(); + curCheck.kubernetes.pod = new HashMap(); + curCheck.kubernetes.pod.uid = doc["kubernetes.pod.uid"][0]; + } + if (!doc["container.id"].isEmpty() && curCheck.container == null) { + curCheck.container = new HashMap(); + curCheck.container.id = doc["container.id"][0]; + } + if (curCheck.tls == null) { + curCheck.tls = new HashMap(); + } + if (!doc["tls.certificate_not_valid_after"].isEmpty()) { + curCheck.tls.certificate_not_valid_after = doc["tls.certificate_not_valid_after"][0]; + } + if (!doc["tls.certificate_not_valid_before"].isEmpty()) { + curCheck.tls.certificate_not_valid_before = doc["tls.certificate_not_valid_before"][0]; + } + + state.checksByAgentIdIP[agentIdIP] = curCheck; + `, + combine_script: 'return state;', + reduce_script: ` + // The final document + Map result = new HashMap(); + + Map checks = new HashMap(); + Instant maxTs = Instant.ofEpochMilli(0); + Collection ips = new HashSet(); + Collection geoNames = new HashSet(); + Collection podUids = new HashSet(); + Collection containerIds = new HashSet(); + Collection tls = new HashSet(); + String name = null; + for (state in states) { + result.putAll(state.globals); + for (entry in state.checksByAgentIdIP.entrySet()) { + def agentIdIP = entry.getKey(); + def check = entry.getValue(); + def lastBestCheck = checks.get(agentIdIP); + def checkTs = Instant.ofEpochMilli(check.get("@timestamp")); + + if (maxTs.isBefore(checkTs)) { maxTs = checkTs} + + if (lastBestCheck == null || lastBestCheck.get("@timestamp") < checkTs) { + check["@timestamp"] = check["@timestamp"]; + checks[agentIdIP] = check + } + + if (check.monitor.name != null && check.monitor.name != "") { + name = check.monitor.name; + } + + ips.add(check.monitor.ip); + if (check.observer != null && check.observer.geo != null && check.observer.geo.name != null) { + geoNames.add(check.observer.geo.name); + } + if (check.kubernetes != null && check.kubernetes.pod != null) { + podUids.add(check.kubernetes.pod.uid); + } + if (check.container != null) { + containerIds.add(check.container.id); + } + if (check.tls != null) { + tls.add(check.tls); + } + } + } + + // We just use the values so we can store these as nested docs + result.checks = checks.values(); + result.put("@timestamp", maxTs); + + + Map summary = new HashMap(); + summary.up = checks.entrySet().stream().filter(c -> c.getValue().monitor.status == "up").count(); + summary.down = checks.size() - summary.up; + result.summary = summary; + + Map monitor = new HashMap(); + monitor.ip = ips; + monitor.name = name; + monitor.status = summary.down > 0 ? (summary.up > 0 ? "mixed": "down") : "up"; + result.monitor = monitor; + + Map observer = new HashMap(); + Map geo = new HashMap(); + observer.geo = geo; + geo.name = geoNames; + result.observer = observer; + + if (!podUids.isEmpty()) { + result.kubernetes = new HashMap(); + result.kubernetes.pod = new HashMap(); + result.kubernetes.pod.uid = podUids; + } + + if (!containerIds.isEmpty()) { + result.container = new HashMap(); + result.container.id = containerIds; + } + + if (!tls.isEmpty()) { + result.tls = new HashMap(); + result.tls = tls; + } + + return result; + `, + }, + }, + }, + }, + }, + }, + }; + + const items = await queryContext.database.search(queryContext.request, params); + + const monitorBuckets = get(items, 'aggregations.monitors.buckets', []); + + const monitorIds: string[] = []; + const summaries: MonitorSummary[] = monitorBuckets.map((monitor: any) => { + const monitorId = get(monitor, 'key.monitor_id'); + monitorIds.push(monitorId); + let state = get(monitor, 'state.value'); + state = { + ...state, + timestamp: state['@timestamp'], + }; + const { checks } = state; + if (checks) { + state.checks = sortBy(checks, checksSortBy); + state.checks = state.checks.map((check: any) => ({ + ...check, + timestamp: check['@timestamp'], + })); + } else { + state.checks = []; + } + return { + monitor_id: monitorId, + state, + }; + }); + + const histogramMap = await getHistogramForMonitors(queryContext, monitorIds); + + const resItems = summaries.map(summary => ({ + ...summary, + histogram: histogramMap[summary.monitor_id], + })); + + const sortedResItems: any = sortBy(resItems, 'monitor_id'); + if (queryContext.pagination.sortOrder === SortOrder.DESC) { + sortedResItems.reverse(); + } + + return sortedResItems; +}; + +const getHistogramForMonitors = async ( + queryContext: QueryContext, + monitorIds: string[] +): Promise<{ [key: string]: SummaryHistogram }> => { + const params = { + index: INDEX_NAMES.HEARTBEAT, + body: { + size: 0, + query: { + bool: { + filter: [ + { + terms: { + 'monitor.id': monitorIds, + }, + }, + { + range: { + '@timestamp': { + gte: queryContext.dateRangeStart, + lte: queryContext.dateRangeEnd, + }, + }, + }, + ], + }, + }, + aggs: { + by_id: { + terms: { + field: 'monitor.id', + size: STATES.LEGACY_STATES_QUERY_SIZE, + }, + aggs: { + histogram: { + date_histogram: { + field: '@timestamp', + fixed_interval: getHistogramInterval( + queryContext.dateRangeStart, + queryContext.dateRangeEnd + ), + missing: 0, + }, + aggs: { + status: { + terms: { + field: 'monitor.status', + size: 2, + shard_size: 2, + }, + }, + }, + }, + }, + }, + }, + }, + }; + const result = await queryContext.database.search(queryContext.request, params); + + const buckets: any[] = get(result, 'aggregations.by_id.buckets', []); + return buckets.reduce((map: { [key: string]: any }, item: any) => { + const points = get(item, 'histogram.buckets', []).map((histogram: any) => { + const status = get(histogram, 'status.buckets', []).reduce( + (statuses: { up: number; down: number }, bucket: any) => { + if (bucket.key === 'up') { + statuses.up = bucket.doc_count; + } else if (bucket.key === 'down') { + statuses.down = bucket.doc_count; + } + return statuses; + }, + { up: 0, down: 0 } + ); + return { + timestamp: histogram.key, + ...status, + }; + }); + + map[item.key] = { + count: item.doc_count, + points, + }; + return map; + }, {}); +}; + +const cursorDirectionToOrder = (cd: CursorDirection): 'asc' | 'desc' => { + return CursorDirection[cd] === CursorDirection.AFTER ? 'asc' : 'desc'; +}; + +type SortChecks = (check: Check) => string[]; +const checksSortBy = (check: Check) => [ + get(check, 'observer.geo.name'), + get(check, 'monitor.ip'), +]; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_chunk.ts b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_chunk.ts new file mode 100644 index 0000000000000..e395df0d1d08d --- /dev/null +++ b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_chunk.ts @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { refinePotentialMatches } from './refine_potential_matches'; +import { findPotentialMatches } from './find_potential_matches'; +import { QueryContext } from '../elasticsearch_monitor_states_adapter'; +import { ChunkFetcher, ChunkResult } from './monitor_group_iterator'; + +/** + * Fetches a single 'chunk' of data with a single query, then uses a secondary query to filter out erroneous matches. + * Note that all returned data may be erroneous. If `searchAfter` is returned the caller should invoke this function + * repeatedly with the new searchAfter value as there may be more matching data in a future chunk. If `searchAfter` + * is falsey there is no more data to fetch. + * @param queryContext the data and resources needed to perform the query + * @param searchAfter indicates where Elasticsearch should continue querying on subsequent requests, if at all + * @param size the minimum size of the matches to chunk + */ +// Note that all returned data may be erroneous. If `searchAfter` is returned the caller should invoke this function +// repeatedly with the new searchAfter value as there may be more matching data in a future chunk. If `searchAfter` +// is falsey there is no more data to fetch. +export const fetchChunk: ChunkFetcher = async ( + queryContext: QueryContext, + searchAfter: any, + size: number +): Promise => { + const { monitorIds, checkGroups, searchAfter: foundSearchAfter } = await findPotentialMatches( + queryContext, + searchAfter, + size + ); + const matching = await refinePotentialMatches(queryContext, monitorIds, checkGroups); + + return { + monitorGroups: matching, + searchAfter: foundSearchAfter, + }; +}; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_page.ts b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_page.ts new file mode 100644 index 0000000000000..085c11f78b8f5 --- /dev/null +++ b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_page.ts @@ -0,0 +1,137 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { flatten } from 'lodash'; +import { CursorPagination } from '../adapter_types'; +import { QueryContext } from '../elasticsearch_monitor_states_adapter'; +import { QUERY } from '../../../../../common/constants'; +import { CursorDirection, MonitorSummary, SortOrder } from '../../../../../common/graphql/types'; +import { enrichMonitorGroups } from './enrich_monitor_groups'; +import { MonitorGroupIterator } from './monitor_group_iterator'; + +/** + * + * Gets a single page of results per the settings in the provided queryContext. These results are very minimal, + * just monitor IDs and check groups. This takes an optional `MonitorGroupEnricher` that post-processes the minimal + * data, decorating it appropriately. The function also takes a fetcher, which does all the actual fetching. + * @param queryContext defines the criteria for the data on the current page + * @param monitorGroupFetcher performs paginated monitor fetching + * @param monitorEnricher decorates check group results with additional data + */ +// just monitor IDs and check groups. This takes an optional `MonitorGroupEnricher` that post-processes the minimal +// data, decorating it appropriately. The function also takes a fetcher, which does all the actual fetching. +export const fetchPage = async ( + queryContext: QueryContext, + monitorGroupFetcher: MonitorGroupsFetcher = fetchPageMonitorGroups, + monitorEnricher: MonitorEnricher = enrichMonitorGroups +): Promise => { + const size = Math.min(queryContext.size, QUERY.DEFAULT_AGGS_CAP); + const monitorPage = await monitorGroupFetcher(queryContext, size); + + const checkGroups: string[] = flatten( + monitorPage.monitorGroups.map(monitorGroups => monitorGroups.groups.map(g => g.checkGroup)) + ); + + const enrichedMonitors = await monitorEnricher(queryContext, checkGroups); + + return { + items: enrichedMonitors, + nextPagePagination: monitorPage.nextPagePagination, + prevPagePagination: monitorPage.prevPagePagination, + }; +}; + +// Fetches the most recent monitor groups for the given page, +// in the manner demanded by the `queryContext` and return at most `size` results. +const fetchPageMonitorGroups: MonitorGroupsFetcher = async ( + queryContext: QueryContext, + size: number +): Promise => { + const monitorGroups: MonitorGroups[] = []; + const iterator = new MonitorGroupIterator(queryContext); + + let paginationBefore: CursorPagination | null = null; + while (monitorGroups.length < size) { + const monitor = await iterator.next(); + if (!monitor) { + break; // No more items to fetch + } + monitorGroups.push(monitor); + + // We want the before pagination to be before the first item we encounter + if (monitorGroups.length === 1) { + paginationBefore = await iterator.paginationBeforeCurrent(); + } + } + + // We have to create these objects before checking if we can navigate backward + const paginationAfter = await iterator.paginationAfterCurrent(); + + const ssAligned = searchSortAligned(queryContext.pagination); + + if (!ssAligned) { + monitorGroups.reverse(); + } + + return { + monitorGroups, + nextPagePagination: ssAligned ? paginationAfter : paginationBefore, + prevPagePagination: ssAligned ? paginationBefore : paginationAfter, + }; +}; + +// Returns true if the order returned by the ES query matches the requested sort order. +// This useful to determine if the results need to be reversed from their ES results order. +// I.E. when navigating backwards using prevPagePagination (CursorDirection.Before) yet using a SortOrder.ASC. +const searchSortAligned = (pagination: CursorPagination): boolean => { + if (pagination.cursorDirection === CursorDirection.AFTER) { + return pagination.sortOrder === SortOrder.ASC; + } else { + return pagination.sortOrder === SortOrder.DESC; + } +}; + +// Minimal interface representing the most recent set of groups accompanying a MonitorId in a given context. +export interface MonitorGroups { + id: string; + groups: MonitorLocCheckGroup[]; +} + +// Representation of the data returned when aggregating summary check groups. +export interface MonitorLocCheckGroup { + monitorId: string; + location: string | null; + checkGroup: string; + status: 'up' | 'down'; + summaryTimestamp: Date; +} + +// Represents a page that has not yet been enriched. +export interface MonitorGroupsPage { + monitorGroups: MonitorGroups[]; + nextPagePagination: CursorPagination | null; + prevPagePagination: CursorPagination | null; +} + +// Representation of a full page of results with pagination data for constructing next/prev links. +export interface EnrichedPage { + items: MonitorSummary[]; + nextPagePagination: CursorPagination | null; + prevPagePagination: CursorPagination | null; +} + +// A function that does the work of matching the minimal set of data for this query, returning just matching fields +// that are efficient to access while performing the query. +export type MonitorGroupsFetcher = ( + queryContext: QueryContext, + size: number +) => Promise; + +// A function that takes a set of check groups and returns richer MonitorSummary objects. +export type MonitorEnricher = ( + queryContext: QueryContext, + checkGroups: string[] +) => Promise; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/find_potential_matches.ts b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/find_potential_matches.ts new file mode 100644 index 0000000000000..b9ffd27d23022 --- /dev/null +++ b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/find_potential_matches.ts @@ -0,0 +1,123 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { get, set } from 'lodash'; +import { QueryContext } from '../elasticsearch_monitor_states_adapter'; +import { CursorDirection } from '../../../../../common/graphql/types'; +import { INDEX_NAMES } from '../../../../../common/constants'; +import { makeDateRangeFilter } from '../../../helper/make_date_rate_filter'; + +// This is the first phase of the query. In it, we find the most recent check groups that matched the given query. +// Note that these check groups may not be the most recent groups for the matching monitor ID! We'll filter those +/** + * This is the first phase of the query. In it, we find the most recent check groups that matched the given query. + * Note that these check groups may not be the most recent groups for the matching monitor ID. They'll be filtered + * out in the next phase. + * @param queryContext the data and resources needed to perform the query + * @param searchAfter indicates where Elasticsearch should continue querying on subsequent requests, if at all + * @param size the minimum size of the matches to chunk + */ +export const findPotentialMatches = async ( + queryContext: QueryContext, + searchAfter: any, + size: number +) => { + const queryResult = await query(queryContext, searchAfter, size); + + const checkGroups = new Set(); + const monitorIds: string[] = []; + get(queryResult, 'aggregations.monitors.buckets', []).forEach((b: any) => { + const monitorId = b.key.monitor_id; + monitorIds.push(monitorId); + + // Doc count can be zero if status filter optimization does not match + if (b.doc_count > 0) { + // Here we grab the most recent 2 check groups per location and add them to the list. + // Why 2? Because the most recent one may be a partial result from mode: all, and hence not match a summary doc. + b.locations.buckets.forEach((lb: any) => { + lb.top.hits.hits.forEach((h: any) => { + checkGroups.add(h._source.monitor.check_group); + }); + }); + } + }); + + return { + monitorIds, + checkGroups, + searchAfter: queryResult.aggregations.monitors.after_key, + }; +}; + +const query = async (queryContext: QueryContext, searchAfter: any, size: number) => { + const body = queryBody(queryContext, searchAfter, size); + + const params = { + index: INDEX_NAMES.HEARTBEAT, + body, + }; + + return await queryContext.database.search(queryContext.request, params); +}; + +const queryBody = (queryContext: QueryContext, searchAfter: any, size: number) => { + const compositeOrder = cursorDirectionToOrder(queryContext.pagination.cursorDirection); + + const filters: any[] = [ + makeDateRangeFilter(queryContext.dateRangeStart, queryContext.dateRangeEnd), + ]; + if (queryContext.filterClause) { + filters.push(queryContext.filterClause); + } + if (queryContext.statusFilter) { + filters.push({ match: { 'monitor.status': queryContext.statusFilter } }); + } + + const body = { + size: 0, + query: { bool: { filter: filters } }, + aggs: { + monitors: { + composite: { + size, + sources: [ + { + monitor_id: { terms: { field: 'monitor.id', order: compositeOrder } }, + }, + ], + }, + aggs: { + // Here we grab the most recent 2 check groups per location. + // Why 2? Because the most recent one may not be for a summary, it may be incomplete. + locations: { + terms: { field: 'observer.geo.name', missing: '__missing__' }, + aggs: { + top: { + top_hits: { + sort: [{ '@timestamp': 'desc' }], + _source: { + includes: ['monitor.check_group', '@timestamp'], + }, + size: 2, + }, + }, + }, + }, + }, + }, + }, + }; + + if (searchAfter) { + set(body, 'aggs.monitors.composite.after', searchAfter); + } + + return body; +}; + +const cursorDirectionToOrder = (cd: CursorDirection): 'asc' | 'desc' => { + return CursorDirection[cd] === CursorDirection.AFTER ? 'asc' : 'desc'; +}; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/index.ts b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/index.ts new file mode 100644 index 0000000000000..2fa2112161dcd --- /dev/null +++ b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/index.ts @@ -0,0 +1,7 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +export { fetchPage, MonitorGroups, MonitorLocCheckGroup, MonitorGroupsPage } from './fetch_page'; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/monitor_group_iterator.ts b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/monitor_group_iterator.ts new file mode 100644 index 0000000000000..2fec58593e5d8 --- /dev/null +++ b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/monitor_group_iterator.ts @@ -0,0 +1,176 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { QueryContext } from '../elasticsearch_monitor_states_adapter'; +import { CursorPagination } from '../adapter_types'; +import { fetchChunk } from './fetch_chunk'; +import { CursorDirection } from '../../../../../common/graphql/types'; +import { MonitorGroups } from './fetch_page'; + +// Hardcoded chunk size for how many monitors to fetch at a time when querying +export const CHUNK_SIZE = 1000; + +// Function that fetches a chunk of data used in iteration +export type ChunkFetcher = ( + queryContext: QueryContext, + searchAfter: any, + size: number +) => Promise; + +// Result of fetching more results from the search. +export interface ChunkResult { + monitorGroups: MonitorGroups[]; + searchAfter: any; +} + +/** + * This class exists to simplify the process of querying for page data. Because the raw queries responsible for fetching pages + * pull data in `chunks`, and those chunks can be full of matches or void of results that would require additional + * querying, this class provides a `next` function that is cleaner to call. `next` provides the next matching result, + * which may require many subsequent fetches, while keeping the external API clean. + */ +// matches, or may simple be empty results that tell us a to keep looking for more, this class exists to simplify things. +// The idea is that you can call next() on it and receive the next matching result, even if internally we need to fetch +// multiple chunks to find that result. +export class MonitorGroupIterator { + queryContext: QueryContext; + // Cache representing pre-fetched query results. + // The first item is the CheckGroup this represents. + buffer: MonitorGroups[]; + bufferPos: number; + searchAfter: any; + chunkFetcher: ChunkFetcher; + + constructor( + queryContext: QueryContext, + initialBuffer: MonitorGroups[] = [], + initialBufferPos: number = -1, + chunkFetcher: ChunkFetcher = fetchChunk + ) { + this.queryContext = queryContext; + this.buffer = initialBuffer; + this.bufferPos = initialBufferPos; + this.searchAfter = queryContext.pagination.cursorKey; + this.chunkFetcher = chunkFetcher; + } + + // Fetch the next matching result. + async next(): Promise { + await this.bufferNext(CHUNK_SIZE); + + const found = this.buffer[this.bufferPos + 1]; + if (found) { + this.bufferPos++; + return found; + } + return null; + } + + // Look ahead to see if there are additional results. + async peek(): Promise { + await this.bufferNext(CHUNK_SIZE); + return this.buffer[this.bufferPos + 1] || null; + } + + // Returns the last item fetched with next(). null if no items fetched with + // next or if next has not yet been invoked. + getCurrent(): MonitorGroups | null { + return this.buffer[this.bufferPos] || null; + } + + // Attempts to buffer at most `size` number of additional results, stopping when at least one additional + // result is buffered or there are no more matching items to be found. + async bufferNext(size: number = CHUNK_SIZE): Promise { + // The next element is already buffered. + if (this.buffer[this.bufferPos + 1]) { + return; + } + + while (true) { + const result = await this.attemptBufferMore(CHUNK_SIZE); + if (result.gotHit || !result.hasMore) { + return; + } + } + } + + // Attempts to buffer more results fetching a single chunk. + // If trim is set to true, which is the default, it will delete all items in the buffer prior to the current item. + // to free up space. + async attemptBufferMore( + size: number = CHUNK_SIZE + ): Promise<{ hasMore: boolean; gotHit: boolean }> { + // Trim the buffer to just the current element since we'll be fetching more + const current = this.getCurrent(); + + // Trim the buffer to free space before fetching more + // We only need to do this if there is actually something in the buffer. + // This also behaves correctly in the -1 case for bufferPos, where we don't want to make it 0. + if (current) { + this.buffer = [current]; + this.bufferPos = 0; + } + + const results = await this.chunkFetcher(this.queryContext, this.searchAfter, size); + // If we've hit the end of the stream searchAfter will be empty + + results.monitorGroups.forEach((mig: MonitorGroups) => this.buffer.push(mig)); + if (results.searchAfter) { + this.searchAfter = results.searchAfter; + } + + return { + gotHit: results.monitorGroups.length > 0, + hasMore: !!results.searchAfter, + }; + } + + // Get a CursorPaginator object that will resume after the current() value. + async paginationAfterCurrent(): Promise { + const peek = await this.peek(); + if (!peek) { + return null; + } + + const current = this.getCurrent(); + if (!current) { + return null; + } + const cursorKey = { monitor_id: current.id }; + + return Object.assign({}, this.queryContext.pagination, { cursorKey }); + } + + // Get a CursorPaginator object that will resume before the current() value. + async paginationBeforeCurrent(): Promise { + const reverseFetcher = await this.reverse(); + return reverseFetcher && (await reverseFetcher.paginationAfterCurrent()); + } + + // Returns a copy of this fetcher that goes backwards from the current position + reverse(): MonitorGroupIterator | null { + const reverseContext = Object.assign({}, this.queryContext); + const current = this.getCurrent(); + + reverseContext.pagination = { + cursorKey: current ? { monitor_id: current.id } : null, + sortOrder: this.queryContext.pagination.sortOrder, + cursorDirection: + this.queryContext.pagination.cursorDirection === CursorDirection.AFTER + ? CursorDirection.BEFORE + : CursorDirection.AFTER, + }; + + return current + ? new MonitorGroupIterator(reverseContext, [current], 0, this.chunkFetcher) + : null; + } + + // Returns a copy of this with a shallow copied buffer. Note that the queryContext is still shared! + clone() { + return new MonitorGroupIterator(this.queryContext, this.buffer.slice(0), this.bufferPos); + } +} diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/refine_potential_matches.ts b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/refine_potential_matches.ts new file mode 100644 index 0000000000000..3bdd6fe616f18 --- /dev/null +++ b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/refine_potential_matches.ts @@ -0,0 +1,138 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { INDEX_NAMES } from '../../../../../common/constants'; +import { QueryContext } from '../elasticsearch_monitor_states_adapter'; +import { CursorDirection } from '../../../../../common/graphql/types'; +import { MonitorGroups, MonitorLocCheckGroup } from './fetch_page'; +import { makeDateRangeFilter } from '../../../helper/make_date_rate_filter'; + +/** + * Determines whether the provided check groups are the latest complete check groups for their associated monitor ID's. + * If provided check groups are not the latest complete group, they are discarded. + * @param queryContext the data and resources needed to perform the query + * @param potentialMatchMonitorIDs the monitor ID's of interest + * @param potentialMatchCheckGroups the check groups to filter for the latest match per ID + */ +// check groups for their associated monitor IDs. If not, it discards the result. +export const refinePotentialMatches = async ( + queryContext: QueryContext, + potentialMatchMonitorIDs: string[], + potentialMatchCheckGroups: Set +): Promise => { + if (potentialMatchMonitorIDs.length === 0) { + return []; + } + + const recentGroupsMatchingStatus = await fullyMatchingIds( + queryContext, + potentialMatchMonitorIDs, + potentialMatchCheckGroups + ); + + // Return the monitor groups filtering out potential matches that weren't current + const matches: MonitorGroups[] = potentialMatchMonitorIDs + .map((id: string) => { + return { id, groups: recentGroupsMatchingStatus.get(id) || [] }; + }) + .filter(mrg => mrg.groups.length > 0); + + // Sort matches by ID + matches.sort((a: MonitorGroups, b: MonitorGroups) => { + return a.id === b.id ? 0 : a.id > b.id ? 1 : -1; + }); + + if (queryContext.pagination.cursorDirection === CursorDirection.BEFORE) { + matches.reverse(); + } + return matches; +}; + +const fullyMatchingIds = async ( + queryContext: QueryContext, + potentialMatchMonitorIDs: string[], + potentialMatchCheckGroups: Set +) => { + const mostRecentQueryResult = await mostRecentCheckGroups(queryContext, potentialMatchMonitorIDs); + + const matching = new Map(); + MonitorLoop: for (const monBucket of mostRecentQueryResult.aggregations.monitor.buckets) { + const monitorId: string = monBucket.key; + const groups: MonitorLocCheckGroup[] = []; + + for (const locBucket of monBucket.location.buckets) { + const location = locBucket.key; + const topSource = locBucket.top.hits.hits[0]._source; + const checkGroup = topSource.monitor.check_group; + const status = topSource.summary.down > 0 ? 'down' : 'up'; + + // This monitor doesn't match, so just skip ahead and don't add it to the output + if (queryContext.statusFilter && queryContext.statusFilter !== status) { + continue MonitorLoop; + } + + groups.push({ + monitorId, + location, + checkGroup, + status, + summaryTimestamp: topSource['@timestamp'], + }); + } + + // We only truly match the monitor if one of the most recent check groups was found in the potential matches phase + if (groups.some(g => potentialMatchCheckGroups.has(g.checkGroup))) { + matching.set(monitorId, groups); + } + } + + return matching; +}; + +export const mostRecentCheckGroups = async ( + queryContext: QueryContext, + potentialMatchMonitorIDs: string[] +) => { + const params = { + index: INDEX_NAMES.HEARTBEAT, + body: { + size: 0, + query: { + bool: { + filter: [ + makeDateRangeFilter(queryContext.dateRangeStart, queryContext.dateRangeEnd), + { terms: { 'monitor.id': potentialMatchMonitorIDs } }, + // only match summary docs because we only want the latest *complete* check group. + { exists: { field: 'summary' } }, + ], + }, + }, + aggs: { + monitor: { + terms: { field: 'monitor.id', size: potentialMatchMonitorIDs.length }, + aggs: { + location: { + terms: { field: 'observer.geo.name', missing: 'N/A', size: 100 }, + aggs: { + top: { + top_hits: { + sort: [{ '@timestamp': 'desc' }], + _source: { + includes: ['monitor.check_group', '@timestamp', 'summary.up', 'summary.down'], + }, + size: 1, + }, + }, + }, + }, + }, + }, + }, + }, + }; + + return await queryContext.database.search(queryContext.request, params); +}; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/elasticsearch_monitors_adapter.ts b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/elasticsearch_monitors_adapter.ts index 8bfe1eb01524c..c14e3dab987d7 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/elasticsearch_monitors_adapter.ts +++ b/x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/elasticsearch_monitors_adapter.ts @@ -101,6 +101,7 @@ export class ElasticsearchMonitorsAdapter implements UMMonitorsAdapter { }; const result = await this.database.search(request, params); + const dateHistogramBuckets = dropLatestBucket( get(result, 'aggregations.timeseries.buckets', []) ); diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/make_date_rate_filter.ts b/x-pack/legacy/plugins/uptime/server/lib/helper/make_date_rate_filter.ts new file mode 100644 index 0000000000000..123a5a7fe1b3a --- /dev/null +++ b/x-pack/legacy/plugins/uptime/server/lib/helper/make_date_rate_filter.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +export const makeDateRangeFilter = ( + dateRangeStart: string | number, + dateRangeEnd: string | number +) => { + return { + range: { '@timestamp': { gte: dateRangeStart, lte: dateRangeEnd } }, + }; +}; diff --git a/x-pack/package.json b/x-pack/package.json index 23a6e0ea0d754..5f554b2a31f47 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -253,7 +253,7 @@ "graphql-tag": "^2.9.2", "graphql-tools": "^3.0.2", "h2o2": "^8.1.2", - "handlebars": "^4.3.3", + "handlebars": "4.3.5", "history": "4.9.0", "history-extra": "^5.0.1", "humps": "2.0.1", diff --git a/x-pack/plugins/security/server/authentication/api_keys.test.ts b/x-pack/plugins/security/server/authentication/api_keys.test.ts index fcfa1fe4f4b60..7ecff1682465c 100644 --- a/x-pack/plugins/security/server/authentication/api_keys.test.ts +++ b/x-pack/plugins/security/server/authentication/api_keys.test.ts @@ -5,7 +5,7 @@ */ import { APIKeys } from './api_keys'; -import { ClusterClient, ScopedClusterClient } from '../../../../../src/core/server'; +import { IClusterClient, IScopedClusterClient } from '../../../../../src/core/server'; import { httpServerMock, loggingServiceMock, @@ -14,15 +14,15 @@ import { describe('API Keys', () => { let apiKeys: APIKeys; - let mockClusterClient: jest.Mocked>; - let mockScopedClusterClient: jest.Mocked>; + let mockClusterClient: jest.Mocked; + let mockScopedClusterClient: jest.Mocked; const mockIsSecurityFeatureDisabled = jest.fn(); beforeEach(() => { mockClusterClient = elasticsearchServiceMock.createClusterClient(); mockScopedClusterClient = elasticsearchServiceMock.createScopedClusterClient(); mockClusterClient.asScoped.mockReturnValue((mockScopedClusterClient as unknown) as jest.Mocked< - ScopedClusterClient + IScopedClusterClient >); mockIsSecurityFeatureDisabled.mockReturnValue(false); apiKeys = new APIKeys({ diff --git a/x-pack/plugins/security/server/authentication/api_keys.ts b/x-pack/plugins/security/server/authentication/api_keys.ts index 688a3f5d944b6..3709e8e7195fe 100644 --- a/x-pack/plugins/security/server/authentication/api_keys.ts +++ b/x-pack/plugins/security/server/authentication/api_keys.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ClusterClient, KibanaRequest, Logger } from '../../../../../src/core/server'; +import { IClusterClient, KibanaRequest, Logger } from '../../../../../src/core/server'; /** * Represents the options to create an APIKey class instance that will be @@ -12,7 +12,7 @@ import { ClusterClient, KibanaRequest, Logger } from '../../../../../src/core/se */ export interface ConstructorOptions { logger: Logger; - clusterClient: PublicMethodsOf; + clusterClient: IClusterClient; isSecurityFeatureDisabled: () => boolean; } @@ -91,7 +91,7 @@ export interface InvalidateAPIKeyResult { */ export class APIKeys { private readonly logger: Logger; - private readonly clusterClient: PublicMethodsOf; + private readonly clusterClient: IClusterClient; private readonly isSecurityFeatureDisabled: () => boolean; constructor({ logger, clusterClient, isSecurityFeatureDisabled }: ConstructorOptions) { diff --git a/x-pack/plugins/security/server/authentication/authenticator.ts b/x-pack/plugins/security/server/authentication/authenticator.ts index b3f34b023d8ee..18bdc9624b12b 100644 --- a/x-pack/plugins/security/server/authentication/authenticator.ts +++ b/x-pack/plugins/security/server/authentication/authenticator.ts @@ -11,7 +11,7 @@ import { LoggerFactory, Logger, HttpServiceSetup, - ClusterClient, + IClusterClient, } from '../../../../../src/core/server'; import { ConfigType } from '../config'; import { getErrorStatusCode } from '../errors'; @@ -80,7 +80,7 @@ export interface AuthenticatorOptions { config: Pick; basePath: HttpServiceSetup['basePath']; loggers: LoggerFactory; - clusterClient: PublicMethodsOf; + clusterClient: IClusterClient; sessionStorageFactory: SessionStorageFactory; isSystemAPIRequest: (request: KibanaRequest) => boolean; } diff --git a/x-pack/plugins/security/server/authentication/index.test.ts b/x-pack/plugins/security/server/authentication/index.test.ts index db8eded100e46..9342cce577dfb 100644 --- a/x-pack/plugins/security/server/authentication/index.test.ts +++ b/x-pack/plugins/security/server/authentication/index.test.ts @@ -23,7 +23,7 @@ import { mockAuthenticatedUser } from '../../common/model/authenticated_user.moc import { AuthenticationHandler, AuthToolkit, - ClusterClient, + IClusterClient, CoreSetup, ElasticsearchErrorHelpers, KibanaRequest, @@ -57,7 +57,7 @@ describe('setupAuthentication()', () => { loggers: LoggerFactory; getLegacyAPI(): LegacyAPI; core: MockedKeys; - clusterClient: jest.Mocked>; + clusterClient: jest.Mocked; }; let mockXpackInfo: jest.Mocked; let mockScopedClusterClient: jest.Mocked>; diff --git a/x-pack/plugins/security/server/authentication/index.ts b/x-pack/plugins/security/server/authentication/index.ts index c60605cf71715..59d67a18c890c 100644 --- a/x-pack/plugins/security/server/authentication/index.ts +++ b/x-pack/plugins/security/server/authentication/index.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { - ClusterClient, + IClusterClient, CoreSetup, KibanaRequest, LoggerFactory, @@ -25,7 +25,7 @@ export { CreateAPIKeyResult } from './api_keys'; interface SetupAuthenticationParams { core: CoreSetup; - clusterClient: PublicMethodsOf; + clusterClient: IClusterClient; config: ConfigType; loggers: LoggerFactory; getLegacyAPI(): LegacyAPI; diff --git a/x-pack/plugins/security/server/authentication/providers/base.ts b/x-pack/plugins/security/server/authentication/providers/base.ts index 940cba016d1ac..12253f8d8f548 100644 --- a/x-pack/plugins/security/server/authentication/providers/base.ts +++ b/x-pack/plugins/security/server/authentication/providers/base.ts @@ -8,7 +8,7 @@ import { KibanaRequest, Logger, HttpServiceSetup, - ClusterClient, + IClusterClient, Headers, } from '../../../../../../src/core/server'; import { AuthenticatedUser } from '../../../common/model'; @@ -21,7 +21,7 @@ import { Tokens } from '../tokens'; */ export interface AuthenticationProviderOptions { basePath: HttpServiceSetup['basePath']; - client: PublicMethodsOf; + client: IClusterClient; logger: Logger; tokens: PublicMethodsOf; } diff --git a/x-pack/plugins/security/server/authentication/tokens.test.ts b/x-pack/plugins/security/server/authentication/tokens.test.ts index baf3b1f03bc9c..8d15ea69ae392 100644 --- a/x-pack/plugins/security/server/authentication/tokens.test.ts +++ b/x-pack/plugins/security/server/authentication/tokens.test.ts @@ -8,12 +8,12 @@ import { errors } from 'elasticsearch'; import { elasticsearchServiceMock, loggingServiceMock } from '../../../../../src/core/server/mocks'; -import { ClusterClient, ElasticsearchErrorHelpers } from '../../../../../src/core/server'; +import { IClusterClient, ElasticsearchErrorHelpers } from '../../../../../src/core/server'; import { Tokens } from './tokens'; describe('Tokens', () => { let tokens: Tokens; - let mockClusterClient: jest.Mocked>; + let mockClusterClient: jest.Mocked; beforeEach(() => { mockClusterClient = elasticsearchServiceMock.createClusterClient(); diff --git a/x-pack/plugins/security/server/authentication/tokens.ts b/x-pack/plugins/security/server/authentication/tokens.ts index ae77d165a2ff5..8e91faa95b459 100644 --- a/x-pack/plugins/security/server/authentication/tokens.ts +++ b/x-pack/plugins/security/server/authentication/tokens.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ClusterClient, Logger } from '../../../../../src/core/server'; +import { IClusterClient, Logger } from '../../../../../src/core/server'; import { getErrorStatusCode } from '../errors'; /** @@ -34,9 +34,7 @@ export class Tokens { */ private readonly logger: Logger; - constructor( - private readonly options: Readonly<{ client: PublicMethodsOf; logger: Logger }> - ) { + constructor(private readonly options: Readonly<{ client: IClusterClient; logger: Logger }>) { this.logger = options.logger; } diff --git a/x-pack/plugins/security/server/plugin.test.ts b/x-pack/plugins/security/server/plugin.test.ts index 6fe28fe56c417..1135edc658d81 100644 --- a/x-pack/plugins/security/server/plugin.test.ts +++ b/x-pack/plugins/security/server/plugin.test.ts @@ -7,12 +7,12 @@ import { coreMock, elasticsearchServiceMock } from '../../../../src/core/server/mocks'; import { Plugin } from './plugin'; -import { ClusterClient, CoreSetup } from '../../../../src/core/server'; +import { IClusterClient, CoreSetup } from '../../../../src/core/server'; describe('Security Plugin', () => { let plugin: Plugin; let mockCoreSetup: MockedKeys; - let mockClusterClient: jest.Mocked>; + let mockClusterClient: jest.Mocked; beforeEach(() => { plugin = new Plugin( coreMock.createPluginInitializerContext({ @@ -27,7 +27,7 @@ describe('Security Plugin', () => { mockClusterClient = elasticsearchServiceMock.createClusterClient(); mockCoreSetup.elasticsearch.createClient.mockReturnValue( - (mockClusterClient as unknown) as jest.Mocked + (mockClusterClient as unknown) as jest.Mocked ); }); diff --git a/x-pack/plugins/security/server/plugin.ts b/x-pack/plugins/security/server/plugin.ts index 353c64836a939..7cd742a80ac85 100644 --- a/x-pack/plugins/security/server/plugin.ts +++ b/x-pack/plugins/security/server/plugin.ts @@ -6,7 +6,7 @@ import { first } from 'rxjs/operators'; import { - ClusterClient, + IClusterClient, CoreSetup, KibanaRequest, Logger, @@ -67,7 +67,7 @@ export interface PluginSetupContract { */ export class Plugin { private readonly logger: Logger; - private clusterClient?: ClusterClient; + private clusterClient?: IClusterClient; private legacyAPI?: LegacyAPI; private readonly getLegacyAPI = () => { diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index b7a6b24242924..5b1b43c405f3a 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -11385,7 +11385,6 @@ "xpack.advancedUiActions.customizeTimeRange.modal.headerTitle": "パネルの時間範囲のカスタマイズ", "xpack.advancedUiActions.customizeTimeRangeMenuItem.displayName": "時間範囲のカスタマイズ", "xpack.fileUpload.fileParser.errorReadingFile": "ファイルの読み込み中にエラーが発生しました", - "xpack.fileUpload.fileParser.noFileProvided": "エラー、ファイルが提供されていません", - "xpack.fileUpload.jsonIndexFilePicker.errorGettingIndexName": "インデックス名の取得中にエラーが発生: {errorMessage}" + "xpack.fileUpload.fileParser.noFileProvided": "エラー、ファイルが提供されていません" } } \ No newline at end of file diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 79cba3ee696be..fef51c7bb58ab 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -11387,7 +11387,6 @@ "xpack.advancedUiActions.customizeTimeRange.modal.headerTitle": "定制面板时间范围", "xpack.advancedUiActions.customizeTimeRangeMenuItem.displayName": "定制时间范围", "xpack.fileUpload.fileParser.errorReadingFile": "读取文件时出错", - "xpack.fileUpload.fileParser.noFileProvided": "错误,未提供任何文件", - "xpack.fileUpload.jsonIndexFilePicker.errorGettingIndexName": "检索索引名称时出错:{errorMessage}" + "xpack.fileUpload.fileParser.noFileProvided": "错误,未提供任何文件" } } \ No newline at end of file diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/index.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/index.ts index 5060816a186ab..f920decf708fe 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/index.ts +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/index.ts @@ -314,12 +314,12 @@ export default function(kibana: any) { actionGroups: [], async executor({ services, params, state }: AlertExecutorOptions) {}, }; - server.plugins.alerting.registerType(alwaysFiringAlertType); - server.plugins.alerting.registerType(neverFiringAlertType); - server.plugins.alerting.registerType(failingAlertType); - server.plugins.alerting.registerType(validationAlertType); - server.plugins.alerting.registerType(authorizationAlertType); - server.plugins.alerting.registerType(noopAlertType); + server.plugins.alerting.setup.registerType(alwaysFiringAlertType); + server.plugins.alerting.setup.registerType(neverFiringAlertType); + server.plugins.alerting.setup.registerType(failingAlertType); + server.plugins.alerting.setup.registerType(validationAlertType); + server.plugins.alerting.setup.registerType(authorizationAlertType); + server.plugins.alerting.setup.registerType(noopAlertType); }, }); } diff --git a/x-pack/test/api_integration/apis/uptime/graphql/doc_count.js b/x-pack/test/api_integration/apis/uptime/graphql/doc_count.js index 8355f344635bc..cae5fd8d0165d 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/doc_count.js +++ b/x-pack/test/api_integration/apis/uptime/graphql/doc_count.js @@ -4,12 +4,14 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from '@kbn/expect'; import { docCountQueryString } from '../../../../../legacy/plugins/uptime/public/queries'; -import docCount from './fixtures/doc_count'; +import { expectFixtureEql } from './helpers/expect_fixture_eql'; export default function ({ getService }) { describe('docCount query', () => { + before('load heartbeat data', () => getService('esArchiver').load('uptime/full_heartbeat')); + after('unload heartbeat index', () => getService('esArchiver').unload('uptime/full_heartbeat')); + const supertest = getService('supertest'); it(`will fetch the index's count`, async () => { @@ -18,7 +20,7 @@ export default function ({ getService }) { query: docCountQueryString, variables: { dateRangeStart: '2019-01-28T17:40:08.078Z', - dateRangeEnd: '2019-01-28T19:00:16.078Z', + dateRangeEnd: '2025-01-28T19:00:16.078Z', }, }; const { @@ -28,7 +30,7 @@ export default function ({ getService }) { .set('kbn-xsrf', 'foo') .send({ ...getDocCountQuery }); - expect(data).to.eql(docCount); + expectFixtureEql(data, 'doc_count'); }); }); } diff --git a/x-pack/test/api_integration/apis/uptime/graphql/filter_bar.js b/x-pack/test/api_integration/apis/uptime/graphql/filter_bar.js index bcbee57b9fdc5..ca3f1b42d08ba 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/filter_bar.js +++ b/x-pack/test/api_integration/apis/uptime/graphql/filter_bar.js @@ -4,11 +4,14 @@ * you may not use this file except in compliance with the Elastic License. */ -import { expectFixtureEql } from './expect_fixture_eql'; +import { expectFixtureEql } from './helpers/expect_fixture_eql'; import { filterBarQueryString } from '../../../../../legacy/plugins/uptime/public/queries'; export default function ({ getService }) { describe('filterBar query', () => { + before('load heartbeat data', () => getService('esArchiver').load('uptime/full_heartbeat')); + after('unload heartbeat index', () => getService('esArchiver').unload('uptime/full_heartbeat')); + const supertest = getService('supertest'); it('returns the expected filters', async () => { @@ -17,7 +20,7 @@ export default function ({ getService }) { query: filterBarQueryString, variables: { dateRangeStart: '2019-01-28T17:40:08.078Z', - dateRangeEnd: '2019-01-28T19:00:16.078Z', + dateRangeEnd: '2025-01-28T19:00:16.078Z', }, }; const { diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/doc_count.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/doc_count.json index 4c4f62ae8c8e3..4daf223a79a69 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/doc_count.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/doc_count.json @@ -1 +1,8 @@ -{ "statesIndexStatus": { "docCount": { "count": 9234 }, "indexExists": true } } +{ + "statesIndexStatus": { + "docCount": { + "count": 2000 + }, + "indexExists": true + } +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/filter_list.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/filter_list.json index 63276215b12e8..f07e416322105 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/filter_list.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/filter_list.json @@ -1,37 +1,40 @@ { "filterBar": { "ids": [ - "auto-tcp-0X81440A68E839814C", - "auto-http-0XD9AE729FC1C1E04A", - "auto-http-0XDD2D4E60FD4A61C3", - "auto-http-0X3675F89EF0612091", - "auto-http-0X131221E73F825974", - "auto-http-0X9CB71300ABD5A2A8", - "auto-http-0X970CBD2F2102BFA8", - "auto-http-0XA8096548ECEB85B7", - "auto-http-0XC9CDA429418EDC2B", - "auto-http-0XE3B163481423197D" + "0000-intermittent", + "0001-up", + "0002-up", + "0003-up", + "0004-up", + "0005-up", + "0006-up", + "0007-up", + "0008-up", + "0009-up", + "0010-down", + "0011-up", + "0012-up", + "0013-up", + "0014-up", + "0015-intermittent", + "0016-up", + "0017-up", + "0018-up", + "0019-up" + ], + "locations": [ + "mpls" ], - "locations": [], "ports": [ - 9200, - 12349 + 5678 ], "schemes": [ - "http", - "tcp" + "http" ], "urls": [ - "tcp://localhost:9200", - "http://www.reddit.com/", - "https://www.elastic.co", - "http://localhost:12349/", - "https://www.google.com/", - "https://www.github.com/", - "http://www.google.com/", - "http://www.example.com/", - "https://news.google.com/", - "https://www.wikipedia.org/" + "http://localhost:5678/pattern?r=200x1", + "http://localhost:5678/pattern?r=200x5,500x1", + "http://localhost:5678/pattern?r=400x1" ] } } \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_charts.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_charts.json index 59816ab02cdcd..f5368ad7ecf0c 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_charts.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_charts.json @@ -2,48 +2,264 @@ "monitorChartsData": { "locationDurationLines": [ { - "name": "N/A", + "name": "mpls", "line": [ - { "x": 1548697571840, "y": 790701.3428571429 }, - { "x": 1548697764160, "y": 661065.4375 }, - { "x": 1548697956480, "y": 806260.8541666666 }, - { "x": 1548698148800, "y": 773767.7291666666 }, - { "x": 1548698341120, "y": 767945.0208333334 }, - { "x": 1548698533440, "y": 744078.7234042553 }, - { "x": 1548698725760, "y": 837049.4893617021 }, - { "x": 1548698918080, "y": 778723.1041666666 }, - { "x": 1548699110400, "y": 723974.1875 }, - { "x": 1548699302720, "y": 771744.3191489362 }, - { "x": 1548699495040, "y": 718773.081632653 }, - { "x": 1548699687360, "y": 724448.6458333334 }, - { "x": 1548699879680, "y": 747848.0833333334 }, - { "x": 1548700072000, "y": 748932.125 }, - { "x": 1548700264320, "y": 753010.2291666666 }, - { "x": 1548700456640, "y": 762055.6875 }, - { "x": 1548700648960, "y": 745954.7708333334 } + { + "x": 1568172657286, + "y": 16274 + }, + { + "x": 1568172680087, + "y": 16713 + }, + { + "x": 1568172702888, + "y": 34756 + }, + { + "x": 1568172725689, + "y": null + }, + { + "x": 1568172748490, + "y": 22205 + }, + { + "x": 1568172771291, + "y": 6071 + }, + { + "x": 1568172794092, + "y": 15681 + }, + { + "x": 1568172816893, + "y": null + }, + { + "x": 1568172839694, + "y": 1669 + }, + { + "x": 1568172862495, + "y": 956 + }, + { + "x": 1568172885296, + "y": 1435 + }, + { + "x": 1568172908097, + "y": null + }, + { + "x": 1568172930898, + "y": 32906 + }, + { + "x": 1568172953699, + "y": 892 + }, + { + "x": 1568172976500, + "y": 1514 + }, + { + "x": 1568172999301, + "y": null + }, + { + "x": 1568173022102, + "y": 2367 + }, + { + "x": 1568173044903, + "y": 3389 + }, + { + "x": 1568173067704, + "y": 362 + }, + { + "x": 1568173090505, + "y": null + }, + { + "x": 1568173113306, + "y": 3066 + }, + { + "x": 1568173136107, + "y": 44513 + }, + { + "x": 1568173158908, + "y": 6417 + }, + { + "x": 1568173181709, + "y": 1416 + }, + { + "x": 1568173204510, + "y": null + } ] } ], "status": [ - { "x": 1548697571840, "up": null, "down": null, "total": 35 }, - { "x": 1548697764160, "up": null, "down": null, "total": 48 }, - { "x": 1548697956480, "up": null, "down": null, "total": 48 }, - { "x": 1548698148800, "up": null, "down": null, "total": 48 }, - { "x": 1548698341120, "up": null, "down": null, "total": 48 }, - { "x": 1548698533440, "up": null, "down": null, "total": 47 }, - { "x": 1548698725760, "up": null, "down": null, "total": 47 }, - { "x": 1548698918080, "up": null, "down": null, "total": 48 }, - { "x": 1548699110400, "up": null, "down": null, "total": 48 }, - { "x": 1548699302720, "up": null, "down": null, "total": 47 }, - { "x": 1548699495040, "up": null, "down": null, "total": 49 }, - { "x": 1548699687360, "up": null, "down": null, "total": 48 }, - { "x": 1548699879680, "up": null, "down": null, "total": 48 }, - { "x": 1548700072000, "up": null, "down": null, "total": 48 }, - { "x": 1548700264320, "up": null, "down": null, "total": 48 }, - { "x": 1548700456640, "up": null, "down": null, "total": 48 }, - { "x": 1548700648960, "up": null, "down": null, "total": 48 } + { + "x": 1568172657286, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172680087, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172702888, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172725689, + "up": null, + "down": null, + "total": 0 + }, + { + "x": 1568172748490, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172771291, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172794092, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172816893, + "up": null, + "down": null, + "total": 0 + }, + { + "x": 1568172839694, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172862495, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172885296, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172908097, + "up": null, + "down": null, + "total": 0 + }, + { + "x": 1568172930898, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172953699, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172976500, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172999301, + "up": null, + "down": null, + "total": 0 + }, + { + "x": 1568173022102, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568173044903, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568173067704, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568173090505, + "up": null, + "down": null, + "total": 0 + }, + { + "x": 1568173113306, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568173136107, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568173158908, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568173181709, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568173204510, + "up": null, + "down": null, + "total": 0 + } ], "statusMaxCount": 0, "durationMaxValue": 0 } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_charts_empty_sets.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_charts_empty_sets.json new file mode 100644 index 0000000000000..b0b7d8e17391a --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_charts_empty_sets.json @@ -0,0 +1,8 @@ +{ + "monitorChartsData": { + "locationDurationLines": [], + "status": [], + "statusMaxCount": 0, + "durationMaxValue": 0 + } +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_page_title.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_page_title.json index 19a8c7274e5ff..c0dac6c3711bc 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_page_title.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_page_title.json @@ -1,7 +1,7 @@ { "monitorPageTitle": { - "id": "auto-http-0X131221E73F825974", - "url": "https://www.google.com/", + "id": "0002-up", + "url": "http://localhost:5678/pattern?r=200x1", "name": "" } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states.json index dc1046a770b26..59f5f95e7d840 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states.json @@ -1,102 +1,144 @@ { "monitorStates": { + "prevPagePagination": null, + "nextPagePagination": "{\"cursorDirection\":\"AFTER\",\"sortOrder\":\"ASC\",\"cursorKey\":{\"monitor_id\":\"0009-up\"}}", "totalSummaryCount": { - "count": 9234 + "count": 2000 }, "summaries": [ { - "monitor_id": "auto-http-0X131221E73F825974", + "monitor_id": "0000-intermittent", "histogram": { - "count": 840, + "count": 20, "points": [ { - "timestamp": 1548697571840, - "up": 35, + "timestamp": 1568172657286, + "up": 1, "down": 0 }, { - "timestamp": 1548697764160, - "up": 48, + "timestamp": 1568172680087, + "up": 1, "down": 0 }, { - "timestamp": 1548697956480, - "up": 48, + "timestamp": 1568172702888, + "up": 1, "down": 0 }, { - "timestamp": 1548698148800, - "up": 48, + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, "down": 0 }, { - "timestamp": 1548698341120, - "up": 48, + "timestamp": 1568172908097, + "up": 0, "down": 0 }, { - "timestamp": 1548698533440, - "up": 47, + "timestamp": 1568172930898, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172953699, + "up": 1, "down": 0 }, { - "timestamp": 1548698725760, - "up": 47, + "timestamp": 1568172976500, + "up": 1, "down": 0 }, { - "timestamp": 1548698918080, - "up": 48, + "timestamp": 1568172999301, + "up": 0, "down": 0 }, { - "timestamp": 1548699110400, - "up": 48, + "timestamp": 1568173022102, + "up": 1, "down": 0 }, { - "timestamp": 1548699302720, - "up": 47, + "timestamp": 1568173044903, + "up": 1, "down": 0 }, { - "timestamp": 1548699495040, - "up": 49, + "timestamp": 1568173067704, + "up": 1, "down": 0 }, { - "timestamp": 1548699687360, - "up": 48, + "timestamp": 1568173090505, + "up": 0, "down": 0 }, { - "timestamp": 1548699879680, - "up": 48, + "timestamp": 1568173113306, + "up": 1, "down": 0 }, { - "timestamp": 1548700072000, - "up": 48, + "timestamp": 1568173136107, + "up": 1, "down": 0 }, { - "timestamp": 1548700264320, - "up": 48, + "timestamp": 1568173158908, + "up": 1, "down": 0 }, { - "timestamp": 1548700456640, - "up": 48, + "timestamp": 1568173181709, + "up": 1, "down": 0 }, { - "timestamp": 1548700648960, - "up": 48, + "timestamp": 1568173204510, + "up": 0, "down": 0 }, { - "timestamp": 1548700841280, - "up": 39, + "timestamp": 1568173227311, + "up": 1, "down": 0 } ] @@ -106,28 +148,33 @@ "checks": [ { "agent": { - "id": "5884d7f7-9a49-4b0e-bff2-72a475aa695f" + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" }, "container": null, "kubernetes": null, "monitor": { - "ip": "172.217.12.132", + "ip": "127.0.0.1", "name": "", "status": "up" }, "observer": { "geo": { - "name": null, - "location": null + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } } }, - "timestamp": "1548700995077" + "timestamp": "1568173234371" } ], "geo": null, "observer": { "geo": { - "name": [], + "name": [ + "mpls" + ], "location": null } }, @@ -143,106 +190,146 @@ "geo": null }, "url": { - "full": "https://www.google.com/", - "domain": "www.google.com" + "full": "http://localhost:5678/pattern?r=200x5,500x1", + "domain": "localhost" }, - "timestamp": 1548700995077 + "timestamp": 1568173234371 } }, { - "monitor_id": "auto-http-0X3675F89EF0612091", + "monitor_id": "0001-up", "histogram": { - "count": 843, + "count": 20, "points": [ { - "timestamp": 1548697571840, - "up": 0, - "down": 35 + "timestamp": 1568172657286, + "up": 1, + "down": 0 }, { - "timestamp": 1548697764160, - "up": 0, - "down": 48 + "timestamp": 1568172680087, + "up": 1, + "down": 0 }, { - "timestamp": 1548697956480, - "up": 0, - "down": 48 + "timestamp": 1568172702888, + "up": 1, + "down": 0 }, { - "timestamp": 1548698148800, + "timestamp": 1568172725689, "up": 0, - "down": 48 + "down": 0 }, { - "timestamp": 1548698341120, - "up": 0, - "down": 48 + "timestamp": 1568172748490, + "up": 1, + "down": 0 }, { - "timestamp": 1548698533440, - "up": 0, - "down": 48 + "timestamp": 1568172771291, + "up": 1, + "down": 0 }, { - "timestamp": 1548698725760, - "up": 0, - "down": 48 + "timestamp": 1568172794092, + "up": 1, + "down": 0 }, { - "timestamp": 1548698918080, + "timestamp": 1568172816893, "up": 0, - "down": 48 + "down": 0 }, { - "timestamp": 1548699110400, - "up": 0, - "down": 48 + "timestamp": 1568172839694, + "up": 1, + "down": 0 }, { - "timestamp": 1548699302720, - "up": 0, - "down": 48 + "timestamp": 1568172862495, + "up": 1, + "down": 0 }, { - "timestamp": 1548699495040, - "up": 0, - "down": 49 + "timestamp": 1568172885296, + "up": 1, + "down": 0 }, { - "timestamp": 1548699687360, + "timestamp": 1568172908097, "up": 0, - "down": 48 + "down": 0 }, { - "timestamp": 1548699879680, - "up": 0, - "down": 48 + "timestamp": 1568172930898, + "up": 1, + "down": 0 }, { - "timestamp": 1548700072000, - "up": 0, - "down": 48 + "timestamp": 1568172953699, + "up": 1, + "down": 0 }, { - "timestamp": 1548700264320, - "up": 0, - "down": 48 + "timestamp": 1568172976500, + "up": 1, + "down": 0 }, { - "timestamp": 1548700456640, + "timestamp": 1568172999301, "up": 0, - "down": 48 + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 }, { - "timestamp": 1548700648960, + "timestamp": 1568173090505, "up": 0, - "down": 48 + "down": 0 }, { - "timestamp": 1548700841280, + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, "up": 0, - "down": 39 + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 } ] }, @@ -251,142 +338,187 @@ "checks": [ { "agent": { - "id": "5884d7f7-9a49-4b0e-bff2-72a475aa695f" + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" }, "container": null, "kubernetes": null, "monitor": { "ip": "127.0.0.1", "name": "", - "status": "down" + "status": "up" }, "observer": { "geo": { - "name": null, - "location": null + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } } }, - "timestamp": "1548700995077" + "timestamp": "1568173234371" } ], "geo": null, "observer": { "geo": { - "name": [], + "name": [ + "mpls" + ], "location": null } }, "monitor": { "id": null, "name": null, - "status": "down", + "status": "up", "type": null }, "summary": { - "up": 0, - "down": 1, + "up": 1, + "down": 0, "geo": null }, "url": { - "full": "http://localhost:12349/", + "full": "http://localhost:5678/pattern?r=200x1", "domain": "localhost" }, - "timestamp": 1548700995077 + "timestamp": 1568173234371 } }, { - "monitor_id": "auto-http-0X970CBD2F2102BFA8", + "monitor_id": "0002-up", "histogram": { - "count": 674, + "count": 20, "points": [ { - "timestamp": 1548697571840, - "up": 27, + "timestamp": 1568172657286, + "up": 1, "down": 0 }, { - "timestamp": 1548697764160, - "up": 39, + "timestamp": 1568172680087, + "up": 1, "down": 0 }, { - "timestamp": 1548697956480, - "up": 38, + "timestamp": 1568172702888, + "up": 1, "down": 0 }, { - "timestamp": 1548698148800, - "up": 39, + "timestamp": 1568172725689, + "up": 0, "down": 0 }, { - "timestamp": 1548698341120, - "up": 38, + "timestamp": 1568172748490, + "up": 1, "down": 0 }, { - "timestamp": 1548698533440, - "up": 39, + "timestamp": 1568172771291, + "up": 1, "down": 0 }, { - "timestamp": 1548698725760, - "up": 38, + "timestamp": 1568172794092, + "up": 1, "down": 0 }, { - "timestamp": 1548698918080, - "up": 39, + "timestamp": 1568172816893, + "up": 0, "down": 0 }, { - "timestamp": 1548699110400, - "up": 38, + "timestamp": 1568172839694, + "up": 1, "down": 0 }, { - "timestamp": 1548699302720, - "up": 38, + "timestamp": 1568172862495, + "up": 1, "down": 0 }, { - "timestamp": 1548699495040, - "up": 39, + "timestamp": 1568172885296, + "up": 1, "down": 0 }, { - "timestamp": 1548699687360, - "up": 38, + "timestamp": 1568172908097, + "up": 0, "down": 0 }, { - "timestamp": 1548699879680, - "up": 39, + "timestamp": 1568172930898, + "up": 1, "down": 0 }, { - "timestamp": 1548700072000, - "up": 38, + "timestamp": 1568172953699, + "up": 1, "down": 0 }, { - "timestamp": 1548700264320, - "up": 39, + "timestamp": 1568172976500, + "up": 1, "down": 0 }, { - "timestamp": 1548700456640, - "up": 38, + "timestamp": 1568172999301, + "up": 0, "down": 0 }, { - "timestamp": 1548700648960, - "up": 39, + "timestamp": 1568173022102, + "up": 1, "down": 0 }, { - "timestamp": 1548700841280, - "up": 31, + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, "down": 0 } ] @@ -396,28 +528,33 @@ "checks": [ { "agent": { - "id": "5884d7f7-9a49-4b0e-bff2-72a475aa695f" + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" }, "container": null, "kubernetes": null, "monitor": { - "ip": "172.217.12.132", + "ip": "127.0.0.1", "name": "", "status": "up" }, "observer": { "geo": { - "name": null, - "location": null + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } } }, - "timestamp": "1548700995077" + "timestamp": "1568173234371" } ], "geo": null, "observer": { "geo": { - "name": [], + "name": [ + "mpls" + ], "location": null } }, @@ -433,105 +570,145 @@ "geo": null }, "url": { - "full": "http://www.google.com/", - "domain": "www.google.com" + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" }, - "timestamp": 1548700995077 + "timestamp": 1568173234371 } }, { - "monitor_id": "auto-http-0X9CB71300ABD5A2A8", + "monitor_id": "0003-up", "histogram": { - "count": 781, + "count": 20, "points": [ { - "timestamp": 1548697571840, - "up": 32, + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, "down": 0 }, { - "timestamp": 1548697764160, - "up": 46, + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, "down": 0 }, { - "timestamp": 1548697956480, - "up": 44, + "timestamp": 1568172885296, + "up": 1, "down": 0 }, { - "timestamp": 1548698148800, - "up": 45, + "timestamp": 1568172908097, + "up": 0, "down": 0 }, { - "timestamp": 1548698341120, - "up": 42, + "timestamp": 1568172930898, + "up": 1, "down": 0 }, { - "timestamp": 1548698533440, - "up": 45, + "timestamp": 1568172953699, + "up": 1, "down": 0 }, { - "timestamp": 1548698725760, - "up": 44, + "timestamp": 1568172976500, + "up": 1, "down": 0 }, { - "timestamp": 1548698918080, - "up": 45, + "timestamp": 1568172999301, + "up": 0, "down": 0 }, { - "timestamp": 1548699110400, - "up": 44, + "timestamp": 1568173022102, + "up": 1, "down": 0 }, { - "timestamp": 1548699302720, - "up": 44, + "timestamp": 1568173044903, + "up": 1, "down": 0 }, { - "timestamp": 1548699495040, - "up": 46, + "timestamp": 1568173067704, + "up": 1, "down": 0 }, { - "timestamp": 1548699687360, - "up": 45, + "timestamp": 1568173090505, + "up": 0, "down": 0 }, { - "timestamp": 1548699879680, - "up": 44, + "timestamp": 1568173113306, + "up": 1, "down": 0 }, { - "timestamp": 1548700072000, - "up": 45, + "timestamp": 1568173136107, + "up": 1, "down": 0 }, { - "timestamp": 1548700264320, - "up": 43, + "timestamp": 1568173158908, + "up": 1, "down": 0 }, { - "timestamp": 1548700456640, - "up": 45, + "timestamp": 1568173181709, + "up": 1, "down": 0 }, { - "timestamp": 1548700648960, - "up": 45, + "timestamp": 1568173204510, + "up": 0, "down": 0 }, { - "timestamp": 1548700841280, - "up": 37, + "timestamp": 1568173227311, + "up": 1, "down": 0 } ] @@ -541,28 +718,33 @@ "checks": [ { "agent": { - "id": "5884d7f7-9a49-4b0e-bff2-72a475aa695f" + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" }, "container": null, "kubernetes": null, "monitor": { - "ip": "192.30.253.112", + "ip": "127.0.0.1", "name": "", "status": "up" }, "observer": { "geo": { - "name": null, - "location": null + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } } }, - "timestamp": "1548700995077" + "timestamp": "1568173234371" } ], "geo": null, "observer": { "geo": { - "name": [], + "name": [ + "mpls" + ], "location": null } }, @@ -578,106 +760,146 @@ "geo": null }, "url": { - "full": "https://www.github.com/", - "domain": "www.github.com" + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" }, - "timestamp": 1548700995077 + "timestamp": 1568173234371 } }, { - "monitor_id": "auto-http-0XA8096548ECEB85B7", + "monitor_id": "0004-up", "histogram": { - "count": 645, + "count": 20, "points": [ { - "timestamp": 1548697571840, - "up": 0, - "down": 28 + "timestamp": 1568172657286, + "up": 1, + "down": 0 }, { - "timestamp": 1548697764160, - "up": 0, - "down": 37 + "timestamp": 1568172680087, + "up": 1, + "down": 0 }, { - "timestamp": 1548697956480, - "up": 0, - "down": 38 + "timestamp": 1568172702888, + "up": 1, + "down": 0 }, { - "timestamp": 1548698148800, + "timestamp": 1568172725689, "up": 0, - "down": 38 + "down": 0 }, { - "timestamp": 1548698341120, - "up": 0, - "down": 39 + "timestamp": 1568172748490, + "up": 1, + "down": 0 }, { - "timestamp": 1548698533440, - "up": 0, - "down": 39 + "timestamp": 1568172771291, + "up": 1, + "down": 0 }, { - "timestamp": 1548698725760, - "up": 0, - "down": 28 + "timestamp": 1568172794092, + "up": 1, + "down": 0 }, { - "timestamp": 1548698918080, + "timestamp": 1568172816893, "up": 0, - "down": 30 + "down": 0 }, { - "timestamp": 1548699110400, - "up": 0, - "down": 28 + "timestamp": 1568172839694, + "up": 1, + "down": 0 }, { - "timestamp": 1548699302720, - "up": 0, - "down": 37 + "timestamp": 1568172862495, + "up": 1, + "down": 0 }, { - "timestamp": 1548699495040, - "up": 0, - "down": 40 + "timestamp": 1568172885296, + "up": 1, + "down": 0 }, { - "timestamp": 1548699687360, + "timestamp": 1568172908097, "up": 0, - "down": 38 + "down": 0 }, { - "timestamp": 1548699879680, - "up": 0, - "down": 39 + "timestamp": 1568172930898, + "up": 1, + "down": 0 }, { - "timestamp": 1548700072000, - "up": 0, - "down": 40 + "timestamp": 1568172953699, + "up": 1, + "down": 0 }, { - "timestamp": 1548700264320, - "up": 0, - "down": 39 + "timestamp": 1568172976500, + "up": 1, + "down": 0 }, { - "timestamp": 1548700456640, + "timestamp": 1568172999301, "up": 0, - "down": 38 + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 }, { - "timestamp": 1548700648960, + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, "up": 0, - "down": 39 + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 }, { - "timestamp": 1548700841280, + "timestamp": 1568173204510, "up": 0, - "down": 30 + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 } ] }, @@ -686,142 +908,187 @@ "checks": [ { "agent": { - "id": "5884d7f7-9a49-4b0e-bff2-72a475aa695f" + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" }, "container": null, "kubernetes": null, "monitor": { - "ip": "198.71.248.67", + "ip": "127.0.0.1", "name": "", - "status": "down" + "status": "up" }, "observer": { "geo": { - "name": null, - "location": null + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } } }, - "timestamp": "1548700987078" + "timestamp": "1568173234371" } ], "geo": null, "observer": { "geo": { - "name": [], + "name": [ + "mpls" + ], "location": null } }, "monitor": { "id": null, "name": null, - "status": "down", + "status": "up", "type": null }, "summary": { - "up": 0, - "down": 1, + "up": 1, + "down": 0, "geo": null }, "url": { - "full": "http://www.example.com/", - "domain": "www.example.com" + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" }, - "timestamp": 1548700987078 + "timestamp": 1568173234371 } }, { - "monitor_id": "auto-http-0XC9CDA429418EDC2B", + "monitor_id": "0005-up", "histogram": { - "count": 56, + "count": 20, "points": [ { - "timestamp": 1548697571840, - "up": 2, + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, "down": 0 }, { - "timestamp": 1548697764160, - "up": 3, + "timestamp": 1568172862495, + "up": 1, "down": 0 }, { - "timestamp": 1548697956480, - "up": 3, + "timestamp": 1568172885296, + "up": 1, "down": 0 }, { - "timestamp": 1548698148800, - "up": 4, + "timestamp": 1568172908097, + "up": 0, "down": 0 }, { - "timestamp": 1548698341120, - "up": 3, + "timestamp": 1568172930898, + "up": 1, "down": 0 }, { - "timestamp": 1548698533440, - "up": 3, + "timestamp": 1568172953699, + "up": 1, "down": 0 }, { - "timestamp": 1548698725760, - "up": 3, + "timestamp": 1568172976500, + "up": 1, "down": 0 }, { - "timestamp": 1548698918080, - "up": 3, + "timestamp": 1568172999301, + "up": 0, "down": 0 }, { - "timestamp": 1548699110400, - "up": 4, + "timestamp": 1568173022102, + "up": 1, "down": 0 }, { - "timestamp": 1548699302720, - "up": 3, + "timestamp": 1568173044903, + "up": 1, "down": 0 }, { - "timestamp": 1548699495040, - "up": 3, + "timestamp": 1568173067704, + "up": 1, "down": 0 }, { - "timestamp": 1548699687360, - "up": 3, + "timestamp": 1568173090505, + "up": 0, "down": 0 }, { - "timestamp": 1548699879680, - "up": 3, + "timestamp": 1568173113306, + "up": 1, "down": 0 }, { - "timestamp": 1548700072000, - "up": 4, + "timestamp": 1568173136107, + "up": 1, "down": 0 }, { - "timestamp": 1548700264320, - "up": 3, + "timestamp": 1568173158908, + "up": 1, "down": 0 }, { - "timestamp": 1548700456640, - "up": 3, + "timestamp": 1568173181709, + "up": 1, "down": 0 }, { - "timestamp": 1548700648960, - "up": 3, + "timestamp": 1568173204510, + "up": 0, "down": 0 }, { - "timestamp": 1548700841280, - "up": 3, + "timestamp": 1568173227311, + "up": 1, "down": 0 } ] @@ -831,28 +1098,33 @@ "checks": [ { "agent": { - "id": "5884d7f7-9a49-4b0e-bff2-72a475aa695f" + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" }, "container": null, "kubernetes": null, "monitor": { - "ip": "208.80.154.224", + "ip": "127.0.0.1", "name": "", "status": "up" }, "observer": { "geo": { - "name": null, - "location": null + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } } }, - "timestamp": "1548700975074" + "timestamp": "1568173234371" } ], "geo": null, "observer": { "geo": { - "name": [], + "name": [ + "mpls" + ], "location": null } }, @@ -868,105 +1140,145 @@ "geo": null }, "url": { - "full": "https://www.wikipedia.org/", - "domain": "www.wikipedia.org" + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" }, - "timestamp": 1548700975074 + "timestamp": 1568173234371 } }, { - "monitor_id": "auto-http-0XD9AE729FC1C1E04A", + "monitor_id": "0006-up", "histogram": { - "count": 991, + "count": 20, "points": [ { - "timestamp": 1548697571840, - "up": 38, + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, "down": 0 }, { - "timestamp": 1548697764160, - "up": 52, + "timestamp": 1568172702888, + "up": 1, "down": 0 }, { - "timestamp": 1548697956480, - "up": 51, + "timestamp": 1568172725689, + "up": 0, "down": 0 }, { - "timestamp": 1548698148800, - "up": 52, + "timestamp": 1568172748490, + "up": 1, "down": 0 }, { - "timestamp": 1548698341120, - "up": 58, + "timestamp": 1568172771291, + "up": 1, "down": 0 }, { - "timestamp": 1548698533440, - "up": 57, - "down": 1 + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 }, { - "timestamp": 1548698725760, - "up": 51, + "timestamp": 1568172839694, + "up": 1, "down": 0 }, { - "timestamp": 1548698918080, - "up": 52, + "timestamp": 1568172862495, + "up": 1, "down": 0 }, { - "timestamp": 1548699110400, - "up": 64, + "timestamp": 1568172885296, + "up": 1, "down": 0 }, { - "timestamp": 1548699302720, - "up": 64, + "timestamp": 1568172908097, + "up": 0, "down": 0 }, { - "timestamp": 1548699495040, - "up": 64, + "timestamp": 1568172930898, + "up": 1, "down": 0 }, { - "timestamp": 1548699687360, - "up": 63, + "timestamp": 1568172953699, + "up": 1, "down": 0 }, { - "timestamp": 1548699879680, - "up": 64, + "timestamp": 1568172976500, + "up": 1, "down": 0 }, { - "timestamp": 1548700072000, - "up": 65, + "timestamp": 1568172999301, + "up": 0, "down": 0 }, { - "timestamp": 1548700264320, - "up": 52, + "timestamp": 1568173022102, + "up": 1, "down": 0 }, { - "timestamp": 1548700456640, - "up": 51, + "timestamp": 1568173044903, + "up": 1, "down": 0 }, { - "timestamp": 1548700648960, - "up": 51, + "timestamp": 1568173067704, + "up": 1, "down": 0 }, { - "timestamp": 1548700841280, - "up": 41, + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, "down": 0 } ] @@ -976,28 +1288,33 @@ "checks": [ { "agent": { - "id": "5884d7f7-9a49-4b0e-bff2-72a475aa695f" + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" }, "container": null, "kubernetes": null, "monitor": { - "ip": "151.101.249.140", + "ip": "127.0.0.1", "name": "", "status": "up" }, "observer": { "geo": { - "name": null, - "location": null + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } } }, - "timestamp": "1548700993074" + "timestamp": "1568173234371" } ], "geo": null, "observer": { "geo": { - "name": [], + "name": [ + "mpls" + ], "location": null } }, @@ -1013,105 +1330,145 @@ "geo": null }, "url": { - "full": "http://www.reddit.com/", - "domain": "www.reddit.com" + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" }, - "timestamp": 1548700993074 + "timestamp": 1568173234371 } }, { - "monitor_id": "auto-http-0XDD2D4E60FD4A61C3", + "monitor_id": "0007-up", "histogram": { - "count": 975, + "count": 20, "points": [ { - "timestamp": 1548697571840, - "up": 37, + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, "down": 0 }, { - "timestamp": 1548697764160, - "up": 52, + "timestamp": 1568172816893, + "up": 0, "down": 0 }, { - "timestamp": 1548697956480, - "up": 51, + "timestamp": 1568172839694, + "up": 1, "down": 0 }, { - "timestamp": 1548698148800, - "up": 52, + "timestamp": 1568172862495, + "up": 1, "down": 0 }, { - "timestamp": 1548698341120, - "up": 58, + "timestamp": 1568172885296, + "up": 1, "down": 0 }, { - "timestamp": 1548698533440, - "up": 58, + "timestamp": 1568172908097, + "up": 0, "down": 0 }, { - "timestamp": 1548698725760, - "up": 51, + "timestamp": 1568172930898, + "up": 1, "down": 0 }, { - "timestamp": 1548698918080, - "up": 52, + "timestamp": 1568172953699, + "up": 1, "down": 0 }, { - "timestamp": 1548699110400, - "up": 61, + "timestamp": 1568172976500, + "up": 1, "down": 0 }, { - "timestamp": 1548699302720, - "up": 60, + "timestamp": 1568172999301, + "up": 0, "down": 0 }, { - "timestamp": 1548699495040, - "up": 61, + "timestamp": 1568173022102, + "up": 1, "down": 0 }, { - "timestamp": 1548699687360, - "up": 63, + "timestamp": 1568173044903, + "up": 1, "down": 0 }, { - "timestamp": 1548699879680, - "up": 62, + "timestamp": 1568173067704, + "up": 1, "down": 0 }, { - "timestamp": 1548700072000, - "up": 62, + "timestamp": 1568173090505, + "up": 0, "down": 0 }, { - "timestamp": 1548700264320, - "up": 52, + "timestamp": 1568173113306, + "up": 1, "down": 0 }, { - "timestamp": 1548700456640, - "up": 51, + "timestamp": 1568173136107, + "up": 1, "down": 0 }, { - "timestamp": 1548700648960, - "up": 51, + "timestamp": 1568173158908, + "up": 1, "down": 0 }, { - "timestamp": 1548700841280, - "up": 41, + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, "down": 0 } ] @@ -1121,28 +1478,33 @@ "checks": [ { "agent": { - "id": "5884d7f7-9a49-4b0e-bff2-72a475aa695f" + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" }, "container": null, "kubernetes": null, "monitor": { - "ip": "151.101.250.217", + "ip": "127.0.0.1", "name": "", "status": "up" }, "observer": { "geo": { - "name": null, - "location": null + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } } }, - "timestamp": "1548700993074" + "timestamp": "1568173234371" } ], "geo": null, "observer": { "geo": { - "name": [], + "name": [ + "mpls" + ], "location": null } }, @@ -1158,105 +1520,145 @@ "geo": null }, "url": { - "full": "https://www.elastic.co", - "domain": "www.elastic.co" + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" }, - "timestamp": 1548700993074 + "timestamp": 1568173234371 } }, { - "monitor_id": "auto-http-0XE3B163481423197D", + "monitor_id": "0008-up", "histogram": { - "count": 56, + "count": 20, "points": [ { - "timestamp": 1548697571840, - "up": 2, + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, "down": 0 }, { - "timestamp": 1548697764160, - "up": 3, + "timestamp": 1568172862495, + "up": 1, "down": 0 }, { - "timestamp": 1548697956480, - "up": 3, + "timestamp": 1568172885296, + "up": 1, "down": 0 }, { - "timestamp": 1548698148800, - "up": 4, + "timestamp": 1568172908097, + "up": 0, "down": 0 }, { - "timestamp": 1548698341120, - "up": 3, + "timestamp": 1568172930898, + "up": 1, "down": 0 }, { - "timestamp": 1548698533440, - "up": 3, + "timestamp": 1568172953699, + "up": 1, "down": 0 }, { - "timestamp": 1548698725760, - "up": 3, + "timestamp": 1568172976500, + "up": 1, "down": 0 }, { - "timestamp": 1548698918080, - "up": 3, + "timestamp": 1568172999301, + "up": 0, "down": 0 }, { - "timestamp": 1548699110400, - "up": 4, + "timestamp": 1568173022102, + "up": 1, "down": 0 }, { - "timestamp": 1548699302720, - "up": 3, + "timestamp": 1568173044903, + "up": 1, "down": 0 }, { - "timestamp": 1548699495040, - "up": 3, + "timestamp": 1568173067704, + "up": 1, "down": 0 }, { - "timestamp": 1548699687360, - "up": 3, + "timestamp": 1568173090505, + "up": 0, "down": 0 }, { - "timestamp": 1548699879680, - "up": 3, + "timestamp": 1568173113306, + "up": 1, "down": 0 }, { - "timestamp": 1548700072000, - "up": 4, + "timestamp": 1568173136107, + "up": 1, "down": 0 }, { - "timestamp": 1548700264320, - "up": 3, + "timestamp": 1568173158908, + "up": 1, "down": 0 }, { - "timestamp": 1548700456640, - "up": 3, + "timestamp": 1568173181709, + "up": 1, "down": 0 }, { - "timestamp": 1548700648960, - "up": 3, + "timestamp": 1568173204510, + "up": 0, "down": 0 }, { - "timestamp": 1548700841280, - "up": 3, + "timestamp": 1568173227311, + "up": 1, "down": 0 } ] @@ -1266,28 +1668,33 @@ "checks": [ { "agent": { - "id": "5884d7f7-9a49-4b0e-bff2-72a475aa695f" + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" }, "container": null, "kubernetes": null, "monitor": { - "ip": "216.58.219.206", + "ip": "127.0.0.1", "name": "", "status": "up" }, "observer": { "geo": { - "name": null, - "location": null + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } } }, - "timestamp": "1548700975074" + "timestamp": "1568173234371" } ], "geo": null, "observer": { "geo": { - "name": [], + "name": [ + "mpls" + ], "location": null } }, @@ -1303,105 +1710,145 @@ "geo": null }, "url": { - "full": "https://news.google.com/", - "domain": "news.google.com" + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" }, - "timestamp": 1548700975074 + "timestamp": 1568173234371 } }, { - "monitor_id": "auto-tcp-0X81440A68E839814C", + "monitor_id": "0009-up", "histogram": { - "count": 3373, + "count": 20, "points": [ { - "timestamp": 1548697571840, - "up": 2, - "down": 139 + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 }, { - "timestamp": 1548697764160, + "timestamp": 1568172725689, "up": 0, - "down": 192 + "down": 0 }, { - "timestamp": 1548697956480, + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, "up": 0, - "down": 192 + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 }, { - "timestamp": 1548698148800, + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, "up": 0, - "down": 193 + "down": 0 }, { - "timestamp": 1548698341120, - "up": 159, - "down": 33 + "timestamp": 1568172930898, + "up": 1, + "down": 0 }, { - "timestamp": 1548698533440, - "up": 192, + "timestamp": 1568172953699, + "up": 1, "down": 0 }, { - "timestamp": 1548698725760, - "up": 193, + "timestamp": 1568172976500, + "up": 1, "down": 0 }, { - "timestamp": 1548698918080, - "up": 192, + "timestamp": 1568172999301, + "up": 0, "down": 0 }, { - "timestamp": 1548699110400, - "up": 192, + "timestamp": 1568173022102, + "up": 1, "down": 0 }, { - "timestamp": 1548699302720, - "up": 192, + "timestamp": 1568173044903, + "up": 1, "down": 0 }, { - "timestamp": 1548699495040, - "up": 193, + "timestamp": 1568173067704, + "up": 1, "down": 0 }, { - "timestamp": 1548699687360, - "up": 192, + "timestamp": 1568173090505, + "up": 0, "down": 0 }, { - "timestamp": 1548699879680, - "up": 192, + "timestamp": 1568173113306, + "up": 1, "down": 0 }, { - "timestamp": 1548700072000, - "up": 193, + "timestamp": 1568173136107, + "up": 1, "down": 0 }, { - "timestamp": 1548700264320, - "up": 192, + "timestamp": 1568173158908, + "up": 1, "down": 0 }, { - "timestamp": 1548700456640, - "up": 192, + "timestamp": 1568173181709, + "up": 1, "down": 0 }, { - "timestamp": 1548700648960, - "up": 193, + "timestamp": 1568173204510, + "up": 0, "down": 0 }, { - "timestamp": 1548700841280, - "up": 155, + "timestamp": 1568173227311, + "up": 1, "down": 0 } ] @@ -1411,7 +1858,7 @@ "checks": [ { "agent": { - "id": "5884d7f7-9a49-4b0e-bff2-72a475aa695f" + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" }, "container": null, "kubernetes": null, @@ -1422,17 +1869,22 @@ }, "observer": { "geo": { - "name": null, - "location": null + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } } }, - "timestamp": "1548700996078" + "timestamp": "1568173234371" } ], "geo": null, "observer": { "geo": { - "name": [], + "name": [ + "mpls" + ], "location": null } }, @@ -1448,10 +1900,10 @@ "geo": null }, "url": { - "full": "tcp://localhost:9200", + "full": "http://localhost:5678/pattern?r=200x1", "domain": "localhost" }, - "timestamp": 1548700996078 + "timestamp": 1568173234371 } } ] diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_id_filtered.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_id_filtered.json index dccc788ea4642..9a1363f00578a 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_id_filtered.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_id_filtered.json @@ -1,102 +1,144 @@ { "monitorStates": { + "prevPagePagination": null, + "nextPagePagination": null, "totalSummaryCount": { - "count": 9234 + "count": 2000 }, "summaries": [ { - "monitor_id": "auto-http-0XDD2D4E60FD4A61C3", + "monitor_id": "0002-up", "histogram": { - "count": 975, + "count": 20, "points": [ { - "timestamp": 1548697571840, - "up": 37, + "timestamp": 1568172657286, + "up": 1, "down": 0 }, { - "timestamp": 1548697764160, - "up": 52, + "timestamp": 1568172680087, + "up": 1, "down": 0 }, { - "timestamp": 1548697956480, - "up": 51, + "timestamp": 1568172702888, + "up": 1, "down": 0 }, { - "timestamp": 1548698148800, - "up": 52, + "timestamp": 1568172725689, + "up": 0, "down": 0 }, { - "timestamp": 1548698341120, - "up": 58, + "timestamp": 1568172748490, + "up": 1, "down": 0 }, { - "timestamp": 1548698533440, - "up": 58, + "timestamp": 1568172771291, + "up": 1, "down": 0 }, { - "timestamp": 1548698725760, - "up": 51, + "timestamp": 1568172794092, + "up": 1, "down": 0 }, { - "timestamp": 1548698918080, - "up": 52, + "timestamp": 1568172816893, + "up": 0, "down": 0 }, { - "timestamp": 1548699110400, - "up": 61, + "timestamp": 1568172839694, + "up": 1, "down": 0 }, { - "timestamp": 1548699302720, - "up": 60, + "timestamp": 1568172862495, + "up": 1, "down": 0 }, { - "timestamp": 1548699495040, - "up": 61, + "timestamp": 1568172885296, + "up": 1, "down": 0 }, { - "timestamp": 1548699687360, - "up": 63, + "timestamp": 1568172908097, + "up": 0, "down": 0 }, { - "timestamp": 1548699879680, - "up": 62, + "timestamp": 1568172930898, + "up": 1, "down": 0 }, { - "timestamp": 1548700072000, - "up": 62, + "timestamp": 1568172953699, + "up": 1, "down": 0 }, { - "timestamp": 1548700264320, - "up": 52, + "timestamp": 1568172976500, + "up": 1, "down": 0 }, { - "timestamp": 1548700456640, - "up": 51, + "timestamp": 1568172999301, + "up": 0, "down": 0 }, { - "timestamp": 1548700648960, - "up": 51, + "timestamp": 1568173022102, + "up": 1, "down": 0 }, { - "timestamp": 1548700841280, - "up": 41, + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, "down": 0 } ] @@ -106,28 +148,33 @@ "checks": [ { "agent": { - "id": "5884d7f7-9a49-4b0e-bff2-72a475aa695f" + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" }, "container": null, "kubernetes": null, "monitor": { - "ip": "151.101.250.217", + "ip": "127.0.0.1", "name": "", "status": "up" }, "observer": { "geo": { - "name": null, - "location": null + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } } }, - "timestamp": "1548700993074" + "timestamp": "1568173234371" } ], "geo": null, "observer": { "geo": { - "name": [], + "name": [ + "mpls" + ], "location": null } }, @@ -143,10 +190,10 @@ "geo": null }, "url": { - "full": "https://www.elastic.co", - "domain": "www.elastic.co" + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" }, - "timestamp": 1548700993074 + "timestamp": 1568173234371 } } ] diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_1.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_1.json new file mode 100644 index 0000000000000..59f5f95e7d840 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_1.json @@ -0,0 +1,1911 @@ +{ + "monitorStates": { + "prevPagePagination": null, + "nextPagePagination": "{\"cursorDirection\":\"AFTER\",\"sortOrder\":\"ASC\",\"cursorKey\":{\"monitor_id\":\"0009-up\"}}", + "totalSummaryCount": { + "count": 2000 + }, + "summaries": [ + { + "monitor_id": "0000-intermittent", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x5,500x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0001-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0002-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0003-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0004-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0005-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0006-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0007-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0008-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0009-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + } + ] + } +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_10.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_10.json new file mode 100644 index 0000000000000..5c07b4daaf543 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_10.json @@ -0,0 +1,1911 @@ +{ + "monitorStates": { + "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0090-intermittent\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", + "nextPagePagination": null, + "totalSummaryCount": { + "count": 2000 + }, + "summaries": [ + { + "monitor_id": "0090-intermittent", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234374" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x5,500x1", + "domain": "localhost" + }, + "timestamp": 1568173234374 + } + }, + { + "monitor_id": "0091-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234374" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234374 + } + }, + { + "monitor_id": "0092-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234375" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234375 + } + }, + { + "monitor_id": "0093-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234375" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234375 + } + }, + { + "monitor_id": "0094-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234375" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234375 + } + }, + { + "monitor_id": "0095-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234375" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234375 + } + }, + { + "monitor_id": "0096-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234376" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234376 + } + }, + { + "monitor_id": "0097-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234405" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234405 + } + }, + { + "monitor_id": "0098-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234406" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234406 + } + }, + { + "monitor_id": "0099-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234406" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234406 + } + } + ] + } +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_10_previous.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_10_previous.json new file mode 100644 index 0000000000000..71184093f4318 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_10_previous.json @@ -0,0 +1,1911 @@ +{ + "monitorStates": { + "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0080-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", + "nextPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0089-up\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"AFTER\"}", + "totalSummaryCount": { + "count": 2000 + }, + "summaries": [ + { + "monitor_id": "0080-down", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172680087, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172702888, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172771291, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172794092, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172862495, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172885296, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172953699, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172976500, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173044903, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173067704, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173136107, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173158908, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173181709, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 0, + "down": 1 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "down" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "down", + "type": null + }, + "summary": { + "up": 0, + "down": 1, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=400x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0081-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0082-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0083-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0084-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0085-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0086-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0087-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0088-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0089-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + } + ] + } +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_2.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_2.json new file mode 100644 index 0000000000000..3b15ea3c24eeb --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_2.json @@ -0,0 +1,1911 @@ +{ + "monitorStates": { + "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0010-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", + "nextPagePagination": "{\"cursorDirection\":\"AFTER\",\"sortOrder\":\"ASC\",\"cursorKey\":{\"monitor_id\":\"0019-up\"}}", + "totalSummaryCount": { + "count": 2000 + }, + "summaries": [ + { + "monitor_id": "0010-down", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172680087, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172702888, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172771291, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172794092, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172862495, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172885296, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172953699, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172976500, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173044903, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173067704, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173136107, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173158908, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173181709, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 0, + "down": 1 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "down" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "down", + "type": null + }, + "summary": { + "up": 0, + "down": 1, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=400x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0011-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0012-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0013-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0014-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0015-intermittent", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x5,500x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0016-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0017-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0018-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0019-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + } + ] + } +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_2_previous.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_2_previous.json new file mode 100644 index 0000000000000..eb6512d2f75b3 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_2_previous.json @@ -0,0 +1,1911 @@ +{ + "monitorStates": { + "prevPagePagination": null, + "nextPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0009-up\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"AFTER\"}", + "totalSummaryCount": { + "count": 2000 + }, + "summaries": [ + { + "monitor_id": "0000-intermittent", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x5,500x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0001-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0002-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0003-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0004-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0005-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0006-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0007-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0008-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0009-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + } + ] + } +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_3.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_3.json new file mode 100644 index 0000000000000..aee4fa6946fc0 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_3.json @@ -0,0 +1,1911 @@ +{ + "monitorStates": { + "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0020-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", + "nextPagePagination": "{\"cursorDirection\":\"AFTER\",\"sortOrder\":\"ASC\",\"cursorKey\":{\"monitor_id\":\"0029-up\"}}", + "totalSummaryCount": { + "count": 2000 + }, + "summaries": [ + { + "monitor_id": "0020-down", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172680087, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172702888, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172771291, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172794092, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172862495, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172885296, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172953699, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172976500, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173044903, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173067704, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173136107, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173158908, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173181709, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 0, + "down": 1 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "down" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "down", + "type": null + }, + "summary": { + "up": 0, + "down": 1, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=400x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0021-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0022-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0023-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0024-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0025-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0026-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0027-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0028-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0029-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + } + ] + } +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_3_previous.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_3_previous.json new file mode 100644 index 0000000000000..03164f794a4d5 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_3_previous.json @@ -0,0 +1,1911 @@ +{ + "monitorStates": { + "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0010-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", + "nextPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0019-up\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"AFTER\"}", + "totalSummaryCount": { + "count": 2000 + }, + "summaries": [ + { + "monitor_id": "0010-down", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172680087, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172702888, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172771291, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172794092, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172862495, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172885296, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172953699, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172976500, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173044903, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173067704, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173136107, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173158908, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173181709, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 0, + "down": 1 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "down" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "down", + "type": null + }, + "summary": { + "up": 0, + "down": 1, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=400x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0011-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0012-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0013-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0014-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0015-intermittent", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x5,500x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0016-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0017-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0018-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0019-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + } + ] + } +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_4.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_4.json new file mode 100644 index 0000000000000..488fdab14f1e2 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_4.json @@ -0,0 +1,1911 @@ +{ + "monitorStates": { + "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0030-intermittent\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", + "nextPagePagination": "{\"cursorDirection\":\"AFTER\",\"sortOrder\":\"ASC\",\"cursorKey\":{\"monitor_id\":\"0039-up\"}}", + "totalSummaryCount": { + "count": 2000 + }, + "summaries": [ + { + "monitor_id": "0030-intermittent", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173067704, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 0, + "down": 1 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "down" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "down", + "type": null + }, + "summary": { + "up": 0, + "down": 1, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x5,500x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0031-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234374" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234374 + } + }, + { + "monitor_id": "0032-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234375" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234375 + } + }, + { + "monitor_id": "0033-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0034-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0035-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0036-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0037-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0038-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0039-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + } + ] + } +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_4_previous.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_4_previous.json new file mode 100644 index 0000000000000..79ce05d86f533 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_4_previous.json @@ -0,0 +1,1911 @@ +{ + "monitorStates": { + "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0020-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", + "nextPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0029-up\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"AFTER\"}", + "totalSummaryCount": { + "count": 2000 + }, + "summaries": [ + { + "monitor_id": "0020-down", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172680087, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172702888, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172771291, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172794092, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172862495, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172885296, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172953699, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172976500, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173044903, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173067704, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173136107, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173158908, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173181709, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 0, + "down": 1 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "down" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "down", + "type": null + }, + "summary": { + "up": 0, + "down": 1, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=400x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0021-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0022-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0023-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0024-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0025-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0026-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0027-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0028-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0029-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + } + ] + } +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_5.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_5.json new file mode 100644 index 0000000000000..ef62cdd86c2a9 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_5.json @@ -0,0 +1,1911 @@ +{ + "monitorStates": { + "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0040-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", + "nextPagePagination": "{\"cursorDirection\":\"AFTER\",\"sortOrder\":\"ASC\",\"cursorKey\":{\"monitor_id\":\"0049-up\"}}", + "totalSummaryCount": { + "count": 2000 + }, + "summaries": [ + { + "monitor_id": "0040-down", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172680087, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172702888, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172771291, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172794092, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172862495, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172885296, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172953699, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172976500, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173044903, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173067704, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173136107, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173158908, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173181709, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 0, + "down": 1 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "down" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "down", + "type": null + }, + "summary": { + "up": 0, + "down": 1, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=400x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0041-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0042-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0043-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0044-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0045-intermittent", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172794092, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x5,500x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0046-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234374" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234374 + } + }, + { + "monitor_id": "0047-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234390" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234390 + } + }, + { + "monitor_id": "0048-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234386" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234386 + } + }, + { + "monitor_id": "0049-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234405" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234405 + } + } + ] + } +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_5_previous.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_5_previous.json new file mode 100644 index 0000000000000..34e8269cb95d9 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_5_previous.json @@ -0,0 +1,1911 @@ +{ + "monitorStates": { + "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0030-intermittent\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", + "nextPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0039-up\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"AFTER\"}", + "totalSummaryCount": { + "count": 2000 + }, + "summaries": [ + { + "monitor_id": "0030-intermittent", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173067704, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 0, + "down": 1 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "down" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "down", + "type": null + }, + "summary": { + "up": 0, + "down": 1, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x5,500x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0031-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234374" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234374 + } + }, + { + "monitor_id": "0032-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234375" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234375 + } + }, + { + "monitor_id": "0033-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0034-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0035-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0036-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0037-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0038-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0039-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + } + ] + } +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_6.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_6.json new file mode 100644 index 0000000000000..d733467c3f9b6 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_6.json @@ -0,0 +1,1911 @@ +{ + "monitorStates": { + "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0050-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", + "nextPagePagination": "{\"cursorDirection\":\"AFTER\",\"sortOrder\":\"ASC\",\"cursorKey\":{\"monitor_id\":\"0059-up\"}}", + "totalSummaryCount": { + "count": 2000 + }, + "summaries": [ + { + "monitor_id": "0050-down", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172680087, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172702888, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172771291, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172794092, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172862495, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172885296, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172953699, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172976500, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173044903, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173067704, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173136107, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173158908, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173181709, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 0, + "down": 1 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "down" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234386" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "down", + "type": null + }, + "summary": { + "up": 0, + "down": 1, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=400x1", + "domain": "localhost" + }, + "timestamp": 1568173234386 + } + }, + { + "monitor_id": "0051-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0052-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0053-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0054-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0055-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0056-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0057-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0058-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0059-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + } + ] + } +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_6_previous.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_6_previous.json new file mode 100644 index 0000000000000..12e27106bd533 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_6_previous.json @@ -0,0 +1,1911 @@ +{ + "monitorStates": { + "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0040-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", + "nextPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0049-up\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"AFTER\"}", + "totalSummaryCount": { + "count": 2000 + }, + "summaries": [ + { + "monitor_id": "0040-down", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172680087, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172702888, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172771291, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172794092, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172862495, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172885296, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172953699, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172976500, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173044903, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173067704, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173136107, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173158908, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173181709, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 0, + "down": 1 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "down" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "down", + "type": null + }, + "summary": { + "up": 0, + "down": 1, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=400x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0041-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0042-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0043-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0044-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0045-intermittent", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172794092, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x5,500x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0046-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234374" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234374 + } + }, + { + "monitor_id": "0047-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234390" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234390 + } + }, + { + "monitor_id": "0048-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234386" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234386 + } + }, + { + "monitor_id": "0049-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234405" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234405 + } + } + ] + } +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_7.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_7.json new file mode 100644 index 0000000000000..d0f2b820f8327 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_7.json @@ -0,0 +1,1911 @@ +{ + "monitorStates": { + "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0060-intermittent\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", + "nextPagePagination": "{\"cursorDirection\":\"AFTER\",\"sortOrder\":\"ASC\",\"cursorKey\":{\"monitor_id\":\"0069-up\"}}", + "totalSummaryCount": { + "count": 2000 + }, + "summaries": [ + { + "monitor_id": "0060-intermittent", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172862495, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x5,500x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0061-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0062-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0063-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0064-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0065-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0066-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234374" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234374 + } + }, + { + "monitor_id": "0067-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234374" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234374 + } + }, + { + "monitor_id": "0068-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234374" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234374 + } + }, + { + "monitor_id": "0069-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234375" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234375 + } + } + ] + } +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_7_previous.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_7_previous.json new file mode 100644 index 0000000000000..cf0c8641cc87b --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_7_previous.json @@ -0,0 +1,1911 @@ +{ + "monitorStates": { + "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0050-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", + "nextPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0059-up\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"AFTER\"}", + "totalSummaryCount": { + "count": 2000 + }, + "summaries": [ + { + "monitor_id": "0050-down", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172680087, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172702888, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172771291, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172794092, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172862495, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172885296, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172953699, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172976500, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173044903, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173067704, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173136107, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173158908, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173181709, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 0, + "down": 1 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "down" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234386" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "down", + "type": null + }, + "summary": { + "up": 0, + "down": 1, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=400x1", + "domain": "localhost" + }, + "timestamp": 1568173234386 + } + }, + { + "monitor_id": "0051-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0052-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0053-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0054-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0055-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0056-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0057-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0058-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0059-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + } + ] + } +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_8.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_8.json new file mode 100644 index 0000000000000..2801e94e034c7 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_8.json @@ -0,0 +1,1911 @@ +{ + "monitorStates": { + "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0070-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", + "nextPagePagination": "{\"cursorDirection\":\"AFTER\",\"sortOrder\":\"ASC\",\"cursorKey\":{\"monitor_id\":\"0079-up\"}}", + "totalSummaryCount": { + "count": 2000 + }, + "summaries": [ + { + "monitor_id": "0070-down", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172680087, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172702888, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172771291, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172794092, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172862495, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172885296, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172953699, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172976500, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173044903, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173067704, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173136107, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173158908, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173181709, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 0, + "down": 1 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "down" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234375" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "down", + "type": null + }, + "summary": { + "up": 0, + "down": 1, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=400x1", + "domain": "localhost" + }, + "timestamp": 1568173234375 + } + }, + { + "monitor_id": "0071-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234375" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234375 + } + }, + { + "monitor_id": "0072-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234376" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234376 + } + }, + { + "monitor_id": "0073-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234406" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234406 + } + }, + { + "monitor_id": "0074-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234410" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234410 + } + }, + { + "monitor_id": "0075-intermittent", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234406" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x5,500x1", + "domain": "localhost" + }, + "timestamp": 1568173234406 + } + }, + { + "monitor_id": "0076-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234387" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234387 + } + }, + { + "monitor_id": "0077-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234389" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234389 + } + }, + { + "monitor_id": "0078-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0079-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + } + ] + } +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_8_previous.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_8_previous.json new file mode 100644 index 0000000000000..7fcbd4dd59659 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_8_previous.json @@ -0,0 +1,1911 @@ +{ + "monitorStates": { + "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0060-intermittent\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", + "nextPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0069-up\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"AFTER\"}", + "totalSummaryCount": { + "count": 2000 + }, + "summaries": [ + { + "monitor_id": "0060-intermittent", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172862495, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x5,500x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0061-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0062-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0063-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0064-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0065-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0066-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234374" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234374 + } + }, + { + "monitor_id": "0067-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234374" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234374 + } + }, + { + "monitor_id": "0068-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234374" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234374 + } + }, + { + "monitor_id": "0069-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234375" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234375 + } + } + ] + } +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_9.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_9.json new file mode 100644 index 0000000000000..0adb7ad0b0dba --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_9.json @@ -0,0 +1,1911 @@ +{ + "monitorStates": { + "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0080-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", + "nextPagePagination": "{\"cursorDirection\":\"AFTER\",\"sortOrder\":\"ASC\",\"cursorKey\":{\"monitor_id\":\"0089-up\"}}", + "totalSummaryCount": { + "count": 2000 + }, + "summaries": [ + { + "monitor_id": "0080-down", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172680087, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172702888, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172771291, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172794092, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172862495, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172885296, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172953699, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172976500, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173044903, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173067704, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173136107, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173158908, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173181709, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 0, + "down": 1 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "down" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "down", + "type": null + }, + "summary": { + "up": 0, + "down": 1, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=400x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0081-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0082-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234372" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234372 + } + }, + { + "monitor_id": "0083-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0084-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0085-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0086-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0087-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0088-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + }, + { + "monitor_id": "0089-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234373" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234373 + } + } + ] + } +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_9_previous.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_9_previous.json new file mode 100644 index 0000000000000..a796be38bd0d9 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_9_previous.json @@ -0,0 +1,1911 @@ +{ + "monitorStates": { + "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0070-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", + "nextPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0079-up\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"AFTER\"}", + "totalSummaryCount": { + "count": 2000 + }, + "summaries": [ + { + "monitor_id": "0070-down", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172680087, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172702888, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172771291, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172794092, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172862495, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172885296, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172953699, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172976500, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173044903, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173067704, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173136107, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173158908, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173181709, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 0, + "down": 1 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "down" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234375" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "down", + "type": null + }, + "summary": { + "up": 0, + "down": 1, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=400x1", + "domain": "localhost" + }, + "timestamp": 1568173234375 + } + }, + { + "monitor_id": "0071-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234375" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234375 + } + }, + { + "monitor_id": "0072-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234376" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234376 + } + }, + { + "monitor_id": "0073-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234406" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234406 + } + }, + { + "monitor_id": "0074-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234410" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234410 + } + }, + { + "monitor_id": "0075-intermittent", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 0, + "down": 1 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234406" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x5,500x1", + "domain": "localhost" + }, + "timestamp": 1568173234406 + } + }, + { + "monitor_id": "0076-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234387" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234387 + } + }, + { + "monitor_id": "0077-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234389" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234389 + } + }, + { + "monitor_id": "0078-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + }, + { + "monitor_id": "0079-up", + "histogram": { + "count": 20, + "points": [ + { + "timestamp": 1568172657286, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172680087, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172702888, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172725689, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172748490, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172771291, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172794092, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172816893, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172839694, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172862495, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172885296, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172908097, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568172930898, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172953699, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172976500, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568172999301, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173022102, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173044903, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173067704, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173090505, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173113306, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173136107, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173158908, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173181709, + "up": 1, + "down": 0 + }, + { + "timestamp": 1568173204510, + "up": 0, + "down": 0 + }, + { + "timestamp": 1568173227311, + "up": 1, + "down": 0 + } + ] + }, + "state": { + "agent": null, + "checks": [ + { + "agent": { + "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" + }, + "container": null, + "kubernetes": null, + "monitor": { + "ip": "127.0.0.1", + "name": "", + "status": "up" + }, + "observer": { + "geo": { + "name": "mpls", + "location": { + "lat": 37.926867976784706, + "lon": -78.02490200847387 + } + } + }, + "timestamp": "1568173234371" + } + ], + "geo": null, + "observer": { + "geo": { + "name": [ + "mpls" + ], + "location": null + } + }, + "monitor": { + "id": null, + "name": null, + "status": "up", + "type": null + }, + "summary": { + "up": 1, + "down": 0, + "geo": null + }, + "url": { + "full": "http://localhost:5678/pattern?r=200x1", + "domain": "localhost" + }, + "timestamp": 1568173234371 + } + } + ] + } +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_status_all.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_status_all.json new file mode 100644 index 0000000000000..9b91ce3f1e03c --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_status_all.json @@ -0,0 +1,1802 @@ +[ + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 15167 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x5,500x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 35534 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 24627 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 2569 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 35258 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 19044 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 14876 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 1254 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 1926 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 35620 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "down", + "duration": { + "us": 37926 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=400x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 37168 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 19470 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.372Z", + "monitor": { + "status": "up", + "duration": { + "us": 18192 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.372Z", + "monitor": { + "status": "up", + "duration": { + "us": 33904 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 1544 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x5,500x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 35587 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 34550 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 36410 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 24177 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.372Z", + "monitor": { + "status": "down", + "duration": { + "us": 14900 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=400x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.372Z", + "monitor": { + "status": "up", + "duration": { + "us": 15123 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.372Z", + "monitor": { + "status": "up", + "duration": { + "us": 34525 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.372Z", + "monitor": { + "status": "up", + "duration": { + "us": 35289 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.372Z", + "monitor": { + "status": "up", + "duration": { + "us": 13614 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.373Z", + "monitor": { + "status": "up", + "duration": { + "us": 33974 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.373Z", + "monitor": { + "status": "up", + "duration": { + "us": 33311 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.373Z", + "monitor": { + "status": "up", + "duration": { + "us": 36139 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.373Z", + "monitor": { + "status": "up", + "duration": { + "us": 35573 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.373Z", + "monitor": { + "status": "up", + "duration": { + "us": 35594 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.373Z", + "monitor": { + "status": "down", + "duration": { + "us": 17146 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x5,500x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.374Z", + "monitor": { + "status": "up", + "duration": { + "us": 21874 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.375Z", + "monitor": { + "status": "up", + "duration": { + "us": 15065 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 3874 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 35060 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.372Z", + "monitor": { + "status": "up", + "duration": { + "us": 1637 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.372Z", + "monitor": { + "status": "up", + "duration": { + "us": 3426 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.372Z", + "monitor": { + "status": "up", + "duration": { + "us": 18348 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.372Z", + "monitor": { + "status": "up", + "duration": { + "us": 34355 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.372Z", + "monitor": { + "status": "up", + "duration": { + "us": 18338 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.372Z", + "monitor": { + "status": "down", + "duration": { + "us": 18106 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=400x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.373Z", + "monitor": { + "status": "up", + "duration": { + "us": 13666 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.373Z", + "monitor": { + "status": "up", + "duration": { + "us": 17255 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.373Z", + "monitor": { + "status": "up", + "duration": { + "us": 36248 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.373Z", + "monitor": { + "status": "up", + "duration": { + "us": 35652 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.373Z", + "monitor": { + "status": "up", + "duration": { + "us": 16290 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x5,500x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.374Z", + "monitor": { + "status": "up", + "duration": { + "us": 16135 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.390Z", + "monitor": { + "status": "up", + "duration": { + "us": 365 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.386Z", + "monitor": { + "status": "up", + "duration": { + "us": 4784 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.405Z", + "monitor": { + "status": "up", + "duration": { + "us": 602 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.386Z", + "monitor": { + "status": "down", + "duration": { + "us": 4258 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=400x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 35234 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 19965 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 2120 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 35140 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 37103 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 36842 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.372Z", + "monitor": { + "status": "up", + "duration": { + "us": 1426 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.372Z", + "monitor": { + "status": "up", + "duration": { + "us": 1526 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.372Z", + "monitor": { + "status": "up", + "duration": { + "us": 18682 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.372Z", + "monitor": { + "status": "up", + "duration": { + "us": 13605 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x5,500x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.373Z", + "monitor": { + "status": "up", + "duration": { + "us": 18194 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.373Z", + "monitor": { + "status": "up", + "duration": { + "us": 22666 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.373Z", + "monitor": { + "status": "up", + "duration": { + "us": 17770 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.373Z", + "monitor": { + "status": "up", + "duration": { + "us": 35698 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.373Z", + "monitor": { + "status": "up", + "duration": { + "us": 17587 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.374Z", + "monitor": { + "status": "up", + "duration": { + "us": 36584 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.374Z", + "monitor": { + "status": "up", + "duration": { + "us": 15499 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.374Z", + "monitor": { + "status": "up", + "duration": { + "us": 15464 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.375Z", + "monitor": { + "status": "up", + "duration": { + "us": 15183 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.375Z", + "monitor": { + "status": "down", + "duration": { + "us": 15117 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=400x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.375Z", + "monitor": { + "status": "up", + "duration": { + "us": 14875 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.376Z", + "monitor": { + "status": "up", + "duration": { + "us": 14580 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.406Z", + "monitor": { + "status": "up", + "duration": { + "us": 441 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.410Z", + "monitor": { + "status": "up", + "duration": { + "us": 413 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.406Z", + "monitor": { + "status": "up", + "duration": { + "us": 304 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x5,500x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.387Z", + "monitor": { + "status": "up", + "duration": { + "us": 2808 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.389Z", + "monitor": { + "status": "up", + "duration": { + "us": 870 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 24419 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 35454 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "down", + "duration": { + "us": 36171 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=400x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.372Z", + "monitor": { + "status": "up", + "duration": { + "us": 36785 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.372Z", + "monitor": { + "status": "up", + "duration": { + "us": 35312 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.373Z", + "monitor": { + "status": "up", + "duration": { + "us": 13442 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.373Z", + "monitor": { + "status": "up", + "duration": { + "us": 3148 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.373Z", + "monitor": { + "status": "up", + "duration": { + "us": 33506 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.373Z", + "monitor": { + "status": "up", + "duration": { + "us": 35830 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.373Z", + "monitor": { + "status": "up", + "duration": { + "us": 34600 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.373Z", + "monitor": { + "status": "up", + "duration": { + "us": 33693 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.373Z", + "monitor": { + "status": "up", + "duration": { + "us": 33833 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.374Z", + "monitor": { + "status": "up", + "duration": { + "us": 21736 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x5,500x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.374Z", + "monitor": { + "status": "up", + "duration": { + "us": 15428 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.375Z", + "monitor": { + "status": "up", + "duration": { + "us": 15308 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.375Z", + "monitor": { + "status": "up", + "duration": { + "us": 15013 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.375Z", + "monitor": { + "status": "up", + "duration": { + "us": 14911 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.375Z", + "monitor": { + "status": "up", + "duration": { + "us": 14801 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.376Z", + "monitor": { + "status": "up", + "duration": { + "us": 14679 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.405Z", + "monitor": { + "status": "up", + "duration": { + "us": 487 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.406Z", + "monitor": { + "status": "up", + "duration": { + "us": 558 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + }, + { + "timestamp": "2019-09-11T03:40:34.406Z", + "monitor": { + "status": "up", + "duration": { + "us": 482 + } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" + } + } +] \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_status_by_id.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_status_by_id.json index a05ab4f971899..8899803365595 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_status_by_id.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_status_by_id.json @@ -1,18 +1,20 @@ -{ - "monitorStatus": [ - { - "timestamp": "2019-01-28T18:43:16.078Z", - "monitor": { - "status": "up", - "duration": { - "us": 3328 - } - }, - "observer": null, - "tls": null, - "url": { - "full": "tcp://localhost:9200" +[ + { + "timestamp": "2019-09-11T03:40:34.371Z", + "monitor": { + "status": "up", + "duration": { + "us": 24627 } + }, + "observer": { + "geo": { + "name": "mpls" + } + }, + "tls": null, + "url": { + "full": "http://localhost:5678/pattern?r=200x1" } - ] -} \ No newline at end of file + } +] \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list.json index b2b8601b0de7d..330ec83931a62 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list.json @@ -1,207 +1,319 @@ { "allPings": { - "total": 9234, + "total": 2000, "locations": [ - "N/A" + "mpls" ], "pings": [ { - "timestamp": "2019-01-28T18:43:16.078Z", - "http": null, + "timestamp": "2019-09-11T03:40:34.410Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 3328 + "us": 413 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0074-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:15.077Z", - "http": null, - "error": { - "message": "Get http://localhost:12349/: dial tcp 127.0.0.1:12349: connect: connection refused", - "type": "io" + "timestamp": "2019-09-11T03:40:34.406Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } }, + "error": null, "monitor": { "duration": { - "us": 3331 + "us": 441 }, - "id": "auto-http-0X3675F89EF0612091", + "id": "0073-up", "ip": "127.0.0.1", "name": "", "scheme": null, - "status": "down", + "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:15.077Z", - "http": null, + "timestamp": "2019-09-11T03:40:34.406Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 3292 + "us": 482 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0099-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:15.077Z", + "timestamp": "2019-09-11T03:40:34.406Z", "http": { "response": { "status_code": 200, - "body": null + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 118727 + "us": 558 }, - "id": "auto-http-0X970CBD2F2102BFA8", - "ip": "172.217.12.132", + "id": "0098-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:15.077Z", + "timestamp": "2019-09-11T03:40:34.406Z", "http": { "response": { "status_code": 200, - "body": null + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 132169 + "us": 304 }, - "id": "auto-http-0X131221E73F825974", - "ip": "172.217.12.132", + "id": "0075-intermittent", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:15.077Z", + "timestamp": "2019-09-11T03:40:34.405Z", "http": { "response": { "status_code": 200, - "body": null + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 247244 + "us": 487 }, - "id": "auto-http-0X9CB71300ABD5A2A8", - "ip": "192.30.253.112", + "id": "0097-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:14.080Z", - "http": null, + "timestamp": "2019-09-11T03:40:34.405Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 2080 + "us": 602 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0049-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:13.075Z", - "http": null, + "timestamp": "2019-09-11T03:40:34.390Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 1921 + "us": 365 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0047-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:13.074Z", + "timestamp": "2019-09-11T03:40:34.389Z", "http": { "response": { - "status_code": 301, - "body": null + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 299586 + "us": 870 }, - "id": "auto-http-0XD9AE729FC1C1E04A", - "ip": "151.101.249.140", + "id": "0077-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:13.074Z", + "timestamp": "2019-09-11T03:40:34.387Z", "http": { "response": { "status_code": 200, - "body": null + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 850870 + "us": 2808 }, - "id": "auto-http-0XDD2D4E60FD4A61C3", - "ip": "151.101.250.217", + "id": "0076-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } } ] } diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list_count.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list_count.json index 054f51f5707e2..3a619f517626a 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list_count.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list_count.json @@ -1,1013 +1,1568 @@ { "allPings": { - "total": 9234, + "total": 2000, "locations": [ - "N/A" + "mpls" ], "pings": [ { - "timestamp": "2019-01-28T18:43:16.078Z", - "http": null, + "timestamp": "2019-09-11T03:40:34.410Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 3328 + "us": 413 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0074-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:15.077Z", - "http": null, - "error": { - "message": "Get http://localhost:12349/: dial tcp 127.0.0.1:12349: connect: connection refused", - "type": "io" + "timestamp": "2019-09-11T03:40:34.406Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } }, + "error": null, "monitor": { "duration": { - "us": 3331 + "us": 441 }, - "id": "auto-http-0X3675F89EF0612091", + "id": "0073-up", "ip": "127.0.0.1", "name": "", "scheme": null, - "status": "down", + "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:15.077Z", - "http": null, + "timestamp": "2019-09-11T03:40:34.406Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 3292 + "us": 482 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0099-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:15.077Z", + "timestamp": "2019-09-11T03:40:34.406Z", "http": { "response": { "status_code": 200, - "body": null + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 118727 + "us": 558 }, - "id": "auto-http-0X970CBD2F2102BFA8", - "ip": "172.217.12.132", + "id": "0098-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:15.077Z", + "timestamp": "2019-09-11T03:40:34.406Z", "http": { "response": { "status_code": 200, - "body": null + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 132169 + "us": 304 }, - "id": "auto-http-0X131221E73F825974", - "ip": "172.217.12.132", + "id": "0075-intermittent", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:15.077Z", + "timestamp": "2019-09-11T03:40:34.405Z", "http": { "response": { "status_code": 200, - "body": null + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 247244 + "us": 487 }, - "id": "auto-http-0X9CB71300ABD5A2A8", - "ip": "192.30.253.112", + "id": "0097-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:14.080Z", - "http": null, + "timestamp": "2019-09-11T03:40:34.405Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 2080 + "us": 602 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0049-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:13.075Z", - "http": null, + "timestamp": "2019-09-11T03:40:34.390Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 1921 + "us": 365 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0047-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:13.074Z", + "timestamp": "2019-09-11T03:40:34.389Z", "http": { "response": { - "status_code": 301, - "body": null + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 299586 + "us": 870 }, - "id": "auto-http-0XD9AE729FC1C1E04A", - "ip": "151.101.249.140", + "id": "0077-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:13.074Z", + "timestamp": "2019-09-11T03:40:34.387Z", "http": { "response": { "status_code": 200, - "body": null + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 850870 + "us": 2808 }, - "id": "auto-http-0XDD2D4E60FD4A61C3", - "ip": "151.101.250.217", + "id": "0076-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:12.075Z", - "http": null, - "error": null, + "timestamp": "2019-09-11T03:40:34.386Z", + "http": { + "response": { + "status_code": 400, + "body": { + "bytes": 3, + "hash": "26d228663f13a88592a12d16cf9587caab0388b262d6d9f126ed62f9333aca94", + "content": "400", + "content_bytes": 3 + } + } + }, + "error": { + "message": "400 Bad Request", + "type": "validate" + }, "monitor": { "duration": { - "us": 1771 + "us": 4258 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0050-down", "ip": "127.0.0.1", "name": "", "scheme": null, - "status": "up", - "type": "tcp" + "status": "down", + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:11.075Z", - "http": null, + "timestamp": "2019-09-11T03:40:34.386Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 2226 + "us": 4784 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0048-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:11.074Z", - "http": null, - "error": { - "message": "Get http://localhost:12349/: dial tcp 127.0.0.1:12349: connect: connection refused", - "type": "io" + "timestamp": "2019-09-11T03:40:34.376Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } }, + "error": null, "monitor": { "duration": { - "us": 2369 + "us": 14580 }, - "id": "auto-http-0X3675F89EF0612091", + "id": "0072-up", "ip": "127.0.0.1", "name": "", "scheme": null, - "status": "down", + "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:11.074Z", + "timestamp": "2019-09-11T03:40:34.376Z", "http": { "response": { "status_code": 200, - "body": null + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 148937 + "us": 14679 }, - "id": "auto-http-0X131221E73F825974", - "ip": "172.217.12.132", + "id": "0096-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:11.074Z", + "timestamp": "2019-09-11T03:40:34.375Z", "http": { "response": { "status_code": 200, - "body": null + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 235473 + "us": 15308 }, - "id": "auto-http-0X9CB71300ABD5A2A8", - "ip": "192.30.253.112", + "id": "0092-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:10.075Z", - "http": null, + "timestamp": "2019-09-11T03:40:34.375Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 1076 + "us": 15183 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0069-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:10.074Z", + "timestamp": "2019-09-11T03:40:34.375Z", "http": { "response": { "status_code": 200, - "body": null + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 1032917 + "us": 15013 }, - "id": "auto-http-0X970CBD2F2102BFA8", - "ip": "172.217.12.132", + "id": "0093-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:09.079Z", - "http": null, - "error": null, + "timestamp": "2019-09-11T03:40:34.375Z", + "http": { + "response": { + "status_code": 400, + "body": { + "bytes": 3, + "hash": "26d228663f13a88592a12d16cf9587caab0388b262d6d9f126ed62f9333aca94", + "content": "400", + "content_bytes": 3 + } + } + }, + "error": { + "message": "400 Bad Request", + "type": "validate" + }, "monitor": { "duration": { - "us": 1824 + "us": 15117 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0070-down", "ip": "127.0.0.1", "name": "", "scheme": null, - "status": "up", - "type": "tcp" + "status": "down", + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:08.075Z", - "http": null, + "timestamp": "2019-09-11T03:40:34.375Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 1404 + "us": 14875 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0071-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:07.078Z", - "http": null, + "timestamp": "2019-09-11T03:40:34.375Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 3353 + "us": 14801 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0095-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:07.078Z", - "http": null, - "error": { - "message": "Get http://localhost:12349/: dial tcp 127.0.0.1:12349: connect: connection refused", - "type": "io" + "timestamp": "2019-09-11T03:40:34.375Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } }, + "error": null, "monitor": { "duration": { - "us": 3509 + "us": 15065 }, - "id": "auto-http-0X3675F89EF0612091", + "id": "0032-up", "ip": "127.0.0.1", "name": "", "scheme": null, - "status": "down", + "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:07.078Z", + "timestamp": "2019-09-11T03:40:34.375Z", "http": { "response": { "status_code": 200, - "body": null + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 2836762 + "us": 14911 }, - "id": "auto-http-0X131221E73F825974", - "ip": "172.217.12.132", + "id": "0094-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:07.078Z", + "timestamp": "2019-09-11T03:40:34.374Z", "http": { "response": { "status_code": 200, - "body": null + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 3991372 + "us": 16135 }, - "id": "auto-http-0X9CB71300ABD5A2A8", - "ip": "192.30.253.112", + "id": "0046-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:07.078Z", + "timestamp": "2019-09-11T03:40:34.374Z", "http": { "response": { - "status_code": 301, - "body": null + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 4058776 + "us": 15428 }, - "id": "auto-http-0XD9AE729FC1C1E04A", - "ip": "151.101.249.140", + "id": "0091-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:07.078Z", + "timestamp": "2019-09-11T03:40:34.374Z", "http": { "response": { "status_code": 200, - "body": null + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 4274310 + "us": 15499 }, - "id": "auto-http-0XDD2D4E60FD4A61C3", - "ip": "151.101.250.217", + "id": "0067-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:07.078Z", + "timestamp": "2019-09-11T03:40:34.374Z", "http": { "response": { - "status_code": 301, - "body": null + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, - "error": { - "message": "received status code 301 expecting 200", - "type": "validate" - }, + "error": null, "monitor": { "duration": { - "us": 4751074 + "us": 15464 }, - "id": "auto-http-0XA8096548ECEB85B7", - "ip": "198.71.248.67", + "id": "0068-up", + "ip": "127.0.0.1", "name": "", "scheme": null, - "status": "down", + "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:06.075Z", - "http": null, + "timestamp": "2019-09-11T03:40:34.374Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 1861 + "us": 21736 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0090-intermittent", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:05.076Z", - "http": null, + "timestamp": "2019-09-11T03:40:34.374Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 2476 + "us": 21874 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0031-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:05.076Z", + "timestamp": "2019-09-11T03:40:34.374Z", "http": { "response": { "status_code": 200, - "body": null + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 109030 + "us": 36584 }, - "id": "auto-http-0X970CBD2F2102BFA8", - "ip": "172.217.12.132", + "id": "0066-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:04.077Z", - "http": null, + "timestamp": "2019-09-11T03:40:34.373Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 3512 + "us": 3148 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0084-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:04.077Z", + "timestamp": "2019-09-11T03:40:34.373Z", "http": { "response": { - "status_code": 301, - "body": null + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 257046 + "us": 13442 }, - "id": "auto-http-0XD9AE729FC1C1E04A", - "ip": "151.101.249.140", + "id": "0083-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:04.077Z", + "timestamp": "2019-09-11T03:40:34.373Z", "http": { "response": { "status_code": 200, - "body": null + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 443840 + "us": 13666 }, - "id": "auto-http-0XDD2D4E60FD4A61C3", - "ip": "151.101.250.217", + "id": "0041-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:03.077Z", - "http": null, + "timestamp": "2019-09-11T03:40:34.373Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 3158 + "us": 16290 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0045-intermittent", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:03.077Z", - "http": null, - "error": { - "message": "Get http://localhost:12349/: dial tcp 127.0.0.1:12349: connect: connection refused", - "type": "io" + "timestamp": "2019-09-11T03:40:34.373Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } }, + "error": null, "monitor": { "duration": { - "us": 3183 + "us": 17255 }, - "id": "auto-http-0X3675F89EF0612091", + "id": "0042-up", "ip": "127.0.0.1", "name": "", "scheme": null, - "status": "down", + "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:03.077Z", + "timestamp": "2019-09-11T03:40:34.373Z", "http": { "response": { - "status_code": 200, - "body": null + "status_code": 500, + "body": { + "bytes": 3, + "hash": "0604cd3138feed202ef293e062da2f4720f77a05d25ee036a7a01c9cfcdd1f0a", + "content": "500", + "content_bytes": 3 + } } }, - "error": null, + "error": { + "message": "500 Internal Server Error", + "type": "validate" + }, "monitor": { "duration": { - "us": 213987 + "us": 17146 }, - "id": "auto-http-0X131221E73F825974", - "ip": "172.217.12.132", + "id": "0030-intermittent", + "ip": "127.0.0.1", "name": "", "scheme": null, - "status": "up", + "status": "down", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:03.077Z", + "timestamp": "2019-09-11T03:40:34.373Z", "http": { "response": { "status_code": 200, - "body": null + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 263080 + "us": 17770 }, - "id": "auto-http-0X9CB71300ABD5A2A8", - "ip": "192.30.253.112", + "id": "0063-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:03.077Z", + "timestamp": "2019-09-11T03:40:34.373Z", "http": { "response": { - "status_code": 301, - "body": null + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, - "error": { - "message": "received status code 301 expecting 200", - "type": "validate" - }, + "error": null, "monitor": { "duration": { - "us": 1396605 + "us": 18194 }, - "id": "auto-http-0XA8096548ECEB85B7", - "ip": "198.71.248.67", + "id": "0061-up", + "ip": "127.0.0.1", "name": "", "scheme": null, - "status": "down", + "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:02.080Z", - "http": null, + "timestamp": "2019-09-11T03:40:34.373Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 1889 + "us": 17587 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0065-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:01.077Z", - "http": null, + "timestamp": "2019-09-11T03:40:34.373Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 3191 + "us": 22666 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0062-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:01.077Z", + "timestamp": "2019-09-11T03:40:34.373Z", "http": { "response": { - "status_code": 301, - "body": null + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 248880 + "us": 33311 }, - "id": "auto-http-0XD9AE729FC1C1E04A", - "ip": "151.101.249.140", + "id": "0026-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:01.077Z", + "timestamp": "2019-09-11T03:40:34.373Z", "http": { "response": { "status_code": 200, - "body": null + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 541379 + "us": 33506 }, - "id": "auto-http-0XDD2D4E60FD4A61C3", - "ip": "151.101.250.217", + "id": "0085-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:00.078Z", - "http": null, + "timestamp": "2019-09-11T03:40:34.373Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 2449 + "us": 33974 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0025-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:00.078Z", + "timestamp": "2019-09-11T03:40:34.373Z", "http": { "response": { "status_code": 200, - "body": null + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 120545 + "us": 33693 }, - "id": "auto-http-0X970CBD2F2102BFA8", - "ip": "172.217.12.132", + "id": "0088-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:42:59.075Z", - "http": null, - "error": { - "message": "Get http://localhost:12349/: dial tcp 127.0.0.1:12349: connect: connection refused", - "type": "io" + "timestamp": "2019-09-11T03:40:34.373Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } }, + "error": null, "monitor": { "duration": { - "us": 4736 + "us": 33833 }, - "id": "auto-http-0X3675F89EF0612091", + "id": "0089-up", "ip": "127.0.0.1", "name": "", "scheme": null, - "status": "down", + "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:42:59.075Z", - "http": null, + "timestamp": "2019-09-11T03:40:34.373Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 4617 + "us": 34600 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0087-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:42:59.075Z", + "timestamp": "2019-09-11T03:40:34.373Z", "http": { "response": { "status_code": 200, - "body": null + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 137745 + "us": 35573 }, - "id": "auto-http-0X131221E73F825974", - "ip": "172.217.12.132", + "id": "0028-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:42:59.075Z", + "timestamp": "2019-09-11T03:40:34.373Z", "http": { "response": { "status_code": 200, - "body": null + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 204668 + "us": 35830 }, - "id": "auto-http-0X9CB71300ABD5A2A8", - "ip": "192.30.253.112", + "id": "0086-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:42:59.075Z", + "timestamp": "2019-09-11T03:40:34.373Z", "http": { "response": { - "status_code": 301, - "body": null + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, - "error": { - "message": "received status code 301 expecting 200", - "type": "validate" - }, + "error": null, "monitor": { "duration": { - "us": 1911427 + "us": 35698 }, - "id": "auto-http-0XA8096548ECEB85B7", - "ip": "198.71.248.67", + "id": "0064-up", + "ip": "127.0.0.1", "name": "", "scheme": null, - "status": "down", + "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:42:58.075Z", - "http": null, + "timestamp": "2019-09-11T03:40:34.373Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 1945 + "us": 35594 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0029-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:42:58.074Z", + "timestamp": "2019-09-11T03:40:34.373Z", "http": { "response": { - "status_code": 301, - "body": null + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } } }, "error": null, "monitor": { "duration": { - "us": 269254 + "us": 35652 }, - "id": "auto-http-0XD9AE729FC1C1E04A", - "ip": "151.101.249.140", + "id": "0044-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } } ] } diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list_monitor_id.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list_monitor_id.json index d098fec503868..5826fd9f3f540 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list_monitor_id.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list_monitor_id.json @@ -1,264 +1,474 @@ { "allPings": { - "total": 3373, + "total": 20, "locations": [ - "N/A" + "mpls" ], "pings": [ { - "timestamp": "2019-01-28T18:43:16.078Z", - "http": null, + "timestamp": "2019-09-11T03:40:34.371Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 3328 + "us": 35534 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0001-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:15.077Z", - "http": null, + "timestamp": "2019-09-11T03:40:04.370Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 3292 + "us": 3080 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0001-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:14.080Z", - "http": null, + "timestamp": "2019-09-11T03:39:34.370Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 2080 + "us": 7810 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0001-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:13.075Z", - "http": null, + "timestamp": "2019-09-11T03:39:04.371Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 1921 + "us": 1575 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0001-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:12.075Z", - "http": null, + "timestamp": "2019-09-11T03:38:34.370Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 1771 + "us": 1787 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0001-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:11.075Z", - "http": null, + "timestamp": "2019-09-11T03:38:04.370Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 2226 + "us": 654 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0001-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:10.075Z", - "http": null, + "timestamp": "2019-09-11T03:37:34.370Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 1076 + "us": 15915 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0001-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:09.079Z", - "http": null, + "timestamp": "2019-09-11T03:37:04.370Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 1824 + "us": 2679 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0001-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:08.075Z", - "http": null, + "timestamp": "2019-09-11T03:36:34.371Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 1404 + "us": 2104 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0001-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:07.078Z", - "http": null, + "timestamp": "2019-09-11T03:36:04.370Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 3353 + "us": 5759 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0001-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:06.075Z", - "http": null, + "timestamp": "2019-09-11T03:35:34.373Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 1861 + "us": 7166 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0001-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:05.076Z", - "http": null, + "timestamp": "2019-09-11T03:35:04.371Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 2476 + "us": 26830 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0001-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:04.077Z", - "http": null, + "timestamp": "2019-09-11T03:34:34.371Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 3512 + "us": 993 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0001-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:03.077Z", - "http": null, + "timestamp": "2019-09-11T03:34:04.381Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 3158 + "us": 3880 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0001-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T18:43:02.080Z", - "http": null, + "timestamp": "2019-09-11T03:33:34.371Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 1889 + "us": 1604 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0001-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } } ] } diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list_sort.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list_sort.json index 1fa08d9b2e69c..b9b8deae2e564 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list_sort.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list_sort.json @@ -1,103 +1,164 @@ { "allPings": { - "total": 3373, + "total": 20, "locations": [ - "N/A" + "mpls" ], "pings": [ { - "timestamp": "2019-01-28T17:47:06.077Z", - "http": null, + "timestamp": "2019-09-11T03:31:04.380Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 1452 + "us": 56940 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0001-up", "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T17:47:07.075Z", - "http": null, + "timestamp": "2019-09-11T03:31:34.366Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } + }, "error": null, "monitor": { "duration": { - "us": 1094 + "us": 9861 }, - "id": "auto-tcp-0X81440A68E839814C", - "ip": "127.0.1.0", + "id": "0001-up", + "ip": "127.0.0.1", "name": "", "scheme": null, "status": "up", - "type": "tcp" + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T17:47:07.075Z", - "http": null, - "error": { - "message": "dial tcp 127.0.0.1:9200: connect: connection refused", - "type": "io" + "timestamp": "2019-09-11T03:32:04.372Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } }, + "error": null, "monitor": { "duration": { - "us": 1094 + "us": 2924 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0001-up", "ip": "127.0.0.1", "name": "", "scheme": null, - "status": "down", - "type": "tcp" + "status": "up", + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T17:47:08.078Z", - "http": null, - "error": { - "message": "dial tcp 127.0.0.1:9200: connect: connection refused", - "type": "io" + "timestamp": "2019-09-11T03:32:34.375Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } }, + "error": null, "monitor": { "duration": { - "us": 1430 + "us": 21665 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0001-up", "ip": "127.0.0.1", "name": "", "scheme": null, - "status": "down", - "type": "tcp" + "status": "up", + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } }, { - "timestamp": "2019-01-28T17:47:09.075Z", - "http": null, - "error": { - "message": "dial tcp 127.0.0.1:9200: connect: connection refused", - "type": "io" + "timestamp": "2019-09-11T03:33:04.370Z", + "http": { + "response": { + "status_code": 200, + "body": { + "bytes": 3, + "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf", + "content": null, + "content_bytes": null + } + } }, + "error": null, "monitor": { "duration": { - "us": 1370 + "us": 2128 }, - "id": "auto-tcp-0X81440A68E839814C", + "id": "0001-up", "ip": "127.0.0.1", "name": "", "scheme": null, - "status": "down", - "type": "tcp" + "status": "up", + "type": "http" }, - "observer": null + "observer": { + "geo": { + "name": "mpls" + } + } } ] } diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot.json index c5e90c1df1a05..0ac6c67e23d2b 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot.json @@ -1,10 +1,10 @@ { "snapshot": { "counts": { - "down": 2, + "down": 7, "mixed": 0, - "up": 8, - "total": 10 + "up": 93, + "total": 100 } } } \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_empty.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_empty.json index add1aaf49ef05..8639f0ec0feea 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_empty.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_empty.json @@ -1,10 +1,10 @@ { "snapshot": { "counts": { - "down": 0, + "down": 13, "mixed": 0, "up": 0, - "total": 0 + "total": 13 } } } \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_filtered_by_down.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_filtered_by_down.json index e5278dd6134ed..8639f0ec0feea 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_filtered_by_down.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_filtered_by_down.json @@ -1,10 +1,10 @@ { "snapshot": { "counts": { - "down": 2, + "down": 13, "mixed": 0, "up": 0, - "total": 10 + "total": 13 } } } \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_filtered_by_up.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_filtered_by_up.json index 02bb9bb0f229b..065c3f90e932e 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_filtered_by_up.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_filtered_by_up.json @@ -3,8 +3,8 @@ "counts": { "down": 0, "mixed": 0, - "up": 8, - "total": 10 + "up": 94, + "total": 94 } } } \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_histogram.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_histogram.json index 702e4b601a8a6..c12ec7f3847c3 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_histogram.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_histogram.json @@ -1,122 +1,178 @@ { "histogram": [ { - "upCount": 175, - "downCount": 202, - "x": 1548697764160, - "x0": 1548697571840, + "upCount": 93, + "downCount": 7, + "x": 1568172680087, + "x0": 1568172657286, "y": 1 }, { - "upCount": 243, - "downCount": 277, - "x": 1548697956480, - "x0": 1548697764160, + "upCount": 93, + "downCount": 7, + "x": 1568172702888, + "x0": 1568172680087, "y": 1 }, { - "upCount": 238, - "downCount": 278, - "x": 1548698148800, - "x0": 1548697956480, + "upCount": 93, + "downCount": 7, + "x": 1568172725689, + "x0": 1568172702888, "y": 1 }, { - "upCount": 244, - "downCount": 279, - "x": 1548698341120, - "x0": 1548698148800, + "upCount": 0, + "downCount": 0, + "x": 1568172748490, + "x0": 1568172725689, "y": 1 }, { - "upCount": 409, - "downCount": 120, - "x": 1548698533440, - "x0": 1548698341120, + "upCount": 93, + "downCount": 7, + "x": 1568172771291, + "x0": 1568172748490, "y": 1 }, { - "upCount": 444, - "downCount": 88, - "x": 1548698725760, - "x0": 1548698533440, + "upCount": 93, + "downCount": 7, + "x": 1568172794092, + "x0": 1568172771291, "y": 1 }, { - "upCount": 430, - "downCount": 76, - "x": 1548698918080, - "x0": 1548698725760, + "upCount": 92, + "downCount": 8, + "x": 1568172816893, + "x0": 1568172794092, "y": 1 }, { - "upCount": 434, - "downCount": 78, - "x": 1548699110400, - "x0": 1548698918080, + "upCount": 0, + "downCount": 0, + "x": 1568172839694, + "x0": 1568172816893, "y": 1 }, { - "upCount": 455, - "downCount": 76, - "x": 1548699302720, - "x0": 1548699110400, + "upCount": 93, + "downCount": 7, + "x": 1568172862495, + "x0": 1568172839694, "y": 1 }, { - "upCount": 451, - "downCount": 85, - "x": 1548699495040, - "x0": 1548699302720, + "upCount": 93, + "downCount": 7, + "x": 1568172885296, + "x0": 1568172862495, "y": 1 }, { - "upCount": 458, - "downCount": 89, - "x": 1548699687360, - "x0": 1548699495040, + "upCount": 93, + "downCount": 7, + "x": 1568172908097, + "x0": 1568172885296, "y": 1 }, { - "upCount": 455, - "downCount": 86, - "x": 1548699879680, - "x0": 1548699687360, + "upCount": 0, + "downCount": 0, + "x": 1568172930898, + "x0": 1568172908097, "y": 1 }, { - "upCount": 455, - "downCount": 87, - "x": 1548700072000, - "x0": 1548699879680, + "upCount": 93, + "downCount": 7, + "x": 1568172953699, + "x0": 1568172930898, "y": 1 }, { - "upCount": 459, - "downCount": 88, - "x": 1548700264320, - "x0": 1548700072000, + "upCount": 93, + "downCount": 7, + "x": 1568172976500, + "x0": 1568172953699, "y": 1 }, { - "upCount": 432, - "downCount": 87, - "x": 1548700456640, - "x0": 1548700264320, + "upCount": 92, + "downCount": 8, + "x": 1568172999301, + "x0": 1568172976500, "y": 1 }, { - "upCount": 431, - "downCount": 86, - "x": 1548700648960, - "x0": 1548700456640, + "upCount": 0, + "downCount": 0, + "x": 1568173022102, + "x0": 1568172999301, "y": 1 }, { - "upCount": 433, - "downCount": 87, - "x": 1548700841280, - "x0": 1548700648960, + "upCount": 93, + "downCount": 7, + "x": 1568173044903, + "x0": 1568173022102, + "y": 1 + }, + { + "upCount": 93, + "downCount": 7, + "x": 1568173067704, + "x0": 1568173044903, + "y": 1 + }, + { + "upCount": 93, + "downCount": 7, + "x": 1568173090505, + "x0": 1568173067704, + "y": 1 + }, + { + "upCount": 0, + "downCount": 0, + "x": 1568173113306, + "x0": 1568173090505, + "y": 1 + }, + { + "upCount": 93, + "downCount": 7, + "x": 1568173136107, + "x0": 1568173113306, + "y": 1 + }, + { + "upCount": 93, + "downCount": 7, + "x": 1568173158908, + "x0": 1568173136107, + "y": 1 + }, + { + "upCount": 92, + "downCount": 8, + "x": 1568173181709, + "x0": 1568173158908, + "y": 1 + }, + { + "upCount": 93, + "downCount": 7, + "x": 1568173204510, + "x0": 1568173181709, + "y": 1 + }, + { + "upCount": 0, + "downCount": 0, + "x": 1568173227311, + "x0": 1568173204510, "y": 1 } ] diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_histogram_by_filter.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_histogram_by_filter.json index c8c0e3a25a09f..f61a101ce4462 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_histogram_by_filter.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_histogram_by_filter.json @@ -1,122 +1,178 @@ { "histogram": [ { - "upCount": 175, + "upCount": 93, "downCount": 0, - "x": 1548697764160, - "x0": 1548697571840, + "x": 1568172680087, + "x0": 1568172657286, "y": 1 }, { - "upCount": 243, + "upCount": 93, "downCount": 0, - "x": 1548697956480, - "x0": 1548697764160, + "x": 1568172702888, + "x0": 1568172680087, "y": 1 }, { - "upCount": 238, + "upCount": 93, "downCount": 0, - "x": 1548698148800, - "x0": 1548697956480, + "x": 1568172725689, + "x0": 1568172702888, "y": 1 }, { - "upCount": 244, + "upCount": 0, "downCount": 0, - "x": 1548698341120, - "x0": 1548698148800, + "x": 1568172748490, + "x0": 1568172725689, "y": 1 }, { - "upCount": 409, + "upCount": 93, "downCount": 0, - "x": 1548698533440, - "x0": 1548698341120, + "x": 1568172771291, + "x0": 1568172748490, "y": 1 }, { - "upCount": 444, + "upCount": 93, "downCount": 0, - "x": 1548698725760, - "x0": 1548698533440, + "x": 1568172794092, + "x0": 1568172771291, "y": 1 }, { - "upCount": 430, + "upCount": 92, "downCount": 0, - "x": 1548698918080, - "x0": 1548698725760, + "x": 1568172816893, + "x0": 1568172794092, "y": 1 }, { - "upCount": 434, + "upCount": 0, "downCount": 0, - "x": 1548699110400, - "x0": 1548698918080, + "x": 1568172839694, + "x0": 1568172816893, "y": 1 }, { - "upCount": 455, + "upCount": 93, "downCount": 0, - "x": 1548699302720, - "x0": 1548699110400, + "x": 1568172862495, + "x0": 1568172839694, "y": 1 }, { - "upCount": 451, + "upCount": 93, "downCount": 0, - "x": 1548699495040, - "x0": 1548699302720, + "x": 1568172885296, + "x0": 1568172862495, "y": 1 }, { - "upCount": 458, + "upCount": 93, "downCount": 0, - "x": 1548699687360, - "x0": 1548699495040, + "x": 1568172908097, + "x0": 1568172885296, "y": 1 }, { - "upCount": 455, + "upCount": 0, "downCount": 0, - "x": 1548699879680, - "x0": 1548699687360, + "x": 1568172930898, + "x0": 1568172908097, "y": 1 }, { - "upCount": 455, + "upCount": 93, "downCount": 0, - "x": 1548700072000, - "x0": 1548699879680, + "x": 1568172953699, + "x0": 1568172930898, "y": 1 }, { - "upCount": 459, + "upCount": 93, "downCount": 0, - "x": 1548700264320, - "x0": 1548700072000, + "x": 1568172976500, + "x0": 1568172953699, "y": 1 }, { - "upCount": 432, + "upCount": 92, "downCount": 0, - "x": 1548700456640, - "x0": 1548700264320, + "x": 1568172999301, + "x0": 1568172976500, "y": 1 }, { - "upCount": 431, + "upCount": 0, "downCount": 0, - "x": 1548700648960, - "x0": 1548700456640, + "x": 1568173022102, + "x0": 1568172999301, "y": 1 }, { - "upCount": 433, + "upCount": 93, "downCount": 0, - "x": 1548700841280, - "x0": 1548700648960, + "x": 1568173044903, + "x0": 1568173022102, + "y": 1 + }, + { + "upCount": 93, + "downCount": 0, + "x": 1568173067704, + "x0": 1568173044903, + "y": 1 + }, + { + "upCount": 93, + "downCount": 0, + "x": 1568173090505, + "x0": 1568173067704, + "y": 1 + }, + { + "upCount": 0, + "downCount": 0, + "x": 1568173113306, + "x0": 1568173090505, + "y": 1 + }, + { + "upCount": 93, + "downCount": 0, + "x": 1568173136107, + "x0": 1568173113306, + "y": 1 + }, + { + "upCount": 93, + "downCount": 0, + "x": 1568173158908, + "x0": 1568173136107, + "y": 1 + }, + { + "upCount": 92, + "downCount": 0, + "x": 1568173181709, + "x0": 1568173158908, + "y": 1 + }, + { + "upCount": 93, + "downCount": 0, + "x": 1568173204510, + "x0": 1568173181709, + "y": 1 + }, + { + "upCount": 0, + "downCount": 0, + "x": 1568173227311, + "x0": 1568173204510, "y": 1 } ] diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_histogram_by_id.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_histogram_by_id.json index 9c2726de41396..c12ec7f3847c3 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_histogram_by_id.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_histogram_by_id.json @@ -1,122 +1,178 @@ { "histogram": [ { - "upCount": 37, - "downCount": 0, - "x": 1548697764160, - "x0": 1548697571840, + "upCount": 93, + "downCount": 7, + "x": 1568172680087, + "x0": 1568172657286, "y": 1 }, { - "upCount": 52, - "downCount": 0, - "x": 1548697956480, - "x0": 1548697764160, + "upCount": 93, + "downCount": 7, + "x": 1568172702888, + "x0": 1568172680087, "y": 1 }, { - "upCount": 51, - "downCount": 0, - "x": 1548698148800, - "x0": 1548697956480, + "upCount": 93, + "downCount": 7, + "x": 1568172725689, + "x0": 1568172702888, "y": 1 }, { - "upCount": 52, + "upCount": 0, "downCount": 0, - "x": 1548698341120, - "x0": 1548698148800, + "x": 1568172748490, + "x0": 1568172725689, "y": 1 }, { - "upCount": 58, - "downCount": 0, - "x": 1548698533440, - "x0": 1548698341120, + "upCount": 93, + "downCount": 7, + "x": 1568172771291, + "x0": 1568172748490, "y": 1 }, { - "upCount": 58, - "downCount": 0, - "x": 1548698725760, - "x0": 1548698533440, + "upCount": 93, + "downCount": 7, + "x": 1568172794092, + "x0": 1568172771291, "y": 1 }, { - "upCount": 51, - "downCount": 0, - "x": 1548698918080, - "x0": 1548698725760, + "upCount": 92, + "downCount": 8, + "x": 1568172816893, + "x0": 1568172794092, "y": 1 }, { - "upCount": 52, + "upCount": 0, "downCount": 0, - "x": 1548699110400, - "x0": 1548698918080, + "x": 1568172839694, + "x0": 1568172816893, "y": 1 }, { - "upCount": 61, - "downCount": 0, - "x": 1548699302720, - "x0": 1548699110400, + "upCount": 93, + "downCount": 7, + "x": 1568172862495, + "x0": 1568172839694, "y": 1 }, { - "upCount": 60, - "downCount": 0, - "x": 1548699495040, - "x0": 1548699302720, + "upCount": 93, + "downCount": 7, + "x": 1568172885296, + "x0": 1568172862495, "y": 1 }, { - "upCount": 61, - "downCount": 0, - "x": 1548699687360, - "x0": 1548699495040, + "upCount": 93, + "downCount": 7, + "x": 1568172908097, + "x0": 1568172885296, "y": 1 }, { - "upCount": 63, + "upCount": 0, "downCount": 0, - "x": 1548699879680, - "x0": 1548699687360, + "x": 1568172930898, + "x0": 1568172908097, "y": 1 }, { - "upCount": 62, - "downCount": 0, - "x": 1548700072000, - "x0": 1548699879680, + "upCount": 93, + "downCount": 7, + "x": 1568172953699, + "x0": 1568172930898, "y": 1 }, { - "upCount": 62, - "downCount": 0, - "x": 1548700264320, - "x0": 1548700072000, + "upCount": 93, + "downCount": 7, + "x": 1568172976500, + "x0": 1568172953699, + "y": 1 + }, + { + "upCount": 92, + "downCount": 8, + "x": 1568172999301, + "x0": 1568172976500, "y": 1 }, { - "upCount": 52, + "upCount": 0, "downCount": 0, - "x": 1548700456640, - "x0": 1548700264320, + "x": 1568173022102, + "x0": 1568172999301, "y": 1 }, { - "upCount": 51, + "upCount": 93, + "downCount": 7, + "x": 1568173044903, + "x0": 1568173022102, + "y": 1 + }, + { + "upCount": 93, + "downCount": 7, + "x": 1568173067704, + "x0": 1568173044903, + "y": 1 + }, + { + "upCount": 93, + "downCount": 7, + "x": 1568173090505, + "x0": 1568173067704, + "y": 1 + }, + { + "upCount": 0, "downCount": 0, - "x": 1548700648960, - "x0": 1548700456640, + "x": 1568173113306, + "x0": 1568173090505, + "y": 1 + }, + { + "upCount": 93, + "downCount": 7, + "x": 1568173136107, + "x0": 1568173113306, + "y": 1 + }, + { + "upCount": 93, + "downCount": 7, + "x": 1568173158908, + "x0": 1568173136107, + "y": 1 + }, + { + "upCount": 92, + "downCount": 8, + "x": 1568173181709, + "x0": 1568173158908, + "y": 1 + }, + { + "upCount": 93, + "downCount": 7, + "x": 1568173204510, + "x0": 1568173181709, "y": 1 }, { - "upCount": 51, + "upCount": 0, "downCount": 0, - "x": 1548700841280, - "x0": 1548700648960, + "x": 1568173227311, + "x0": 1568173204510, "y": 1 } ] diff --git a/x-pack/test/api_integration/apis/uptime/graphql/expect_fixture_eql.ts b/x-pack/test/api_integration/apis/uptime/graphql/helpers/expect_fixture_eql.ts similarity index 82% rename from x-pack/test/api_integration/apis/uptime/graphql/expect_fixture_eql.ts rename to x-pack/test/api_integration/apis/uptime/graphql/helpers/expect_fixture_eql.ts index 1b286aa369cb0..362803d2b8550 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/expect_fixture_eql.ts +++ b/x-pack/test/api_integration/apis/uptime/graphql/helpers/expect_fixture_eql.ts @@ -9,7 +9,7 @@ import fs from 'fs'; import { join } from 'path'; import { cloneDeep } from 'lodash'; -const fixturesDir = join(__dirname, 'fixtures'); +const fixturesDir = join(__dirname, '..', 'fixtures'); const excludeFieldsFrom = (from: any, excluder?: (d: any) => any): any => { const clone = cloneDeep(from); @@ -22,9 +22,11 @@ const excludeFieldsFrom = (from: any, excluder?: (d: any) => any): any => { export const expectFixtureEql = (data: T, fixtureName: string, excluder?: (d: T) => void) => { const fixturePath = join(fixturesDir, `${fixtureName}.json`); const dataExcluded = excludeFieldsFrom(data, excluder); + expect(dataExcluded).not.to.be(undefined); if (process.env.UPDATE_UPTIME_FIXTURES) { fs.writeFileSync(fixturePath, JSON.stringify(dataExcluded, null, 2)); } - const fixture = JSON.parse(fs.readFileSync(fixturePath, 'utf8')); + const fileContents = fs.readFileSync(fixturePath, 'utf8'); + const fixture = JSON.parse(fileContents); expect(dataExcluded).to.eql(excludeFieldsFrom(fixture, excluder)); }; diff --git a/x-pack/test/api_integration/apis/uptime/graphql/helpers/make_checks.ts b/x-pack/test/api_integration/apis/uptime/graphql/helpers/make_checks.ts new file mode 100644 index 0000000000000..9bfdf04c8dbe3 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/graphql/helpers/make_checks.ts @@ -0,0 +1,162 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import uuid from 'uuid'; +import { merge } from 'lodash'; + +export const makePing = async ( + es: any, + index: string, + monitorId: string, + fields: { [key: string]: any }, + mogrify: (doc: any) => any +) => { + const baseDoc = { + tcp: { + rtt: { + connect: { + us: 14687, + }, + }, + }, + observer: { + geo: { + name: 'mpls', + location: '37.926868, -78.024902', + }, + hostname: 'avc-x1e', + }, + agent: { + hostname: 'avc-x1e', + id: '10730a1a-4cb7-45ce-8524-80c4820476ab', + type: 'heartbeat', + ephemeral_id: '0d9a8dc6-f604-49e3-86a0-d8f9d6f2cbad', + version: '8.0.0', + }, + '@timestamp': new Date().toISOString(), + resolve: { + rtt: { + us: 350, + }, + ip: '127.0.0.1', + }, + ecs: { + version: '1.1.0', + }, + host: { + name: 'avc-x1e', + }, + http: { + rtt: { + response_header: { + us: 19349, + }, + total: { + us: 48954, + }, + write_request: { + us: 33, + }, + content: { + us: 51, + }, + validate: { + us: 19400, + }, + }, + response: { + status_code: 200, + body: { + bytes: 3, + hash: '27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf', + }, + }, + }, + monitor: { + duration: { + us: 49347, + }, + ip: '127.0.0.1', + id: monitorId, + check_group: uuid.v4(), + type: 'http', + status: 'up', + }, + event: { + dataset: 'uptime', + }, + url: { + path: '/pattern', + scheme: 'http', + port: 5678, + domain: 'localhost', + query: 'r=200x5,500x1', + full: 'http://localhost:5678/pattern?r=200x5,500x1', + }, + }; + + const doc = mogrify(merge(baseDoc, fields)); + + await es.index({ + index, + refresh: true, + body: doc, + }); + + return doc; +}; + +export const makeCheck = async ( + es: any, + index: string, + monitorId: string, + numIps: number, + fields: { [key: string]: any }, + mogrify: (doc: any) => any +) => { + const cgFields = { + monitor: { + check_group: uuid.v4(), + }, + }; + + const docs = []; + const summary = { + up: 0, + down: 0, + }; + for (let i = 0; i < numIps; i++) { + const pingFields = merge(fields, cgFields, { + monitor: { + ip: `127.0.0.${i}`, + }, + }); + if (i === numIps - 1) { + pingFields.summary = summary; + } + const doc = await makePing(es, index, monitorId, pingFields, mogrify); + docs.push(doc); + // @ts-ignore + summary[doc.monitor.status]++; + } + return docs; +}; + +export const makeChecks = async ( + es: any, + index: string, + monitorId: string, + numChecks: number, + numIps: number, + fields: { [key: string]: any } = {}, + mogrify: (doc: any) => any = d => d +) => { + const checks = []; + for (let li = 0; li < numChecks; li++) { + checks.push(await makeCheck(es, index, monitorId, numIps, fields, mogrify)); + } + return checks; +}; diff --git a/x-pack/test/api_integration/apis/uptime/graphql/index.js b/x-pack/test/api_integration/apis/uptime/graphql/index.js index 97c3c040a2097..f7fafa9419657 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/index.js +++ b/x-pack/test/api_integration/apis/uptime/graphql/index.js @@ -4,13 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -export default function ({ getService, loadTestFile }) { - const esArchiver = getService('esArchiver'); - const archive = 'uptime/full_heartbeat'; - +export default function ({ loadTestFile }) { describe('graphql', () => { - before('load heartbeat data', () => esArchiver.load(archive)); - after('unload heartbeat index', () => esArchiver.unload(archive)); // each of these test files imports a GQL query from // the uptime app and runs it against the live HTTP server, // verifying the pre-loaded documents are returned in a way that diff --git a/x-pack/test/api_integration/apis/uptime/graphql/monitor_charts.js b/x-pack/test/api_integration/apis/uptime/graphql/monitor_charts.js index 007eef026150a..11bee86361f5b 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/monitor_charts.js +++ b/x-pack/test/api_integration/apis/uptime/graphql/monitor_charts.js @@ -4,13 +4,14 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from '@kbn/expect'; import { monitorChartsQueryString } from '../../../../../legacy/plugins/uptime/public/queries'; -import monitorCharts from './fixtures/monitor_charts'; -import monitorChartsEmptySet from './fixtures/monitor_charts_empty_set'; +import { expectFixtureEql } from './helpers/expect_fixture_eql'; export default function ({ getService }) { describe('monitorCharts query', () => { + before('load heartbeat data', () => getService('esArchiver').load('uptime/full_heartbeat')); + after('unload heartbeat index', () => getService('esArchiver').unload('uptime/full_heartbeat')); + const supertest = getService('supertest'); it('will fetch a series of data points for monitor duration and status', async () => { @@ -18,9 +19,9 @@ export default function ({ getService }) { operationName: 'MonitorCharts', query: monitorChartsQueryString, variables: { - dateRangeStart: '2019-01-28T17:40:08.078Z', - dateRangeEnd: '2019-01-28T19:00:16.078Z', - monitorId: 'auto-http-0X131221E73F825974', + dateRangeStart: '2019-09-11T03:31:04.380Z', + dateRangeEnd: '2019-09-11T03:40:34.410Z', + monitorId: '0002-up', }, }; const { @@ -29,7 +30,8 @@ export default function ({ getService }) { .post('/api/uptime/graphql') .set('kbn-xsrf', 'foo') .send({ ...getMonitorChartsQuery }); - expect(data).to.eql(monitorCharts); + + expectFixtureEql(data, 'monitor_charts'); }); it('will fetch empty sets for a date range with no data', async () => { @@ -37,9 +39,9 @@ export default function ({ getService }) { operationName: 'MonitorCharts', query: monitorChartsQueryString, variables: { - dateRangeStart: '2002-01-28T17:40:08.078Z', - dateRangeEnd: '2002-01-28T19:00:16.078Z', - monitorId: 'auto-http-0X131221E73F825974', + dateRangeStart: '1999-09-11T03:31:04.380Z', + dateRangeEnd: '1999-09-11T03:40:34.410Z', + monitorId: '0002-up', }, }; const { @@ -48,7 +50,9 @@ export default function ({ getService }) { .post('/api/uptime/graphql') .set('kbn-xsrf', 'foo') .send({ ...getMonitorChartsQuery }); - expect(data).to.eql(monitorChartsEmptySet); + + + expectFixtureEql(data, 'monitor_charts_empty_sets'); }); }); } diff --git a/x-pack/test/api_integration/apis/uptime/graphql/monitor_page_title.ts b/x-pack/test/api_integration/apis/uptime/graphql/monitor_page_title.ts index 3273661b6c2ab..56d22610ffe49 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/monitor_page_title.ts +++ b/x-pack/test/api_integration/apis/uptime/graphql/monitor_page_title.ts @@ -4,13 +4,15 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from '@kbn/expect'; import { monitorPageTitleQueryString } from '../../../../../legacy/plugins/uptime/public/queries/monitor_page_title_query'; -import monitorPageTitle from './fixtures/monitor_page_title.json'; import { FtrProviderContext } from '../../../ftr_provider_context'; +import { expectFixtureEql } from './helpers/expect_fixture_eql'; export default function({ getService }: FtrProviderContext) { - describe('monitorPageTitle', () => { + describe('monitor_page_title', () => { + before('load heartbeat data', () => getService('esArchiver').load('uptime/full_heartbeat')); + after('unload heartbeat index', () => getService('esArchiver').unload('uptime/full_heartbeat')); + const supertest = getService('supertest'); it('will fetch a title for a given monitorId', async () => { @@ -18,7 +20,7 @@ export default function({ getService }: FtrProviderContext) { operationName: 'MonitorPageTitle', query: monitorPageTitleQueryString, variables: { - monitorId: 'auto-http-0X131221E73F825974', + monitorId: '0002-up', }, }; @@ -29,7 +31,7 @@ export default function({ getService }: FtrProviderContext) { .set('kbn-xsrf', 'foo') .send({ ...getMonitorTitleQuery }); - expect(data).to.eql(monitorPageTitle); + expectFixtureEql(data, 'monitor_page_title'); }); }); } diff --git a/x-pack/test/api_integration/apis/uptime/graphql/monitor_states.ts b/x-pack/test/api_integration/apis/uptime/graphql/monitor_states.ts index 7e38939673df9..3779065962c68 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/monitor_states.ts +++ b/x-pack/test/api_integration/apis/uptime/graphql/monitor_states.ts @@ -4,54 +4,165 @@ * you may not use this file except in compliance with the Elastic License. */ +import expect from '@kbn/expect'; import { monitorStatesQueryString } from '../../../../../legacy/plugins/uptime/public/queries/monitor_states_query'; -import { expectFixtureEql } from './expect_fixture_eql'; +import { expectFixtureEql } from './helpers/expect_fixture_eql'; import { FtrProviderContext } from '../../../ftr_provider_context'; +import { makeChecks } from './helpers/make_checks'; export default function({ getService }: FtrProviderContext) { - describe('monitorStates', () => { - const supertest = getService('supertest'); - - it('will fetch monitor state data for the given date range', async () => { - const getMonitorStatesQuery = { - operationName: 'MonitorStates', - query: monitorStatesQueryString, - variables: { - dateRangeStart: '2019-01-28T17:40:08.078Z', - dateRangeEnd: '2019-01-28T19:00:16.078Z', - }, - }; - - const { - body: { data }, - } = await supertest - .post('/api/uptime/graphql') - .set('kbn-xsrf', 'foo') - .send({ ...getMonitorStatesQuery }); - - expectFixtureEql(data, 'monitor_states'); - }); + const supertest = getService('supertest'); + let dateRangeStart: string; + let dateRangeEnd: string; + + const getMonitorStates = async (variables: { [key: string]: any } = {}) => { + const query = { + operationName: 'MonitorStates', + query: monitorStatesQueryString, + variables: { + dateRangeStart, + dateRangeEnd, + ...variables, + }, + }; + + const { + body: { data }, + } = await supertest + .post('/api/uptime/graphql') + .set('kbn-xsrf', 'foo') + .send({ ...query }); + + return data; + }; - it('will fetch monitor state data for the given filters and range', async () => { - const getMonitorStatesQuery = { - operationName: 'MonitorStates', - query: monitorStatesQueryString, - variables: { - dateRangeStart: '2019-01-28T17:40:08.078Z', - dateRangeEnd: '2019-01-28T19:00:16.078Z', + describe('monitor states', async () => { + describe('with real world data', () => { + before('load heartbeat data', () => getService('esArchiver').load('uptime/full_heartbeat')); + after('unload heartbeat index', () => + getService('esArchiver').unload('uptime/full_heartbeat') + ); + + before('set start/end', () => { + dateRangeStart = '2019-09-11T03:31:04.380Z'; + dateRangeEnd = '2019-09-11T03:40:34.410Z'; + }); + + it('will fetch monitor state data for the given filters and range', async () => { + const data: any = await getMonitorStates({ + statusFilter: 'up', filters: - '{"bool":{"must":[{"match":{"monitor.status":{"query":"up","operator":"and"}}},{"match":{"monitor.id":{"query":"auto-http-0XDD2D4E60FD4A61C3","operator":"and"}}}]}}', - }, - }; - - const { - body: { data }, - } = await supertest - .post('/api/uptime/graphql') - .set('kbn-xsrf', 'foo') - .send({ ...getMonitorStatesQuery }); - - expectFixtureEql(data, 'monitor_states_id_filtered'); + '{"bool":{"must":[{"match":{"monitor.id":{"query":"0002-up","operator":"and"}}}]}}', + }); + // await new Promise(r => setTimeout(r, 90000)); + expectFixtureEql(data, 'monitor_states_id_filtered'); + }); + + it('will fetch monitor state data for the given date range', async () => { + expectFixtureEql(await getMonitorStates(), 'monitor_states'); + }); + + it('can navigate forward and backward using pagination', async () => { + const expectedResultsCount = 100; + const expectedPageCount = expectedResultsCount / 10; + + let pagination: string | null = null; + for (let page = 1; page <= expectedPageCount; page++) { + const data: any = await getMonitorStates({ pagination }); + pagination = data.monitorStates.nextPagePagination; + expectFixtureEql(data, `monitor_states_page_${page}`); + + // Test to see if the previous page pagination works on every page (other than the first) + if (page > 1) { + const prevData = await getMonitorStates({ + pagination: data.monitorStates.prevPagePagination, + }); + expectFixtureEql(prevData, `monitor_states_page_${page}_previous`); + } + } + }); + }); + + describe('monitor state scoping', async () => { + before('load heartbeat data', () => getService('esArchiver').load('uptime/blank')); + after('unload heartbeat index', () => getService('esArchiver').unload('uptime/blank')); + + describe('query document scoping with mismatched check statuses', async () => { + let checks: any[] = []; + let nonSummaryIp: string | null = null; + const testMonitorId = 'scope-test-id'; + const makeApiParams = (monitorId: string, filterClauses: any[] = []): any => { + return { + filters: JSON.stringify({ + bool: { + filter: [{ match: { 'monitor.id': monitorId } }, ...filterClauses], + }, + }), + }; + }; + + before(async () => { + const index = 'heartbeat-8.0.0'; + + const es = getService('es'); + dateRangeStart = new Date().toISOString(); + checks = await makeChecks(es, index, testMonitorId, 1, 2, {}, d => { + if (d.summary) { + d.monitor.status = 'down'; + d.summary.up--; + d.summary.down++; + } + return d; + }); + dateRangeEnd = new Date().toISOString(); + nonSummaryIp = checks[0][0].monitor.ip; + }); + + it('should match non summary documents without a status filter', async () => { + const params = makeApiParams(testMonitorId, [{ match: { 'monitor.ip': nonSummaryIp } }]); + + const nonSummaryRes = await getMonitorStates(params); + expect(nonSummaryRes.monitorStates.summaries.length).to.eql(1); + }); + + it('should not match non summary documents if the check status does not match the document status', async () => { + const params = makeApiParams(testMonitorId, [{ match: { 'monitor.ip': nonSummaryIp } }]); + params.statusFilter = 'down'; + + const nonSummaryRes = await getMonitorStates(params); + expect(nonSummaryRes.monitorStates.summaries.length).to.eql(0); + }); + + it('should not non match non summary documents if the check status does not match', async () => { + const params = makeApiParams(testMonitorId, [{ match: { 'monitor.ip': nonSummaryIp } }]); + params.statusFilter = 'up'; + + const nonSummaryRes = await getMonitorStates(params); + expect(nonSummaryRes.monitorStates.summaries.length).to.eql(0); + }); + + describe('matching outside of the date range', async () => { + before('set date range to future', () => { + const futureDate = new Date(); + + // Set dateRangeStart to one day from now + futureDate.setDate(futureDate.getDate() + 1); + dateRangeStart = futureDate.toISOString(); + + // Set dateRangeStart to two days from now + futureDate.setDate(futureDate.getDate() + 1); + dateRangeEnd = futureDate.toISOString(); + }); + + it('should not match any documents', async () => { + const params = makeApiParams(testMonitorId); + params.statusFilter = 'up'; + + const nonSummaryRes = await getMonitorStates(params); + expect(nonSummaryRes.monitorStates.summaries.length).to.eql(0); + }); + }); + }); }); }); } diff --git a/x-pack/test/api_integration/apis/uptime/graphql/monitor_status_bar.js b/x-pack/test/api_integration/apis/uptime/graphql/monitor_status_bar.js index e4b74d90c45d7..ee4a19e14f6f8 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/monitor_status_bar.js +++ b/x-pack/test/api_integration/apis/uptime/graphql/monitor_status_bar.js @@ -4,11 +4,14 @@ * you may not use this file except in compliance with the Elastic License. */ -import { expectFixtureEql } from './expect_fixture_eql'; import { monitorStatusBarQueryString } from '../../../../../legacy/plugins/uptime/public/queries'; +import { expectFixtureEql } from './helpers/expect_fixture_eql'; export default function ({ getService }) { describe('monitorStatusBar query', () => { + before('load heartbeat data', () => getService('esArchiver').load('uptime/full_heartbeat')); + after('unload heartbeat index', () => getService('esArchiver').unload('uptime/full_heartbeat')); + const supertest = getService('supertest'); it('returns the status for all monitors with no ID filtering', async () => { @@ -17,7 +20,7 @@ export default function ({ getService }) { query: monitorStatusBarQueryString, variables: { dateRangeStart: '2019-01-28T17:40:08.078Z', - dateRangeEnd: '2019-01-28T19:00:16.078Z', + dateRangeEnd: '2025-01-28T19:00:16.078Z', }, }; const { @@ -28,7 +31,8 @@ export default function ({ getService }) { .post('/api/uptime/graphql') .set('kbn-xsrf', 'foo') .send({ ...getMonitorStatusBarQuery }); - expectFixtureEql({ monitorStatus: responseData }, 'monitor_status'); + + expectFixtureEql(responseData, 'monitor_status_all', res => res.forEach(i => delete i.millisFromNow)); }); it('returns the status for only the given monitor', async () => { @@ -37,19 +41,17 @@ export default function ({ getService }) { query: monitorStatusBarQueryString, variables: { dateRangeStart: '2019-01-28T17:40:08.078Z', - dateRangeEnd: '2019-01-28T19:00:16.078Z', - monitorId: 'auto-tcp-0X81440A68E839814C', + dateRangeEnd: '2025-01-28T19:00:16.078Z', + monitorId: '0002-up', }, }; - const { - body: { - data: { monitorStatus }, - }, - } = await supertest + const res = await supertest .post('/api/uptime/graphql') .set('kbn-xsrf', 'foo') .send({ ...getMonitorStatusBarQuery }); - expectFixtureEql({ monitorStatus }, 'monitor_status_by_id'); + + + expectFixtureEql(res.body.data.monitorStatus, 'monitor_status_by_id'); }); }); } diff --git a/x-pack/test/api_integration/apis/uptime/graphql/ping_list.ts b/x-pack/test/api_integration/apis/uptime/graphql/ping_list.ts index a4a3232f52bc8..c84b9c382acdd 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/ping_list.ts +++ b/x-pack/test/api_integration/apis/uptime/graphql/ping_list.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; import { pingsQueryString } from '../../../../../legacy/plugins/uptime/public/queries'; -import { expectFixtureEql } from './expect_fixture_eql'; +import { expectFixtureEql } from './helpers/expect_fixture_eql'; import { Ping, PingResults } from '../../../../../legacy/plugins/uptime/common/graphql/types'; const expectPingFixtureEql = (data: { allPings: PingResults }, fixtureName: string) => { @@ -15,6 +15,9 @@ const expectPingFixtureEql = (data: { allPings: PingResults }, fixtureName: stri export default function({ getService }: any) { describe('pingList query', () => { + before('load heartbeat data', () => getService('esArchiver').load('uptime/full_heartbeat')); + after('unload heartbeat index', () => getService('esArchiver').unload('uptime/full_heartbeat')); + const supertest = getService('supertest'); it('returns a list of pings for the given date range and default size', async () => { @@ -23,7 +26,7 @@ export default function({ getService }: any) { query: pingsQueryString, variables: { dateRangeStart: '2019-01-28T17:40:08.078Z', - dateRangeEnd: '2019-01-28T19:00:16.078Z', + dateRangeEnd: '2025-01-28T19:00:16.078Z', }, }; const { @@ -36,6 +39,7 @@ export default function({ getService }: any) { allPings: { pings }, } = data; expect(pings).length(10); + expectPingFixtureEql(data, 'ping_list'); }); @@ -46,7 +50,7 @@ export default function({ getService }: any) { query: pingsQueryString, variables: { dateRangeStart: '2019-01-28T17:40:08.078Z', - dateRangeEnd: '2019-01-28T19:00:16.078Z', + dateRangeEnd: '2025-01-28T19:00:16.078Z', size: SIZE, }, }; @@ -65,13 +69,13 @@ export default function({ getService }: any) { it('returns a list of pings for a monitor ID', async () => { const SIZE = 15; - const MONITOR_ID = 'auto-tcp-0X81440A68E839814C'; + const MONITOR_ID = '0001-up'; const getPingsQuery = { operationName: 'PingList', query: pingsQueryString, variables: { dateRangeStart: '2019-01-28T17:40:08.078Z', - dateRangeEnd: '2019-01-28T19:00:16.078Z', + dateRangeEnd: '2025-01-28T19:00:16.078Z', monitorId: MONITOR_ID, size: SIZE, }, @@ -87,13 +91,13 @@ export default function({ getService }: any) { it('returns a list of pings sorted ascending', async () => { const SIZE = 5; - const MONITOR_ID = 'auto-tcp-0X81440A68E839814C'; + const MONITOR_ID = '0001-up'; const getPingsQuery = { operationName: 'PingList', query: pingsQueryString, variables: { dateRangeStart: '2019-01-28T17:40:08.078Z', - dateRangeEnd: '2019-01-28T19:00:16.078Z', + dateRangeEnd: '2025-01-28T19:00:16.078Z', monitorId: MONITOR_ID, size: SIZE, sort: 'asc', @@ -105,6 +109,7 @@ export default function({ getService }: any) { .post('/api/uptime/graphql') .set('kbn-xsrf', 'foo') .send({ ...getPingsQuery }); + expectPingFixtureEql(data, 'ping_list_sort'); }); }); diff --git a/x-pack/test/api_integration/apis/uptime/graphql/snapshot.js b/x-pack/test/api_integration/apis/uptime/graphql/snapshot.js index 6887e2157b373..004b87571eab4 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/snapshot.js +++ b/x-pack/test/api_integration/apis/uptime/graphql/snapshot.js @@ -5,10 +5,13 @@ */ import { snapshotQueryString } from '../../../../../legacy/plugins/uptime/public/queries'; -import { expectFixtureEql } from './expect_fixture_eql'; +import { expectFixtureEql } from './helpers/expect_fixture_eql'; export default function ({ getService }) { describe('snapshot query', () => { + before('load heartbeat data', () => getService('esArchiver').load('uptime/full_heartbeat')); + after('unload heartbeat index', () => getService('esArchiver').unload('uptime/full_heartbeat')); + const supertest = getService('supertest'); it('will fetch a monitor snapshot summary', async () => { @@ -17,7 +20,7 @@ export default function ({ getService }) { query: snapshotQueryString, variables: { dateRangeStart: '2019-01-28T17:40:08.078Z', - dateRangeEnd: '2019-01-28T19:00:16.078Z', + dateRangeEnd: '2025-01-28T19:00:16.078Z', }, }; const { @@ -36,7 +39,8 @@ export default function ({ getService }) { query: snapshotQueryString, variables: { dateRangeStart: '2019-01-28T17:40:08.078Z', - dateRangeEnd: '2019-01-28T19:00:16.078Z', + dateRangeEnd: '2025-01-28T19:00:16.078Z', + filters: `{"bool":{"must":[{"match":{"monitor.status":{"query":"down","operator":"and"}}}]}}`, statusFilter: 'down', }, }; @@ -56,7 +60,8 @@ export default function ({ getService }) { query: snapshotQueryString, variables: { dateRangeStart: '2019-01-28T17:40:08.078Z', - dateRangeEnd: '2019-01-28T19:00:16.078Z', + dateRangeEnd: '2025-01-28T19:00:16.078Z', + filters: `{"bool":{"must":[{"match":{"monitor.status":{"query":"up","operator":"and"}}}]}}`, statusFilter: 'up', }, }; @@ -77,7 +82,7 @@ export default function ({ getService }) { query: snapshotQueryString, variables: { dateRangeStart: '2019-01-25T04:30:54.740Z', - dateRangeEnd: '2019-01-28T04:50:54.740Z', + dateRangeEnd: '2025-01-28T04:50:54.740Z', filters: `{"bool":{"must":[{"match":{"monitor.status":{"query":"down","operator":"and"}}}]}}`, }, }; diff --git a/x-pack/test/api_integration/apis/uptime/graphql/snapshot_histogram.ts b/x-pack/test/api_integration/apis/uptime/graphql/snapshot_histogram.ts index 413511bf4a23b..7af9de99d8327 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/snapshot_histogram.ts +++ b/x-pack/test/api_integration/apis/uptime/graphql/snapshot_histogram.ts @@ -5,11 +5,14 @@ */ import { snapshotHistogramQueryString } from '../../../../../legacy/plugins/uptime/public/queries/snapshot_histogram_query'; -import { expectFixtureEql } from './expect_fixture_eql'; +import { expectFixtureEql } from './helpers/expect_fixture_eql'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function({ getService }: FtrProviderContext) { describe('snapshotHistogram', () => { + before('load heartbeat data', () => getService('esArchiver').load('uptime/full_heartbeat')); + after('unload heartbeat index', () => getService('esArchiver').unload('uptime/full_heartbeat')); + const supertest = getService('supertest'); it('will fetch histogram data for all monitors', async () => { @@ -17,8 +20,8 @@ export default function({ getService }: FtrProviderContext) { operationName: 'SnapshotHistogram', query: snapshotHistogramQueryString, variables: { - dateRangeStart: '2019-01-28T17:40:08.078Z', - dateRangeEnd: '2019-01-28T19:00:16.078Z', + dateRangeStart: '2019-09-11T03:31:04.380Z', + dateRangeEnd: '2019-09-11T03:40:34.410Z', }, }; @@ -36,9 +39,8 @@ export default function({ getService }: FtrProviderContext) { operationName: 'SnapshotHistogram', query: snapshotHistogramQueryString, variables: { - dateRangeStart: '2019-01-28T17:40:08.078Z', - dateRangeEnd: '2019-01-28T19:00:16.078Z', - monitorId: 'auto-http-0XDD2D4E60FD4A61C3', + dateRangeStart: '2019-09-11T03:31:04.380Z', + dateRangeEnd: '2019-09-11T03:40:34.410Z', }, }; @@ -56,8 +58,8 @@ export default function({ getService }: FtrProviderContext) { operationName: 'SnapshotHistogram', query: snapshotHistogramQueryString, variables: { - dateRangeStart: '2019-01-28T17:40:08.078Z', - dateRangeEnd: '2019-01-28T19:00:16.078Z', + dateRangeStart: '2019-09-11T03:31:04.380Z', + dateRangeEnd: '2019-09-11T03:40:34.410Z', filters: '{"bool":{"must":[{"match":{"monitor.status":{"query":"up","operator":"and"}}}]}}', }, diff --git a/x-pack/test/functional/apps/machine_learning/anomaly_detection/index.ts b/x-pack/test/functional/apps/machine_learning/anomaly_detection/index.ts index 8d2e58bb0614d..bf2fb4044de3f 100644 --- a/x-pack/test/functional/apps/machine_learning/anomaly_detection/index.ts +++ b/x-pack/test/functional/apps/machine_learning/anomaly_detection/index.ts @@ -6,7 +6,8 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; export default function({ loadTestFile }: FtrProviderContext) { - describe('anomaly detection', function() { + // FLAKY: https://github.com/elastic/kibana/issues/47312 + describe.skip('anomaly detection', function() { loadTestFile(require.resolve('./single_metric_job')); loadTestFile(require.resolve('./multi_metric_job')); loadTestFile(require.resolve('./population_job')); diff --git a/x-pack/test/functional/es_archives/uptime/blank/data.json b/x-pack/test/functional/es_archives/uptime/blank/data.json new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/x-pack/test/functional/es_archives/uptime/blank/mappings.json b/x-pack/test/functional/es_archives/uptime/blank/mappings.json new file mode 100644 index 0000000000000..eb383cc87563d --- /dev/null +++ b/x-pack/test/functional/es_archives/uptime/blank/mappings.json @@ -0,0 +1,2381 @@ +{ + "type": "index", + "value": { + "aliases": { + "heartbeat-8.0.0": { + "is_write_index": true + } + }, + "index": "heartbeat-8-test", + "mappings": { + "_meta": { + "beat": "heartbeat", + "version": "8.0.0" + }, + "date_detection": false, + "dynamic_templates": [ + { + "labels": { + "mapping": { + "type": "keyword" + }, + "match_mapping_type": "string", + "path_match": "labels.*" + } + }, + { + "container.labels": { + "mapping": { + "type": "keyword" + }, + "match_mapping_type": "string", + "path_match": "container.labels.*" + } + }, + { + "dns.answers": { + "mapping": { + "type": "keyword" + }, + "match_mapping_type": "string", + "path_match": "dns.answers.*" + } + }, + { + "fields": { + "mapping": { + "type": "keyword" + }, + "match_mapping_type": "string", + "path_match": "fields.*" + } + }, + { + "docker.container.labels": { + "mapping": { + "type": "keyword" + }, + "match_mapping_type": "string", + "path_match": "docker.container.labels.*" + } + }, + { + "kubernetes.labels.*": { + "mapping": { + "type": "keyword" + }, + "path_match": "kubernetes.labels.*" + } + }, + { + "kubernetes.annotations.*": { + "mapping": { + "type": "keyword" + }, + "path_match": "kubernetes.annotations.*" + } + }, + { + "strings_as_keyword": { + "mapping": { + "ignore_above": 1024, + "type": "keyword" + }, + "match_mapping_type": "string" + } + } + ], + "properties": { + "@timestamp": { + "type": "date" + }, + "agent": { + "properties": { + "ephemeral_id": { + "ignore_above": 1024, + "type": "keyword" + }, + "hostname": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "as": { + "properties": { + "number": { + "type": "long" + }, + "organization": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "client": { + "properties": { + "address": { + "ignore_above": 1024, + "type": "keyword" + }, + "as": { + "properties": { + "number": { + "type": "long" + }, + "organization": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "bytes": { + "type": "long" + }, + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "geo": { + "properties": { + "city_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "continent_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "location": { + "type": "geo_point" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "ip": { + "type": "ip" + }, + "mac": { + "ignore_above": 1024, + "type": "keyword" + }, + "nat": { + "properties": { + "ip": { + "type": "ip" + }, + "port": { + "type": "long" + } + } + }, + "packets": { + "type": "long" + }, + "port": { + "type": "long" + }, + "user": { + "properties": { + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "email": { + "ignore_above": 1024, + "type": "keyword" + }, + "full_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "group": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "hash": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "cloud": { + "properties": { + "account": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "availability_zone": { + "ignore_above": 1024, + "type": "keyword" + }, + "image": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "instance": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "machine": { + "properties": { + "type": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "project": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "provider": { + "ignore_above": 1024, + "type": "keyword" + }, + "region": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "container": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "image": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "tag": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "labels": { + "type": "object" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "runtime": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "destination": { + "properties": { + "address": { + "ignore_above": 1024, + "type": "keyword" + }, + "as": { + "properties": { + "number": { + "type": "long" + }, + "organization": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "bytes": { + "type": "long" + }, + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "geo": { + "properties": { + "city_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "continent_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "location": { + "type": "geo_point" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "ip": { + "type": "ip" + }, + "mac": { + "ignore_above": 1024, + "type": "keyword" + }, + "nat": { + "properties": { + "ip": { + "type": "ip" + }, + "port": { + "type": "long" + } + } + }, + "packets": { + "type": "long" + }, + "port": { + "type": "long" + }, + "user": { + "properties": { + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "email": { + "ignore_above": 1024, + "type": "keyword" + }, + "full_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "group": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "hash": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "dns": { + "properties": { + "answers": { + "properties": { + "class": { + "ignore_above": 1024, + "type": "keyword" + }, + "data": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "ttl": { + "type": "long" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "header_flags": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "op_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "question": { + "properties": { + "class": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "registered_domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "resolved_ip": { + "type": "ip" + }, + "response_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "docker": { + "properties": { + "container": { + "properties": { + "labels": { + "type": "object" + } + } + } + } + }, + "ecs": { + "properties": { + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "error": { + "properties": { + "code": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "message": { + "norms": false, + "type": "text" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "event": { + "properties": { + "action": { + "ignore_above": 1024, + "type": "keyword" + }, + "category": { + "ignore_above": 1024, + "type": "keyword" + }, + "code": { + "ignore_above": 1024, + "type": "keyword" + }, + "created": { + "type": "date" + }, + "dataset": { + "ignore_above": 1024, + "type": "keyword" + }, + "duration": { + "type": "long" + }, + "end": { + "type": "date" + }, + "hash": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "kind": { + "ignore_above": 1024, + "type": "keyword" + }, + "module": { + "ignore_above": 1024, + "type": "keyword" + }, + "original": { + "ignore_above": 1024, + "type": "keyword" + }, + "outcome": { + "ignore_above": 1024, + "type": "keyword" + }, + "provider": { + "ignore_above": 1024, + "type": "keyword" + }, + "risk_score": { + "type": "float" + }, + "risk_score_norm": { + "type": "float" + }, + "sequence": { + "type": "long" + }, + "severity": { + "type": "long" + }, + "start": { + "type": "date" + }, + "timezone": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "fields": { + "type": "object" + }, + "file": { + "properties": { + "accessed": { + "type": "date" + }, + "created": { + "type": "date" + }, + "ctime": { + "type": "date" + }, + "device": { + "ignore_above": 1024, + "type": "keyword" + }, + "directory": { + "ignore_above": 1024, + "type": "keyword" + }, + "extension": { + "ignore_above": 1024, + "type": "keyword" + }, + "gid": { + "ignore_above": 1024, + "type": "keyword" + }, + "group": { + "ignore_above": 1024, + "type": "keyword" + }, + "hash": { + "properties": { + "md5": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha1": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha256": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha512": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "inode": { + "ignore_above": 1024, + "type": "keyword" + }, + "mode": { + "ignore_above": 1024, + "type": "keyword" + }, + "mtime": { + "type": "date" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "owner": { + "ignore_above": 1024, + "type": "keyword" + }, + "path": { + "ignore_above": 1024, + "type": "keyword" + }, + "size": { + "type": "long" + }, + "target_path": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "uid": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "geo": { + "properties": { + "city_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "continent_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "location": { + "type": "geo_point" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "group": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "hash": { + "properties": { + "md5": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha1": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha256": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha512": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "host": { + "properties": { + "architecture": { + "ignore_above": 1024, + "type": "keyword" + }, + "containerized": { + "type": "boolean" + }, + "geo": { + "properties": { + "city_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "continent_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "location": { + "type": "geo_point" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "hostname": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "ip": { + "type": "ip" + }, + "mac": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "os": { + "properties": { + "build": { + "ignore_above": 1024, + "type": "keyword" + }, + "codename": { + "ignore_above": 1024, + "type": "keyword" + }, + "family": { + "ignore_above": 1024, + "type": "keyword" + }, + "full": { + "ignore_above": 1024, + "type": "keyword" + }, + "kernel": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "platform": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "uptime": { + "type": "long" + }, + "user": { + "properties": { + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "email": { + "ignore_above": 1024, + "type": "keyword" + }, + "full_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "group": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "hash": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "http": { + "properties": { + "request": { + "properties": { + "body": { + "properties": { + "bytes": { + "type": "long" + }, + "content": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "bytes": { + "type": "long" + }, + "method": { + "ignore_above": 1024, + "type": "keyword" + }, + "referrer": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "response": { + "properties": { + "body": { + "properties": { + "bytes": { + "type": "long" + }, + "content": { + "ignore_above": 1024, + "type": "keyword" + }, + "hash": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "bytes": { + "type": "long" + }, + "status_code": { + "type": "long" + } + } + }, + "rtt": { + "properties": { + "content": { + "properties": { + "us": { + "type": "long" + } + } + }, + "response_header": { + "properties": { + "us": { + "type": "long" + } + } + }, + "total": { + "properties": { + "us": { + "type": "long" + } + } + }, + "validate": { + "properties": { + "us": { + "type": "long" + } + } + }, + "validate_body": { + "properties": { + "us": { + "type": "long" + } + } + }, + "write_request": { + "properties": { + "us": { + "type": "long" + } + } + } + } + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "icmp": { + "properties": { + "requests": { + "type": "long" + }, + "rtt": { + "properties": { + "us": { + "type": "long" + } + } + } + } + }, + "jolokia": { + "properties": { + "agent": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "secured": { + "type": "boolean" + }, + "server": { + "properties": { + "product": { + "ignore_above": 1024, + "type": "keyword" + }, + "vendor": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "url": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "kubernetes": { + "properties": { + "annotations": { + "properties": { + "*": { + "type": "object" + } + } + }, + "container": { + "properties": { + "image": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "deployment": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "labels": { + "properties": { + "*": { + "type": "object" + } + } + }, + "namespace": { + "ignore_above": 1024, + "type": "keyword" + }, + "node": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "pod": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "uid": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "replicaset": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "statefulset": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "labels": { + "type": "object" + }, + "log": { + "properties": { + "level": { + "ignore_above": 1024, + "type": "keyword" + }, + "logger": { + "ignore_above": 1024, + "type": "keyword" + }, + "original": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "message": { + "norms": false, + "type": "text" + }, + "monitor": { + "properties": { + "check_group": { + "ignore_above": 1024, + "type": "keyword" + }, + "duration": { + "properties": { + "us": { + "type": "long" + } + } + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "ip": { + "type": "ip" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "status": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "network": { + "properties": { + "application": { + "ignore_above": 1024, + "type": "keyword" + }, + "bytes": { + "type": "long" + }, + "community_id": { + "ignore_above": 1024, + "type": "keyword" + }, + "direction": { + "ignore_above": 1024, + "type": "keyword" + }, + "forwarded_ip": { + "type": "ip" + }, + "iana_number": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "packets": { + "type": "long" + }, + "protocol": { + "ignore_above": 1024, + "type": "keyword" + }, + "transport": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "observer": { + "properties": { + "geo": { + "properties": { + "city_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "continent_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "location": { + "type": "geo_point" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "hostname": { + "ignore_above": 1024, + "type": "keyword" + }, + "ip": { + "type": "ip" + }, + "mac": { + "ignore_above": 1024, + "type": "keyword" + }, + "os": { + "properties": { + "family": { + "ignore_above": 1024, + "type": "keyword" + }, + "full": { + "ignore_above": 1024, + "type": "keyword" + }, + "kernel": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "platform": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "serial_number": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "vendor": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "organization": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "os": { + "properties": { + "family": { + "ignore_above": 1024, + "type": "keyword" + }, + "full": { + "ignore_above": 1024, + "type": "keyword" + }, + "kernel": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "platform": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "process": { + "properties": { + "args": { + "ignore_above": 1024, + "type": "keyword" + }, + "executable": { + "ignore_above": 1024, + "type": "keyword" + }, + "hash": { + "properties": { + "md5": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha1": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha256": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha512": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "pgid": { + "type": "long" + }, + "pid": { + "type": "long" + }, + "ppid": { + "type": "long" + }, + "start": { + "type": "date" + }, + "thread": { + "properties": { + "id": { + "type": "long" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "title": { + "ignore_above": 1024, + "type": "keyword" + }, + "uptime": { + "type": "long" + }, + "working_directory": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "related": { + "properties": { + "ip": { + "type": "ip" + } + } + }, + "resolve": { + "properties": { + "ip": { + "type": "ip" + }, + "rtt": { + "properties": { + "us": { + "type": "long" + } + } + } + } + }, + "server": { + "properties": { + "address": { + "ignore_above": 1024, + "type": "keyword" + }, + "as": { + "properties": { + "number": { + "type": "long" + }, + "organization": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "bytes": { + "type": "long" + }, + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "geo": { + "properties": { + "city_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "continent_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "location": { + "type": "geo_point" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "ip": { + "type": "ip" + }, + "mac": { + "ignore_above": 1024, + "type": "keyword" + }, + "nat": { + "properties": { + "ip": { + "type": "ip" + }, + "port": { + "type": "long" + } + } + }, + "packets": { + "type": "long" + }, + "port": { + "type": "long" + }, + "user": { + "properties": { + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "email": { + "ignore_above": 1024, + "type": "keyword" + }, + "full_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "group": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "hash": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "service": { + "properties": { + "ephemeral_id": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "state": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "socks5": { + "properties": { + "rtt": { + "properties": { + "connect": { + "properties": { + "us": { + "type": "long" + } + } + } + } + } + } + }, + "source": { + "properties": { + "address": { + "ignore_above": 1024, + "type": "keyword" + }, + "as": { + "properties": { + "number": { + "type": "long" + }, + "organization": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "bytes": { + "type": "long" + }, + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "geo": { + "properties": { + "city_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "continent_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "location": { + "type": "geo_point" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "ip": { + "type": "ip" + }, + "mac": { + "ignore_above": 1024, + "type": "keyword" + }, + "nat": { + "properties": { + "ip": { + "type": "ip" + }, + "port": { + "type": "long" + } + } + }, + "packets": { + "type": "long" + }, + "port": { + "type": "long" + }, + "user": { + "properties": { + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "email": { + "ignore_above": 1024, + "type": "keyword" + }, + "full_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "group": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "hash": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "summary": { + "properties": { + "down": { + "type": "long" + }, + "up": { + "type": "long" + } + } + }, + "tags": { + "ignore_above": 1024, + "type": "keyword" + }, + "tcp": { + "properties": { + "rtt": { + "properties": { + "connect": { + "properties": { + "us": { + "type": "long" + } + } + }, + "validate": { + "properties": { + "us": { + "type": "long" + } + } + } + } + } + } + }, + "timeseries": { + "properties": { + "instance": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "tls": { + "properties": { + "certificate_not_valid_after": { + "type": "date" + }, + "certificate_not_valid_before": { + "type": "date" + }, + "rtt": { + "properties": { + "handshake": { + "properties": { + "us": { + "type": "long" + } + } + } + } + } + } + }, + "tracing": { + "properties": { + "trace": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "transaction": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "url": { + "properties": { + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "fragment": { + "ignore_above": 1024, + "type": "keyword" + }, + "full": { + "ignore_above": 1024, + "type": "keyword" + }, + "original": { + "ignore_above": 1024, + "type": "keyword" + }, + "password": { + "ignore_above": 1024, + "type": "keyword" + }, + "path": { + "ignore_above": 1024, + "type": "keyword" + }, + "port": { + "type": "long" + }, + "query": { + "ignore_above": 1024, + "type": "keyword" + }, + "scheme": { + "ignore_above": 1024, + "type": "keyword" + }, + "username": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "user": { + "properties": { + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "email": { + "ignore_above": 1024, + "type": "keyword" + }, + "full_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "group": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "hash": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "user_agent": { + "properties": { + "device": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "original": { + "ignore_above": 1024, + "type": "keyword" + }, + "os": { + "properties": { + "family": { + "ignore_above": 1024, + "type": "keyword" + }, + "full": { + "ignore_above": 1024, + "type": "keyword" + }, + "kernel": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "platform": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "settings": { + "index": { + "mapping": { + "total_fields": { + "limit": "10000" + } + }, + "number_of_replicas": "1", + "number_of_shards": "1", + "query": { + "default_field": [ + "message", + "tags", + "agent.ephemeral_id", + "agent.id", + "agent.name", + "agent.type", + "agent.version", + "as.organization.name", + "client.address", + "client.as.organization.name", + "client.domain", + "client.geo.city_name", + "client.geo.continent_name", + "client.geo.country_iso_code", + "client.geo.country_name", + "client.geo.name", + "client.geo.region_iso_code", + "client.geo.region_name", + "client.mac", + "client.user.domain", + "client.user.email", + "client.user.full_name", + "client.user.group.id", + "client.user.group.name", + "client.user.hash", + "client.user.id", + "client.user.name", + "cloud.account.id", + "cloud.availability_zone", + "cloud.instance.id", + "cloud.instance.name", + "cloud.machine.type", + "cloud.provider", + "cloud.region", + "container.id", + "container.image.name", + "container.image.tag", + "container.name", + "container.runtime", + "destination.address", + "destination.as.organization.name", + "destination.domain", + "destination.geo.city_name", + "destination.geo.continent_name", + "destination.geo.country_iso_code", + "destination.geo.country_name", + "destination.geo.name", + "destination.geo.region_iso_code", + "destination.geo.region_name", + "destination.mac", + "destination.user.domain", + "destination.user.email", + "destination.user.full_name", + "destination.user.group.id", + "destination.user.group.name", + "destination.user.hash", + "destination.user.id", + "destination.user.name", + "dns.answers.class", + "dns.answers.data", + "dns.answers.name", + "dns.answers.type", + "dns.header_flags", + "dns.id", + "dns.op_code", + "dns.question.class", + "dns.question.name", + "dns.question.registered_domain", + "dns.question.type", + "dns.response_code", + "dns.type", + "ecs.version", + "error.code", + "error.id", + "error.message", + "event.action", + "event.category", + "event.code", + "event.dataset", + "event.hash", + "event.id", + "event.kind", + "event.module", + "event.original", + "event.outcome", + "event.provider", + "event.timezone", + "event.type", + "file.device", + "file.directory", + "file.extension", + "file.gid", + "file.group", + "file.hash.md5", + "file.hash.sha1", + "file.hash.sha256", + "file.hash.sha512", + "file.inode", + "file.mode", + "file.name", + "file.owner", + "file.path", + "file.target_path", + "file.type", + "file.uid", + "geo.city_name", + "geo.continent_name", + "geo.country_iso_code", + "geo.country_name", + "geo.name", + "geo.region_iso_code", + "geo.region_name", + "group.id", + "group.name", + "hash.md5", + "hash.sha1", + "hash.sha256", + "hash.sha512", + "host.architecture", + "host.geo.city_name", + "host.geo.continent_name", + "host.geo.country_iso_code", + "host.geo.country_name", + "host.geo.name", + "host.geo.region_iso_code", + "host.geo.region_name", + "host.hostname", + "host.id", + "host.mac", + "host.name", + "host.os.family", + "host.os.full", + "host.os.kernel", + "host.os.name", + "host.os.platform", + "host.os.version", + "host.type", + "host.user.domain", + "host.user.email", + "host.user.full_name", + "host.user.group.id", + "host.user.group.name", + "host.user.hash", + "host.user.id", + "host.user.name", + "http.request.body.content", + "http.request.method", + "http.request.referrer", + "http.response.body.content", + "http.version", + "log.level", + "log.logger", + "log.original", + "network.application", + "network.community_id", + "network.direction", + "network.iana_number", + "network.name", + "network.protocol", + "network.transport", + "network.type", + "observer.geo.city_name", + "observer.geo.continent_name", + "observer.geo.country_iso_code", + "observer.geo.country_name", + "observer.geo.name", + "observer.geo.region_iso_code", + "observer.geo.region_name", + "observer.hostname", + "observer.mac", + "observer.os.family", + "observer.os.full", + "observer.os.kernel", + "observer.os.name", + "observer.os.platform", + "observer.os.version", + "observer.serial_number", + "observer.type", + "observer.vendor", + "observer.version", + "organization.id", + "organization.name", + "os.family", + "os.full", + "os.kernel", + "os.name", + "os.platform", + "os.version", + "process.args", + "process.executable", + "process.hash.md5", + "process.hash.sha1", + "process.hash.sha256", + "process.hash.sha512", + "process.name", + "process.thread.name", + "process.title", + "process.working_directory", + "server.address", + "server.as.organization.name", + "server.domain", + "server.geo.city_name", + "server.geo.continent_name", + "server.geo.country_iso_code", + "server.geo.country_name", + "server.geo.name", + "server.geo.region_iso_code", + "server.geo.region_name", + "server.mac", + "server.user.domain", + "server.user.email", + "server.user.full_name", + "server.user.group.id", + "server.user.group.name", + "server.user.hash", + "server.user.id", + "server.user.name", + "service.ephemeral_id", + "service.id", + "service.name", + "service.state", + "service.type", + "service.version", + "source.address", + "source.as.organization.name", + "source.domain", + "source.geo.city_name", + "source.geo.continent_name", + "source.geo.country_iso_code", + "source.geo.country_name", + "source.geo.name", + "source.geo.region_iso_code", + "source.geo.region_name", + "source.mac", + "source.user.domain", + "source.user.email", + "source.user.full_name", + "source.user.group.id", + "source.user.group.name", + "source.user.hash", + "source.user.id", + "source.user.name", + "tracing.trace.id", + "tracing.transaction.id", + "url.domain", + "url.fragment", + "url.full", + "url.original", + "url.password", + "url.path", + "url.query", + "url.scheme", + "url.username", + "user.domain", + "user.email", + "user.full_name", + "user.group.id", + "user.group.name", + "user.hash", + "user.id", + "user.name", + "user_agent.device.name", + "user_agent.name", + "user_agent.original", + "user_agent.os.family", + "user_agent.os.full", + "user_agent.os.kernel", + "user_agent.os.name", + "user_agent.os.platform", + "user_agent.os.version", + "user_agent.version", + "agent.hostname", + "error.type", + "timeseries.instance", + "cloud.project.id", + "cloud.image.id", + "host.os.build", + "host.os.codename", + "kubernetes.pod.name", + "kubernetes.pod.uid", + "kubernetes.namespace", + "kubernetes.node.name", + "kubernetes.replicaset.name", + "kubernetes.deployment.name", + "kubernetes.statefulset.name", + "kubernetes.container.name", + "kubernetes.container.image", + "jolokia.agent.version", + "jolokia.agent.id", + "jolokia.server.product", + "jolokia.server.version", + "jolokia.server.vendor", + "jolokia.url", + "monitor.type", + "monitor.name", + "monitor.id", + "monitor.status", + "monitor.check_group", + "http.response.body.hash", + "fields.*" + ] + }, + "refresh_interval": "5s" + } + } + } +} diff --git a/x-pack/test/functional/es_archives/uptime/full_heartbeat/data.json.gz b/x-pack/test/functional/es_archives/uptime/full_heartbeat/data.json.gz index a153f873980e4..edc29c000e2e1 100644 Binary files a/x-pack/test/functional/es_archives/uptime/full_heartbeat/data.json.gz and b/x-pack/test/functional/es_archives/uptime/full_heartbeat/data.json.gz differ diff --git a/x-pack/test/functional/es_archives/uptime/full_heartbeat/mappings.json b/x-pack/test/functional/es_archives/uptime/full_heartbeat/mappings.json index ba4b8c4e4a2eb..be0e98a5a4927 100644 --- a/x-pack/test/functional/es_archives/uptime/full_heartbeat/mappings.json +++ b/x-pack/test/functional/es_archives/uptime/full_heartbeat/mappings.json @@ -1,1401 +1,2061 @@ { "type": "index", "value": { - "index": "heartbeat-8.0.0", + "aliases": { + "heartbeat-8.0.0": { + "is_write_index": true + } + }, + "index": "heartbeat-8.0.0-2019.09.11-000001", "mappings": { - "_doc": { - "_meta": { - "version": "8.0.0" + "_meta": { + "beat": "heartbeat", + "version": "8.0.0" + }, + "date_detection": false, + "dynamic_templates": [ + { + "labels": { + "mapping": { + "type": "keyword" + }, + "match_mapping_type": "string", + "path_match": "labels.*" + } }, - "date_detection": false, - "dynamic_templates": [ - { - "container.labels": { - "mapping": { - "type": "keyword" - }, - "match_mapping_type": "string", - "path_match": "container.labels.*" - } - }, - { - "fields": { - "mapping": { - "type": "keyword" - }, - "match_mapping_type": "string", - "path_match": "fields.*" - } - }, - { - "docker.container.labels": { - "mapping": { - "type": "keyword" - }, - "match_mapping_type": "string", - "path_match": "docker.container.labels.*" - } - }, - { - "strings_as_keyword": { - "mapping": { - "ignore_above": 1024, - "type": "keyword" - }, - "match_mapping_type": "string" + { + "container.labels": { + "mapping": { + "type": "keyword" + }, + "match_mapping_type": "string", + "path_match": "container.labels.*" + } + }, + { + "dns.answers": { + "mapping": { + "type": "keyword" + }, + "match_mapping_type": "string", + "path_match": "dns.answers.*" + } + }, + { + "fields": { + "mapping": { + "type": "keyword" + }, + "match_mapping_type": "string", + "path_match": "fields.*" + } + }, + { + "docker.container.labels": { + "mapping": { + "type": "keyword" + }, + "match_mapping_type": "string", + "path_match": "docker.container.labels.*" + } + }, + { + "kubernetes.labels.*": { + "mapping": { + "type": "keyword" + }, + "path_match": "kubernetes.labels.*" + } + }, + { + "kubernetes.annotations.*": { + "mapping": { + "type": "keyword" + }, + "path_match": "kubernetes.annotations.*" + } + }, + { + "strings_as_keyword": { + "mapping": { + "ignore_above": 1024, + "type": "keyword" + }, + "match_mapping_type": "string" + } + } + ], + "properties": { + "@timestamp": { + "type": "date" + }, + "agent": { + "properties": { + "ephemeral_id": { + "ignore_above": 1024, + "type": "keyword" + }, + "hostname": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" } } - ], - "properties": { - "@timestamp": { - "type": "date" - }, - "agent": { - "properties": { - "ephemeral_id": { - "ignore_above": 1024, - "type": "keyword" - }, - "hostname": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" + }, + "as": { + "properties": { + "number": { + "type": "long" + }, + "organization": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } } } - }, - "client": { - "properties": { - "address": { - "ignore_above": 1024, - "type": "keyword" - }, - "bytes": { - "type": "long" - }, - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "geo": { - "properties": { - "city_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "continent_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "country_iso_code": { - "ignore_above": 1024, - "type": "keyword" - }, - "country_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "location": { - "type": "geo_point" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_iso_code": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_name": { - "ignore_above": 1024, - "type": "keyword" + } + }, + "client": { + "properties": { + "address": { + "ignore_above": 1024, + "type": "keyword" + }, + "as": { + "properties": { + "number": { + "type": "long" + }, + "organization": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } } } - }, - "ip": { - "type": "ip" - }, - "mac": { - "ignore_above": 1024, - "type": "keyword" - }, - "packets": { - "type": "long" - }, - "port": { - "type": "long" } - } - }, - "cloud": { - "properties": { - "account": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - } + }, + "bytes": { + "type": "long" + }, + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "geo": { + "properties": { + "city_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "continent_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "location": { + "type": "geo_point" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_name": { + "ignore_above": 1024, + "type": "keyword" } - }, - "availability_zone": { - "ignore_above": 1024, - "type": "keyword" - }, - "instance": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - } + } + }, + "ip": { + "type": "ip" + }, + "mac": { + "ignore_above": 1024, + "type": "keyword" + }, + "nat": { + "properties": { + "ip": { + "type": "ip" + }, + "port": { + "type": "long" } - }, - "machine": { - "properties": { - "type": { - "ignore_above": 1024, - "type": "keyword" + } + }, + "packets": { + "type": "long" + }, + "port": { + "type": "long" + }, + "user": { + "properties": { + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "email": { + "ignore_above": 1024, + "type": "keyword" + }, + "full_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "group": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } } + }, + "hash": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" } - }, - "project": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - } + } + } + } + }, + "cloud": { + "properties": { + "account": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "availability_zone": { + "ignore_above": 1024, + "type": "keyword" + }, + "image": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "instance": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "machine": { + "properties": { + "type": { + "ignore_above": 1024, + "type": "keyword" } - }, - "provider": { - "ignore_above": 1024, - "type": "keyword" - }, - "region": { - "ignore_above": 1024, - "type": "keyword" } + }, + "project": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "provider": { + "ignore_above": 1024, + "type": "keyword" + }, + "region": { + "ignore_above": 1024, + "type": "keyword" } - }, - "container": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "image": { - "properties": { - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "tag": { - "ignore_above": 1024, - "type": "keyword" - } + } + }, + "container": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "image": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "tag": { + "ignore_above": 1024, + "type": "keyword" } - }, - "labels": { - "type": "object" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "runtime": { - "ignore_above": 1024, - "type": "keyword" } + }, + "labels": { + "type": "object" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "runtime": { + "ignore_above": 1024, + "type": "keyword" } - }, - "destination": { - "properties": { - "address": { - "ignore_above": 1024, - "type": "keyword" - }, - "bytes": { - "type": "long" - }, - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "geo": { - "properties": { - "city_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "continent_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "country_iso_code": { - "ignore_above": 1024, - "type": "keyword" - }, - "country_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "location": { - "type": "geo_point" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_iso_code": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_name": { - "ignore_above": 1024, - "type": "keyword" + } + }, + "destination": { + "properties": { + "address": { + "ignore_above": 1024, + "type": "keyword" + }, + "as": { + "properties": { + "number": { + "type": "long" + }, + "organization": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } } } - }, - "ip": { - "type": "ip" - }, - "mac": { - "ignore_above": 1024, - "type": "keyword" - }, - "packets": { - "type": "long" - }, - "port": { - "type": "long" } - } - }, - "docker": { - "properties": { - "container": { - "properties": { - "labels": { - "type": "object" + }, + "bytes": { + "type": "long" + }, + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "geo": { + "properties": { + "city_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "continent_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "location": { + "type": "geo_point" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "ip": { + "type": "ip" + }, + "mac": { + "ignore_above": 1024, + "type": "keyword" + }, + "nat": { + "properties": { + "ip": { + "type": "ip" + }, + "port": { + "type": "long" + } + } + }, + "packets": { + "type": "long" + }, + "port": { + "type": "long" + }, + "user": { + "properties": { + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "email": { + "ignore_above": 1024, + "type": "keyword" + }, + "full_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "group": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } } + }, + "hash": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" } } } - }, - "ecs": { - "properties": { - "version": { - "ignore_above": 1024, - "type": "keyword" + } + }, + "dns": { + "properties": { + "answers": { + "properties": { + "class": { + "ignore_above": 1024, + "type": "keyword" + }, + "data": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "ttl": { + "type": "long" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + } } - } - }, - "error": { - "properties": { - "code": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "message": { - "norms": false, - "type": "text" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" + }, + "header_flags": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "op_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "question": { + "properties": { + "class": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "registered_domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + } } + }, + "resolved_ip": { + "type": "ip" + }, + "response_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" } - }, - "event": { - "properties": { - "action": { - "ignore_above": 1024, - "type": "keyword" - }, - "category": { - "ignore_above": 1024, - "type": "keyword" - }, - "created": { - "type": "date" - }, - "dataset": { - "ignore_above": 1024, - "type": "keyword" - }, - "duration": { - "type": "long" - }, - "end": { - "type": "date" - }, - "hash": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "kind": { - "ignore_above": 1024, - "type": "keyword" - }, - "module": { - "ignore_above": 1024, - "type": "keyword" - }, - "original": { - "doc_values": false, - "ignore_above": 1024, - "index": false, - "type": "keyword" - }, - "outcome": { - "ignore_above": 1024, - "type": "keyword" - }, - "risk_score": { - "type": "float" - }, - "risk_score_norm": { - "type": "float" - }, - "severity": { - "type": "long" - }, - "start": { - "type": "date" - }, - "timezone": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" + } + }, + "docker": { + "properties": { + "container": { + "properties": { + "labels": { + "type": "object" + } } } - }, - "fields": { - "type": "object" - }, - "file": { - "properties": { - "ctime": { - "type": "date" - }, - "device": { - "ignore_above": 1024, - "type": "keyword" - }, - "extension": { - "ignore_above": 1024, - "type": "keyword" - }, - "gid": { - "ignore_above": 1024, - "type": "keyword" - }, - "group": { - "ignore_above": 1024, - "type": "keyword" - }, - "inode": { - "ignore_above": 1024, - "type": "keyword" - }, - "mode": { - "ignore_above": 1024, - "type": "keyword" - }, - "mtime": { - "type": "date" - }, - "owner": { - "ignore_above": 1024, - "type": "keyword" - }, - "path": { - "ignore_above": 1024, - "type": "keyword" - }, - "size": { - "type": "long" - }, - "target_path": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - }, - "uid": { - "ignore_above": 1024, - "type": "keyword" - } + } + }, + "ecs": { + "properties": { + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "error": { + "properties": { + "code": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "message": { + "norms": false, + "type": "text" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "event": { + "properties": { + "action": { + "ignore_above": 1024, + "type": "keyword" + }, + "category": { + "ignore_above": 1024, + "type": "keyword" + }, + "code": { + "ignore_above": 1024, + "type": "keyword" + }, + "created": { + "type": "date" + }, + "dataset": { + "ignore_above": 1024, + "type": "keyword" + }, + "duration": { + "type": "long" + }, + "end": { + "type": "date" + }, + "hash": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "kind": { + "ignore_above": 1024, + "type": "keyword" + }, + "module": { + "ignore_above": 1024, + "type": "keyword" + }, + "original": { + "ignore_above": 1024, + "type": "keyword" + }, + "outcome": { + "ignore_above": 1024, + "type": "keyword" + }, + "provider": { + "ignore_above": 1024, + "type": "keyword" + }, + "risk_score": { + "type": "float" + }, + "risk_score_norm": { + "type": "float" + }, + "sequence": { + "type": "long" + }, + "severity": { + "type": "long" + }, + "start": { + "type": "date" + }, + "timezone": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" } - }, - "group": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" + } + }, + "fields": { + "type": "object" + }, + "file": { + "properties": { + "accessed": { + "type": "date" + }, + "created": { + "type": "date" + }, + "ctime": { + "type": "date" + }, + "device": { + "ignore_above": 1024, + "type": "keyword" + }, + "directory": { + "ignore_above": 1024, + "type": "keyword" + }, + "extension": { + "ignore_above": 1024, + "type": "keyword" + }, + "gid": { + "ignore_above": 1024, + "type": "keyword" + }, + "group": { + "ignore_above": 1024, + "type": "keyword" + }, + "hash": { + "properties": { + "md5": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha1": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha256": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha512": { + "ignore_above": 1024, + "type": "keyword" + } } + }, + "inode": { + "ignore_above": 1024, + "type": "keyword" + }, + "mode": { + "ignore_above": 1024, + "type": "keyword" + }, + "mtime": { + "type": "date" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "owner": { + "ignore_above": 1024, + "type": "keyword" + }, + "path": { + "ignore_above": 1024, + "type": "keyword" + }, + "size": { + "type": "long" + }, + "target_path": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "uid": { + "ignore_above": 1024, + "type": "keyword" } - }, - "host": { - "properties": { - "architecture": { - "ignore_above": 1024, - "type": "keyword" - }, - "geo": { - "properties": { - "city_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "continent_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "country_iso_code": { - "ignore_above": 1024, - "type": "keyword" - }, - "country_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "location": { - "type": "geo_point" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_iso_code": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_name": { - "ignore_above": 1024, - "type": "keyword" - } + } + }, + "geo": { + "properties": { + "city_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "continent_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "location": { + "type": "geo_point" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "group": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "hash": { + "properties": { + "md5": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha1": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha256": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha512": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "host": { + "properties": { + "architecture": { + "ignore_above": 1024, + "type": "keyword" + }, + "containerized": { + "type": "boolean" + }, + "geo": { + "properties": { + "city_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "continent_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "location": { + "type": "geo_point" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "hostname": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "ip": { + "type": "ip" + }, + "mac": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "os": { + "properties": { + "build": { + "ignore_above": 1024, + "type": "keyword" + }, + "codename": { + "ignore_above": 1024, + "type": "keyword" + }, + "family": { + "ignore_above": 1024, + "type": "keyword" + }, + "full": { + "ignore_above": 1024, + "type": "keyword" + }, + "kernel": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "platform": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" } - }, - "hostname": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "ip": { - "type": "ip" - }, - "mac": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "os": { - "properties": { - "build": { - "ignore_above": 1024, - "type": "keyword" - }, - "family": { - "ignore_above": 1024, - "type": "keyword" - }, - "full": { - "ignore_above": 1024, - "type": "keyword" - }, - "kernel": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "platform": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" + } + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "uptime": { + "type": "long" + }, + "user": { + "properties": { + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "email": { + "ignore_above": 1024, + "type": "keyword" + }, + "full_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "group": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } } + }, + "hash": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" } - }, - "type": { - "ignore_above": 1024, - "type": "keyword" } } - }, - "http": { - "properties": { - "request": { - "properties": { - "body": { - "properties": { - "bytes": { - "type": "long" - }, - "content": { - "ignore_above": 1024, - "type": "keyword" - } + } + }, + "http": { + "properties": { + "request": { + "properties": { + "body": { + "properties": { + "bytes": { + "type": "long" + }, + "content": { + "ignore_above": 1024, + "type": "keyword" } - }, - "bytes": { - "type": "long" - }, - "method": { - "ignore_above": 1024, - "type": "keyword" - }, - "referrer": { - "ignore_above": 1024, - "type": "keyword" } + }, + "bytes": { + "type": "long" + }, + "method": { + "ignore_above": 1024, + "type": "keyword" + }, + "referrer": { + "ignore_above": 1024, + "type": "keyword" } - }, - "response": { - "properties": { - "body": { - "properties": { - "bytes": { - "type": "long" - }, - "content": { - "ignore_above": 1024, - "type": "keyword" - } + } + }, + "response": { + "properties": { + "body": { + "properties": { + "bytes": { + "type": "long" + }, + "content": { + "ignore_above": 1024, + "type": "keyword" + }, + "hash": { + "ignore_above": 1024, + "type": "keyword" } - }, - "bytes": { - "type": "long" - }, - "status_code": { - "type": "long" } + }, + "bytes": { + "type": "long" + }, + "status_code": { + "type": "long" } - }, - "rtt": { - "properties": { - "content": { - "properties": { - "us": { - "type": "long" - } + } + }, + "rtt": { + "properties": { + "content": { + "properties": { + "us": { + "type": "long" } - }, - "response_header": { - "properties": { - "us": { - "type": "long" - } + } + }, + "response_header": { + "properties": { + "us": { + "type": "long" } - }, - "total": { - "properties": { - "us": { - "type": "long" - } + } + }, + "total": { + "properties": { + "us": { + "type": "long" } - }, - "validate": { - "properties": { - "us": { - "type": "long" - } + } + }, + "validate": { + "properties": { + "us": { + "type": "long" } - }, - "validate_body": { - "properties": { - "us": { - "type": "long" - } + } + }, + "validate_body": { + "properties": { + "us": { + "type": "long" } - }, - "write_request": { - "properties": { - "us": { - "type": "long" - } + } + }, + "write_request": { + "properties": { + "us": { + "type": "long" } } } - }, - "version": { - "ignore_above": 1024, - "type": "keyword" } + }, + "version": { + "ignore_above": 1024, + "type": "keyword" } - }, - "icmp": { - "properties": { - "requests": { - "type": "long" - }, - "rtt": { - "properties": { - "us": { - "type": "long" - } + } + }, + "icmp": { + "properties": { + "requests": { + "type": "long" + }, + "rtt": { + "properties": { + "us": { + "type": "long" } } } - }, - "kubernetes": { - "properties": { - "annotations": { - "type": "object" - }, - "container": { - "properties": { - "image": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - } - } - }, - "labels": { - "type": "object" - }, - "namespace": { - "ignore_above": 1024, - "type": "keyword" - }, - "node": { - "properties": { - "name": { - "ignore_above": 1024, - "type": "keyword" - } + } + }, + "jolokia": { + "properties": { + "agent": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" } - }, - "pod": { - "properties": { - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "uid": { - "ignore_above": 1024, - "type": "keyword" - } + } + }, + "secured": { + "type": "boolean" + }, + "server": { + "properties": { + "product": { + "ignore_above": 1024, + "type": "keyword" + }, + "vendor": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" } } + }, + "url": { + "ignore_above": 1024, + "type": "keyword" } - }, - "labels": { - "type": "object" - }, - "log": { - "properties": { - "level": { - "ignore_above": 1024, - "type": "keyword" - }, - "original": { - "doc_values": false, - "ignore_above": 1024, - "index": false, - "type": "keyword" + } + }, + "kubernetes": { + "properties": { + "annotations": { + "properties": { + "*": { + "type": "object" + } } - } - }, - "message": { - "norms": false, - "type": "text" - }, - "monitor": { - "properties": { - "check_group": { - "ignore_above": 1024, - "type": "keyword" - }, - "duration": { - "properties": { - "us": { - "type": "long" - } + }, + "container": { + "properties": { + "image": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" } - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "ip": { - "type": "ip" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "status": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" } - } - }, - "network": { - "properties": { - "application": { - "ignore_above": 1024, - "type": "keyword" - }, - "bytes": { - "type": "long" - }, - "community_id": { - "ignore_above": 1024, - "type": "keyword" - }, - "direction": { - "ignore_above": 1024, - "type": "keyword" - }, - "forwarded_ip": { - "type": "ip" - }, - "iana_number": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "packets": { - "type": "long" - }, - "protocol": { - "ignore_above": 1024, - "type": "keyword" - }, - "transport": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" + }, + "deployment": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } } - } - }, - "observer": { - "properties": { - "geo": { - "properties": { - "city_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "continent_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "country_iso_code": { - "ignore_above": 1024, - "type": "keyword" - }, - "country_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "location": { - "type": "geo_point" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_iso_code": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_name": { - "ignore_above": 1024, - "type": "keyword" - } + }, + "labels": { + "properties": { + "*": { + "type": "object" } - }, - "hostname": { - "ignore_above": 1024, - "type": "keyword" - }, - "ip": { - "type": "ip" - }, - "mac": { - "ignore_above": 1024, - "type": "keyword" - }, - "os": { - "properties": { - "family": { - "ignore_above": 1024, - "type": "keyword" - }, - "full": { - "ignore_above": 1024, - "type": "keyword" - }, - "kernel": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "platform": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } + } + }, + "namespace": { + "ignore_above": 1024, + "type": "keyword" + }, + "node": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "pod": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "uid": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "replicaset": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "statefulset": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" } - }, - "serial_number": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - }, - "vendor": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" } } - }, - "organization": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" + } + }, + "labels": { + "type": "object" + }, + "log": { + "properties": { + "level": { + "ignore_above": 1024, + "type": "keyword" + }, + "logger": { + "ignore_above": 1024, + "type": "keyword" + }, + "original": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "message": { + "norms": false, + "type": "text" + }, + "monitor": { + "properties": { + "check_group": { + "ignore_above": 1024, + "type": "keyword" + }, + "duration": { + "properties": { + "us": { + "type": "long" + } } + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "ip": { + "type": "ip" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "status": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" } - }, - "os": { - "properties": { - "family": { - "ignore_above": 1024, - "type": "keyword" - }, - "full": { - "ignore_above": 1024, - "type": "keyword" - }, - "kernel": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "platform": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" + } + }, + "network": { + "properties": { + "application": { + "ignore_above": 1024, + "type": "keyword" + }, + "bytes": { + "type": "long" + }, + "community_id": { + "ignore_above": 1024, + "type": "keyword" + }, + "direction": { + "ignore_above": 1024, + "type": "keyword" + }, + "forwarded_ip": { + "type": "ip" + }, + "iana_number": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "packets": { + "type": "long" + }, + "protocol": { + "ignore_above": 1024, + "type": "keyword" + }, + "transport": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "observer": { + "properties": { + "geo": { + "properties": { + "city_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "continent_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "location": { + "type": "geo_point" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "hostname": { + "ignore_above": 1024, + "type": "keyword" + }, + "ip": { + "type": "ip" + }, + "mac": { + "ignore_above": 1024, + "type": "keyword" + }, + "os": { + "properties": { + "family": { + "ignore_above": 1024, + "type": "keyword" + }, + "full": { + "ignore_above": 1024, + "type": "keyword" + }, + "kernel": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "platform": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } } + }, + "serial_number": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "vendor": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" } - }, - "process": { - "properties": { - "args": { - "ignore_above": 1024, - "type": "keyword" - }, - "executable": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "pid": { - "type": "long" - }, - "ppid": { - "type": "long" - }, - "start": { - "type": "date" - }, - "thread": { - "properties": { - "id": { - "type": "long" - } + } + }, + "organization": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "os": { + "properties": { + "family": { + "ignore_above": 1024, + "type": "keyword" + }, + "full": { + "ignore_above": 1024, + "type": "keyword" + }, + "kernel": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "platform": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "process": { + "properties": { + "args": { + "ignore_above": 1024, + "type": "keyword" + }, + "executable": { + "ignore_above": 1024, + "type": "keyword" + }, + "hash": { + "properties": { + "md5": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha1": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha256": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha512": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "pgid": { + "type": "long" + }, + "pid": { + "type": "long" + }, + "ppid": { + "type": "long" + }, + "start": { + "type": "date" + }, + "thread": { + "properties": { + "id": { + "type": "long" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" } - }, - "title": { - "ignore_above": 1024, - "type": "keyword" - }, - "working_directory": { - "ignore_above": 1024, - "type": "keyword" } + }, + "title": { + "ignore_above": 1024, + "type": "keyword" + }, + "uptime": { + "type": "long" + }, + "working_directory": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "related": { + "properties": { + "ip": { + "type": "ip" } - }, - "related": { - "properties": { - "ip": { - "type": "ip" + } + }, + "resolve": { + "properties": { + "ip": { + "type": "ip" + }, + "rtt": { + "properties": { + "us": { + "type": "long" + } } } - }, - "resolve": { - "properties": { - "ip": { - "type": "ip" - }, - "rtt": { - "properties": { - "us": { - "type": "long" + } + }, + "server": { + "properties": { + "address": { + "ignore_above": 1024, + "type": "keyword" + }, + "as": { + "properties": { + "number": { + "type": "long" + }, + "organization": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } } } } - } - }, - "server": { - "properties": { - "address": { - "ignore_above": 1024, - "type": "keyword" - }, - "bytes": { - "type": "long" - }, - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "geo": { - "properties": { - "city_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "continent_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "country_iso_code": { - "ignore_above": 1024, - "type": "keyword" - }, - "country_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "location": { - "type": "geo_point" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_iso_code": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_name": { - "ignore_above": 1024, - "type": "keyword" + }, + "bytes": { + "type": "long" + }, + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "geo": { + "properties": { + "city_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "continent_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "location": { + "type": "geo_point" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "ip": { + "type": "ip" + }, + "mac": { + "ignore_above": 1024, + "type": "keyword" + }, + "nat": { + "properties": { + "ip": { + "type": "ip" + }, + "port": { + "type": "long" + } + } + }, + "packets": { + "type": "long" + }, + "port": { + "type": "long" + }, + "user": { + "properties": { + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "email": { + "ignore_above": 1024, + "type": "keyword" + }, + "full_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "group": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } } + }, + "hash": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" } - }, - "ip": { - "type": "ip" - }, - "mac": { - "ignore_above": 1024, - "type": "keyword" - }, - "packets": { - "type": "long" - }, - "port": { - "type": "long" } } - }, - "service": { - "properties": { - "ephemeral_id": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "state": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } + } + }, + "service": { + "properties": { + "ephemeral_id": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "state": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" } - }, - "socks5": { - "properties": { - "rtt": { - "properties": { - "connect": { - "properties": { - "us": { - "type": "long" - } + } + }, + "socks5": { + "properties": { + "rtt": { + "properties": { + "connect": { + "properties": { + "us": { + "type": "long" } } } } } - }, - "source": { - "properties": { - "address": { - "ignore_above": 1024, - "type": "keyword" - }, - "bytes": { - "type": "long" - }, - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "geo": { - "properties": { - "city_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "continent_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "country_iso_code": { - "ignore_above": 1024, - "type": "keyword" - }, - "country_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "location": { - "type": "geo_point" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_iso_code": { - "ignore_above": 1024, - "type": "keyword" - }, - "region_name": { - "ignore_above": 1024, - "type": "keyword" + } + }, + "source": { + "properties": { + "address": { + "ignore_above": 1024, + "type": "keyword" + }, + "as": { + "properties": { + "number": { + "type": "long" + }, + "organization": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } } } - }, - "ip": { - "type": "ip" - }, - "mac": { - "ignore_above": 1024, - "type": "keyword" - }, - "packets": { - "type": "long" - }, - "port": { - "type": "long" } - } - }, - "summary": { - "properties": { - "down": { - "type": "long" - }, - "up": { - "type": "long" + }, + "bytes": { + "type": "long" + }, + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "geo": { + "properties": { + "city_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "continent_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "location": { + "type": "geo_point" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "ip": { + "type": "ip" + }, + "mac": { + "ignore_above": 1024, + "type": "keyword" + }, + "nat": { + "properties": { + "ip": { + "type": "ip" + }, + "port": { + "type": "long" + } } + }, + "packets": { + "type": "long" + }, + "port": { + "type": "long" + }, + "user": { + "properties": { + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "email": { + "ignore_above": 1024, + "type": "keyword" + }, + "full_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "group": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "hash": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "summary": { + "properties": { + "down": { + "type": "long" + }, + "up": { + "type": "long" } - }, - "tags": { - "ignore_above": 1024, - "type": "keyword" - }, - "tcp": { - "properties": { - "rtt": { - "properties": { - "connect": { - "properties": { - "us": { - "type": "long" - } + } + }, + "tags": { + "ignore_above": 1024, + "type": "keyword" + }, + "tcp": { + "properties": { + "rtt": { + "properties": { + "connect": { + "properties": { + "us": { + "type": "long" } - }, - "validate": { - "properties": { - "us": { - "type": "long" - } + } + }, + "validate": { + "properties": { + "us": { + "type": "long" } } } } } - }, - "tls": { - "properties": { - "certificate_not_valid_after": { - "type": "date" - }, - "certificate_not_valid_before": { - "type": "date" - }, - "rtt": { - "properties": { - "handshake": { - "properties": { - "us": { - "type": "long" - } + } + }, + "timeseries": { + "properties": { + "instance": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "tls": { + "properties": { + "certificate_not_valid_after": { + "type": "date" + }, + "certificate_not_valid_before": { + "type": "date" + }, + "rtt": { + "properties": { + "handshake": { + "properties": { + "us": { + "type": "long" } } } } } - }, - "url": { - "properties": { - "domain": { - "ignore_above": 1024, - "type": "keyword" - }, - "fragment": { - "ignore_above": 1024, - "type": "keyword" - }, - "full": { - "ignore_above": 1024, - "type": "keyword" - }, - "hostname": { - "ignore_above": 1024, - "type": "keyword" - }, - "original": { - "ignore_above": 1024, - "type": "keyword" - }, - "password": { - "ignore_above": 1024, - "type": "keyword" - }, - "path": { - "ignore_above": 1024, - "type": "keyword" - }, - "port": { - "type": "long" - }, - "query": { - "ignore_above": 1024, - "type": "keyword" - }, - "scheme": { - "ignore_above": 1024, - "type": "keyword" - }, - "username": { - "ignore_above": 1024, - "type": "keyword" + } + }, + "tracing": { + "properties": { + "trace": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "transaction": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + } } } - }, - "user": { - "properties": { - "email": { - "ignore_above": 1024, - "type": "keyword" - }, - "full_name": { - "ignore_above": 1024, - "type": "keyword" - }, - "group": { - "properties": { - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - } + } + }, + "url": { + "properties": { + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "fragment": { + "ignore_above": 1024, + "type": "keyword" + }, + "full": { + "ignore_above": 1024, + "type": "keyword" + }, + "original": { + "ignore_above": 1024, + "type": "keyword" + }, + "password": { + "ignore_above": 1024, + "type": "keyword" + }, + "path": { + "ignore_above": 1024, + "type": "keyword" + }, + "port": { + "type": "long" + }, + "query": { + "ignore_above": 1024, + "type": "keyword" + }, + "scheme": { + "ignore_above": 1024, + "type": "keyword" + }, + "username": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "user": { + "properties": { + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "email": { + "ignore_above": 1024, + "type": "keyword" + }, + "full_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "group": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" } - }, - "hash": { - "ignore_above": 1024, - "type": "keyword" - }, - "id": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" } + }, + "hash": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" } - }, - "user_agent": { - "properties": { - "device": { - "ignore_above": 1024, - "type": "keyword" - }, - "major": { - "ignore_above": 1024, - "type": "keyword" - }, - "minor": { - "ignore_above": 1024, - "type": "keyword" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "original": { - "ignore_above": 1024, - "type": "keyword" - }, - "os": { - "properties": { - "family": { - "ignore_above": 1024, - "type": "keyword" - }, - "full": { - "ignore_above": 1024, - "type": "keyword" - }, - "kernel": { - "ignore_above": 1024, - "type": "keyword" - }, - "major": { - "type": "long" - }, - "minor": { - "type": "long" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - }, - "platform": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" - } + } + }, + "user_agent": { + "properties": { + "device": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "original": { + "ignore_above": 1024, + "type": "keyword" + }, + "os": { + "properties": { + "family": { + "ignore_above": 1024, + "type": "keyword" + }, + "full": { + "ignore_above": 1024, + "type": "keyword" + }, + "kernel": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "platform": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" } - }, - "patch": { - "ignore_above": 1024, - "type": "keyword" - }, - "version": { - "ignore_above": 1024, - "type": "keyword" } + }, + "version": { + "ignore_above": 1024, + "type": "keyword" } } } @@ -1403,18 +2063,319 @@ }, "settings": { "index": { - "analysis": { - "analyzer": { - "url": { - "max_token_length": "1000", - "tokenizer": "uax_url_email", - "type": "standard" - } + "mapping": { + "total_fields": { + "limit": "10000" } }, - "number_of_replicas": "0", - "number_of_shards": "1" + "number_of_replicas": "1", + "number_of_shards": "1", + "query": { + "default_field": [ + "message", + "tags", + "agent.ephemeral_id", + "agent.id", + "agent.name", + "agent.type", + "agent.version", + "as.organization.name", + "client.address", + "client.as.organization.name", + "client.domain", + "client.geo.city_name", + "client.geo.continent_name", + "client.geo.country_iso_code", + "client.geo.country_name", + "client.geo.name", + "client.geo.region_iso_code", + "client.geo.region_name", + "client.mac", + "client.user.domain", + "client.user.email", + "client.user.full_name", + "client.user.group.id", + "client.user.group.name", + "client.user.hash", + "client.user.id", + "client.user.name", + "cloud.account.id", + "cloud.availability_zone", + "cloud.instance.id", + "cloud.instance.name", + "cloud.machine.type", + "cloud.provider", + "cloud.region", + "container.id", + "container.image.name", + "container.image.tag", + "container.name", + "container.runtime", + "destination.address", + "destination.as.organization.name", + "destination.domain", + "destination.geo.city_name", + "destination.geo.continent_name", + "destination.geo.country_iso_code", + "destination.geo.country_name", + "destination.geo.name", + "destination.geo.region_iso_code", + "destination.geo.region_name", + "destination.mac", + "destination.user.domain", + "destination.user.email", + "destination.user.full_name", + "destination.user.group.id", + "destination.user.group.name", + "destination.user.hash", + "destination.user.id", + "destination.user.name", + "dns.answers.class", + "dns.answers.data", + "dns.answers.name", + "dns.answers.type", + "dns.header_flags", + "dns.id", + "dns.op_code", + "dns.question.class", + "dns.question.name", + "dns.question.registered_domain", + "dns.question.type", + "dns.response_code", + "dns.type", + "ecs.version", + "error.code", + "error.id", + "error.message", + "event.action", + "event.category", + "event.code", + "event.dataset", + "event.hash", + "event.id", + "event.kind", + "event.module", + "event.original", + "event.outcome", + "event.provider", + "event.timezone", + "event.type", + "file.device", + "file.directory", + "file.extension", + "file.gid", + "file.group", + "file.hash.md5", + "file.hash.sha1", + "file.hash.sha256", + "file.hash.sha512", + "file.inode", + "file.mode", + "file.name", + "file.owner", + "file.path", + "file.target_path", + "file.type", + "file.uid", + "geo.city_name", + "geo.continent_name", + "geo.country_iso_code", + "geo.country_name", + "geo.name", + "geo.region_iso_code", + "geo.region_name", + "group.id", + "group.name", + "hash.md5", + "hash.sha1", + "hash.sha256", + "hash.sha512", + "host.architecture", + "host.geo.city_name", + "host.geo.continent_name", + "host.geo.country_iso_code", + "host.geo.country_name", + "host.geo.name", + "host.geo.region_iso_code", + "host.geo.region_name", + "host.hostname", + "host.id", + "host.mac", + "host.name", + "host.os.family", + "host.os.full", + "host.os.kernel", + "host.os.name", + "host.os.platform", + "host.os.version", + "host.type", + "host.user.domain", + "host.user.email", + "host.user.full_name", + "host.user.group.id", + "host.user.group.name", + "host.user.hash", + "host.user.id", + "host.user.name", + "http.request.body.content", + "http.request.method", + "http.request.referrer", + "http.response.body.content", + "http.version", + "log.level", + "log.logger", + "log.original", + "network.application", + "network.community_id", + "network.direction", + "network.iana_number", + "network.name", + "network.protocol", + "network.transport", + "network.type", + "observer.geo.city_name", + "observer.geo.continent_name", + "observer.geo.country_iso_code", + "observer.geo.country_name", + "observer.geo.name", + "observer.geo.region_iso_code", + "observer.geo.region_name", + "observer.hostname", + "observer.mac", + "observer.os.family", + "observer.os.full", + "observer.os.kernel", + "observer.os.name", + "observer.os.platform", + "observer.os.version", + "observer.serial_number", + "observer.type", + "observer.vendor", + "observer.version", + "organization.id", + "organization.name", + "os.family", + "os.full", + "os.kernel", + "os.name", + "os.platform", + "os.version", + "process.args", + "process.executable", + "process.hash.md5", + "process.hash.sha1", + "process.hash.sha256", + "process.hash.sha512", + "process.name", + "process.thread.name", + "process.title", + "process.working_directory", + "server.address", + "server.as.organization.name", + "server.domain", + "server.geo.city_name", + "server.geo.continent_name", + "server.geo.country_iso_code", + "server.geo.country_name", + "server.geo.name", + "server.geo.region_iso_code", + "server.geo.region_name", + "server.mac", + "server.user.domain", + "server.user.email", + "server.user.full_name", + "server.user.group.id", + "server.user.group.name", + "server.user.hash", + "server.user.id", + "server.user.name", + "service.ephemeral_id", + "service.id", + "service.name", + "service.state", + "service.type", + "service.version", + "source.address", + "source.as.organization.name", + "source.domain", + "source.geo.city_name", + "source.geo.continent_name", + "source.geo.country_iso_code", + "source.geo.country_name", + "source.geo.name", + "source.geo.region_iso_code", + "source.geo.region_name", + "source.mac", + "source.user.domain", + "source.user.email", + "source.user.full_name", + "source.user.group.id", + "source.user.group.name", + "source.user.hash", + "source.user.id", + "source.user.name", + "tracing.trace.id", + "tracing.transaction.id", + "url.domain", + "url.fragment", + "url.full", + "url.original", + "url.password", + "url.path", + "url.query", + "url.scheme", + "url.username", + "user.domain", + "user.email", + "user.full_name", + "user.group.id", + "user.group.name", + "user.hash", + "user.id", + "user.name", + "user_agent.device.name", + "user_agent.name", + "user_agent.original", + "user_agent.os.family", + "user_agent.os.full", + "user_agent.os.kernel", + "user_agent.os.name", + "user_agent.os.platform", + "user_agent.os.version", + "user_agent.version", + "agent.hostname", + "error.type", + "timeseries.instance", + "cloud.project.id", + "cloud.image.id", + "host.os.build", + "host.os.codename", + "kubernetes.pod.name", + "kubernetes.pod.uid", + "kubernetes.namespace", + "kubernetes.node.name", + "kubernetes.replicaset.name", + "kubernetes.deployment.name", + "kubernetes.statefulset.name", + "kubernetes.container.name", + "kubernetes.container.image", + "jolokia.agent.version", + "jolokia.agent.id", + "jolokia.server.product", + "jolokia.server.version", + "jolokia.server.vendor", + "jolokia.url", + "monitor.type", + "monitor.name", + "monitor.id", + "monitor.status", + "monitor.check_group", + "http.response.body.hash", + "fields.*" + ] + }, + "refresh_interval": "5s" } } } -} \ No newline at end of file +} diff --git a/x-pack/test/saved_object_api_integration/common/suites/update.ts b/x-pack/test/saved_object_api_integration/common/suites/update.ts index 7c4adb0225382..cd291c53c5f34 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/update.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/update.ts @@ -87,7 +87,6 @@ export function updateTestSuiteFactory(esArchiver: any, supertest: SuperTest