diff --git a/api_docs/apm.json b/api_docs/apm.json index f0c84d9974c31..98b981068853c 100644 --- a/api_docs/apm.json +++ b/api_docs/apm.json @@ -186,7 +186,7 @@ "APMPluginSetupDependencies", ", \"data\" | \"cloud\" | \"security\" | \"home\" | \"features\" | \"fleet\" | \"ml\" | \"spaces\" | \"actions\" | \"usageCollection\" | \"licensing\" | \"observability\" | \"ruleRegistry\" | \"taskManager\" | \"alerting\">) => { config$: ", "Observable", - "; serviceMapEnabled: boolean; serviceMapFingerprintBucketSize: number; serviceMapTraceIdBucketSize: number; serviceMapFingerprintGlobalBucketSize: number; serviceMapTraceIdGlobalBucketSize: number; serviceMapMaxTracesPerRequest: number; autocreateApmIndexPattern: boolean; ui: Readonly<{} & { enabled: boolean; transactionGroupBucketSize: number; maxTraceItems: number; }>; searchAggregatedTransactions: ", + "; serviceMapEnabled: boolean; serviceMapFingerprintBucketSize: number; serviceMapTraceIdBucketSize: number; serviceMapFingerprintGlobalBucketSize: number; serviceMapTraceIdGlobalBucketSize: number; serviceMapMaxTracesPerRequest: number; autocreateApmIndexPattern: boolean; ui: Readonly<{} & { enabled: boolean; transactionGroupBucketSize: number; maxTraceItems: number; }>; searchAggregatedTransactions: ", "SearchAggregatedTransactionSetting", "; telemetryCollectionEnabled: boolean; metricsInterval: number; profilingEnabled: boolean; agent: Readonly<{} & { migrations: Readonly<{} & { enabled: boolean; }>; }>; }>>; getApmIndices: () => Promise<", "ApmIndicesConfig", @@ -388,7 +388,7 @@ "label": "config", "description": [], "signature": [ - "{ readonly enabled: boolean; readonly indices: Readonly<{} & { error: string; metric: string; span: string; transaction: string; sourcemap: string; onboarding: string; }>; readonly serviceMapEnabled: boolean; readonly serviceMapFingerprintBucketSize: number; readonly serviceMapTraceIdBucketSize: number; readonly serviceMapFingerprintGlobalBucketSize: number; readonly serviceMapTraceIdGlobalBucketSize: number; readonly serviceMapMaxTracesPerRequest: number; readonly autocreateApmIndexPattern: boolean; readonly ui: Readonly<{} & { enabled: boolean; transactionGroupBucketSize: number; maxTraceItems: number; }>; readonly searchAggregatedTransactions: ", + "{ readonly indices: Readonly<{} & { metric: string; error: string; span: string; transaction: string; sourcemap: string; onboarding: string; }>; readonly serviceMapEnabled: boolean; readonly serviceMapFingerprintBucketSize: number; readonly serviceMapTraceIdBucketSize: number; readonly serviceMapFingerprintGlobalBucketSize: number; readonly serviceMapTraceIdGlobalBucketSize: number; readonly serviceMapMaxTracesPerRequest: number; readonly autocreateApmIndexPattern: boolean; readonly ui: Readonly<{} & { enabled: boolean; transactionGroupBucketSize: number; maxTraceItems: number; }>; readonly searchAggregatedTransactions: ", "SearchAggregatedTransactionSetting", "; readonly telemetryCollectionEnabled: boolean; readonly metricsInterval: number; readonly profilingEnabled: boolean; readonly agent: Readonly<{} & { migrations: Readonly<{} & { enabled: boolean; }>; }>; }" ], @@ -737,7 +737,7 @@ "label": "APIEndpoint", "description": [], "signature": [ - "\"POST /internal/apm/index_pattern/static\" | \"GET /internal/apm/index_pattern/dynamic\" | \"GET /internal/apm/environments\" | \"GET /internal/apm/services/{serviceName}/errors\" | \"GET /internal/apm/services/{serviceName}/errors/{groupId}\" | \"GET /internal/apm/services/{serviceName}/errors/distribution\" | \"GET /internal/apm/services/{serviceName}/metrics/charts\" | \"GET /internal/apm/observability_overview\" | \"GET /internal/apm/observability_overview/has_data\" | \"GET /api/apm/rum/client-metrics\" | \"GET /api/apm/rum-client/page-load-distribution\" | \"GET /api/apm/rum-client/page-load-distribution/breakdown\" | \"GET /api/apm/rum-client/page-view-trends\" | \"GET /api/apm/rum-client/services\" | \"GET /api/apm/rum-client/visitor-breakdown\" | \"GET /api/apm/rum-client/web-core-vitals\" | \"GET /api/apm/rum-client/long-task-metrics\" | \"GET /api/apm/rum-client/url-search\" | \"GET /api/apm/rum-client/js-errors\" | \"GET /api/apm/observability_overview/has_rum_data\" | \"GET /internal/apm/service-map\" | \"GET /internal/apm/service-map/service/{serviceName}\" | \"GET /internal/apm/service-map/backend/{backendName}\" | \"GET /internal/apm/services/{serviceName}/serviceNodes\" | \"GET /internal/apm/services\" | \"GET /internal/apm/services/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/metadata/details\" | \"GET /internal/apm/services/{serviceName}/metadata/icons\" | \"GET /internal/apm/services/{serviceName}/agent\" | \"GET /internal/apm/services/{serviceName}/transaction_types\" | \"GET /internal/apm/services/{serviceName}/node/{serviceNodeName}/metadata\" | \"GET /api/apm/services/{serviceName}/annotation/search\" | \"POST /api/apm/services/{serviceName}/annotation\" | \"GET /internal/apm/services/{serviceName}/error_groups/main_statistics\" | \"GET /internal/apm/services/{serviceName}/error_groups/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/details/{serviceNodeName}\" | \"GET /internal/apm/services/{serviceName}/throughput\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/main_statistics\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/dependencies\" | \"GET /internal/apm/services/{serviceName}/dependencies/breakdown\" | \"GET /internal/apm/services/{serviceName}/profiling/timeline\" | \"GET /internal/apm/services/{serviceName}/profiling/statistics\" | \"GET /internal/apm/services/{serviceName}/alerts\" | \"GET /internal/apm/services/{serviceName}/infrastructure\" | \"GET /internal/apm/suggestions\" | \"GET /internal/apm/traces/{traceId}\" | \"GET /internal/apm/traces\" | \"GET /internal/apm/traces/{traceId}/root_transaction\" | \"GET /internal/apm/transactions/{transactionId}\" | \"GET /internal/apm/services/{serviceName}/transactions/groups/main_statistics\" | \"GET /internal/apm/services/{serviceName}/transactions/groups/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/latency\" | \"GET /internal/apm/services/{serviceName}/transactions/traces/samples\" | \"GET /internal/apm/services/{serviceName}/transaction/charts/breakdown\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/error_rate\" | \"GET /internal/apm/alerts/chart_preview/transaction_error_rate\" | \"GET /internal/apm/alerts/chart_preview/transaction_duration\" | \"GET /internal/apm/alerts/chart_preview/transaction_error_count\" | \"GET /api/apm/settings/agent-configuration\" | \"GET /api/apm/settings/agent-configuration/view\" | \"DELETE /api/apm/settings/agent-configuration\" | \"PUT /api/apm/settings/agent-configuration\" | \"POST /api/apm/settings/agent-configuration/search\" | \"GET /api/apm/settings/agent-configuration/services\" | \"GET /api/apm/settings/agent-configuration/environments\" | \"GET /api/apm/settings/agent-configuration/agent_name\" | \"GET /internal/apm/settings/anomaly-detection/jobs\" | \"POST /internal/apm/settings/anomaly-detection/jobs\" | \"GET /internal/apm/settings/anomaly-detection/environments\" | \"GET /internal/apm/settings/apm-index-settings\" | \"GET /internal/apm/settings/apm-indices\" | \"POST /internal/apm/settings/apm-indices/save\" | \"GET /internal/apm/settings/custom_links/transaction\" | \"GET /internal/apm/settings/custom_links\" | \"POST /internal/apm/settings/custom_links\" | \"PUT /internal/apm/settings/custom_links/{id}\" | \"DELETE /internal/apm/settings/custom_links/{id}\" | \"GET /api/apm/sourcemaps\" | \"POST /api/apm/sourcemaps\" | \"DELETE /api/apm/sourcemaps/{id}\" | \"GET /internal/apm/fleet/has_data\" | \"GET /internal/apm/fleet/agents\" | \"POST /internal/apm/fleet/apm_server_schema\" | \"GET /internal/apm/fleet/apm_server_schema/unsupported\" | \"GET /internal/apm/fleet/migration_check\" | \"POST /internal/apm/fleet/cloud_apm_package_policy\" | \"GET /internal/apm/backends/top_backends\" | \"GET /internal/apm/backends/{backendName}/upstream_services\" | \"GET /internal/apm/backends/{backendName}/metadata\" | \"GET /internal/apm/backends/{backendName}/charts/latency\" | \"GET /internal/apm/backends/{backendName}/charts/throughput\" | \"GET /internal/apm/backends/{backendName}/charts/error_rate\" | \"GET /internal/apm/fallback_to_transactions\" | \"GET /internal/apm/has_data\" | \"GET /internal/apm/event_metadata/{processorEvent}/{id}\"" + "\"POST /internal/apm/data_view/static\" | \"GET /internal/apm/data_view/dynamic\" | \"GET /internal/apm/environments\" | \"GET /internal/apm/services/{serviceName}/errors\" | \"GET /internal/apm/services/{serviceName}/errors/{groupId}\" | \"GET /internal/apm/services/{serviceName}/errors/distribution\" | \"POST /internal/apm/latency/overall_distribution\" | \"GET /internal/apm/services/{serviceName}/metrics/charts\" | \"GET /internal/apm/observability_overview\" | \"GET /internal/apm/observability_overview/has_data\" | \"GET /internal/apm/ux/client-metrics\" | \"GET /internal/apm/ux/page-load-distribution\" | \"GET /internal/apm/ux/page-load-distribution/breakdown\" | \"GET /internal/apm/ux/page-view-trends\" | \"GET /internal/apm/ux/services\" | \"GET /internal/apm/ux/visitor-breakdown\" | \"GET /internal/apm/ux/web-core-vitals\" | \"GET /internal/apm/ux/long-task-metrics\" | \"GET /internal/apm/ux/url-search\" | \"GET /internal/apm/ux/js-errors\" | \"GET /api/apm/observability_overview/has_rum_data\" | \"GET /internal/apm/service-map\" | \"GET /internal/apm/service-map/service/{serviceName}\" | \"GET /internal/apm/service-map/backend\" | \"GET /internal/apm/services/{serviceName}/serviceNodes\" | \"GET /internal/apm/services\" | \"GET /internal/apm/services/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/metadata/details\" | \"GET /internal/apm/services/{serviceName}/metadata/icons\" | \"GET /internal/apm/services/{serviceName}/agent\" | \"GET /internal/apm/services/{serviceName}/transaction_types\" | \"GET /internal/apm/services/{serviceName}/node/{serviceNodeName}/metadata\" | \"GET /api/apm/services/{serviceName}/annotation/search\" | \"POST /api/apm/services/{serviceName}/annotation\" | \"GET /internal/apm/services/{serviceName}/error_groups/main_statistics\" | \"GET /internal/apm/services/{serviceName}/error_groups/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/details/{serviceNodeName}\" | \"GET /internal/apm/services/{serviceName}/throughput\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/main_statistics\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/dependencies\" | \"GET /internal/apm/services/{serviceName}/dependencies/breakdown\" | \"GET /internal/apm/services/{serviceName}/profiling/timeline\" | \"GET /internal/apm/services/{serviceName}/profiling/statistics\" | \"GET /internal/apm/services/{serviceName}/alerts\" | \"GET /internal/apm/services/{serviceName}/infrastructure\" | \"GET /internal/apm/suggestions\" | \"GET /internal/apm/traces/{traceId}\" | \"GET /internal/apm/traces\" | \"GET /internal/apm/traces/{traceId}/root_transaction\" | \"GET /internal/apm/transactions/{transactionId}\" | \"GET /internal/apm/services/{serviceName}/transactions/groups/main_statistics\" | \"GET /internal/apm/services/{serviceName}/transactions/groups/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/latency\" | \"GET /internal/apm/services/{serviceName}/transactions/traces/samples\" | \"GET /internal/apm/services/{serviceName}/transaction/charts/breakdown\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/error_rate\" | \"GET /internal/apm/alerts/chart_preview/transaction_error_rate\" | \"GET /internal/apm/alerts/chart_preview/transaction_duration\" | \"GET /internal/apm/alerts/chart_preview/transaction_error_count\" | \"GET /api/apm/settings/agent-configuration\" | \"GET /api/apm/settings/agent-configuration/view\" | \"DELETE /api/apm/settings/agent-configuration\" | \"PUT /api/apm/settings/agent-configuration\" | \"POST /api/apm/settings/agent-configuration/search\" | \"GET /api/apm/settings/agent-configuration/services\" | \"GET /api/apm/settings/agent-configuration/environments\" | \"GET /api/apm/settings/agent-configuration/agent_name\" | \"GET /internal/apm/settings/anomaly-detection/jobs\" | \"POST /internal/apm/settings/anomaly-detection/jobs\" | \"GET /internal/apm/settings/anomaly-detection/environments\" | \"GET /internal/apm/settings/apm-index-settings\" | \"GET /internal/apm/settings/apm-indices\" | \"POST /internal/apm/settings/apm-indices/save\" | \"GET /internal/apm/settings/custom_links/transaction\" | \"GET /internal/apm/settings/custom_links\" | \"POST /internal/apm/settings/custom_links\" | \"PUT /internal/apm/settings/custom_links/{id}\" | \"DELETE /internal/apm/settings/custom_links/{id}\" | \"GET /api/apm/sourcemaps\" | \"POST /api/apm/sourcemaps\" | \"DELETE /api/apm/sourcemaps/{id}\" | \"GET /internal/apm/fleet/has_data\" | \"GET /internal/apm/fleet/agents\" | \"POST /api/apm/fleet/apm_server_schema\" | \"GET /internal/apm/fleet/apm_server_schema/unsupported\" | \"GET /internal/apm/fleet/migration_check\" | \"POST /internal/apm/fleet/cloud_apm_package_policy\" | \"GET /internal/apm/backends/top_backends\" | \"GET /internal/apm/backends/upstream_services\" | \"GET /internal/apm/backends/metadata\" | \"GET /internal/apm/backends/charts/latency\" | \"GET /internal/apm/backends/charts/throughput\" | \"GET /internal/apm/backends/charts/error_rate\" | \"POST /internal/apm/correlations/p_values\" | \"GET /internal/apm/correlations/field_candidates\" | \"POST /internal/apm/correlations/field_stats\" | \"POST /internal/apm/correlations/field_value_pairs\" | \"POST /internal/apm/correlations/significant_correlations\" | \"GET /internal/apm/fallback_to_transactions\" | \"GET /internal/apm/has_data\" | \"GET /internal/apm/event_metadata/{processorEvent}/{id}\"" ], "path": "x-pack/plugins/apm/server/routes/get_global_apm_server_route_repository.ts", "deprecated": false, @@ -765,7 +765,7 @@ "label": "APMConfig", "description": [], "signature": [ - "{ readonly enabled: boolean; readonly indices: Readonly<{} & { error: string; metric: string; span: string; transaction: string; sourcemap: string; onboarding: string; }>; readonly serviceMapEnabled: boolean; readonly serviceMapFingerprintBucketSize: number; readonly serviceMapTraceIdBucketSize: number; readonly serviceMapFingerprintGlobalBucketSize: number; readonly serviceMapTraceIdGlobalBucketSize: number; readonly serviceMapMaxTracesPerRequest: number; readonly autocreateApmIndexPattern: boolean; readonly ui: Readonly<{} & { enabled: boolean; transactionGroupBucketSize: number; maxTraceItems: number; }>; readonly searchAggregatedTransactions: ", + "{ readonly indices: Readonly<{} & { metric: string; error: string; span: string; transaction: string; sourcemap: string; onboarding: string; }>; readonly serviceMapEnabled: boolean; readonly serviceMapFingerprintBucketSize: number; readonly serviceMapTraceIdBucketSize: number; readonly serviceMapFingerprintGlobalBucketSize: number; readonly serviceMapTraceIdGlobalBucketSize: number; readonly serviceMapMaxTracesPerRequest: number; readonly autocreateApmIndexPattern: boolean; readonly ui: Readonly<{} & { enabled: boolean; transactionGroupBucketSize: number; maxTraceItems: number; }>; readonly searchAggregatedTransactions: ", "SearchAggregatedTransactionSetting", "; readonly telemetryCollectionEnabled: boolean; readonly metricsInterval: number; readonly profilingEnabled: boolean; readonly agent: Readonly<{} & { migrations: Readonly<{} & { enabled: boolean; }>; }>; }" ], @@ -781,7 +781,7 @@ "label": "ApmIndicesConfigName", "description": [], "signature": [ - "\"error\" | \"metric\" | \"span\" | \"transaction\" | \"sourcemap\" | \"onboarding\"" + "\"metric\" | \"error\" | \"span\" | \"transaction\" | \"sourcemap\" | \"onboarding\"" ], "path": "x-pack/plugins/apm/server/index.ts", "deprecated": false, @@ -812,7 +812,7 @@ }, ", ", "APMRouteCreateOptions", - ", { \"POST /internal/apm/index_pattern/static\": ", + ", { \"POST /internal/apm/data_view/static\": ", { "pluginId": "@kbn/server-route-repository", "scope": "server", @@ -820,7 +820,7 @@ "section": "def-server.ServerRoute", "text": "ServerRoute" }, - "<\"POST /internal/apm/index_pattern/static\", undefined, ", + "<\"POST /internal/apm/data_view/static\", undefined, ", { "pluginId": "apm", "scope": "server", @@ -830,7 +830,7 @@ }, ", { created: boolean; }, ", "APMRouteCreateOptions", - ">; } & { \"GET /internal/apm/index_pattern/dynamic\": ", + ">; } & { \"GET /internal/apm/data_view/dynamic\": ", { "pluginId": "@kbn/server-route-repository", "scope": "server", @@ -838,7 +838,7 @@ "section": "def-server.ServerRoute", "text": "ServerRoute" }, - "<\"GET /internal/apm/index_pattern/dynamic\", undefined, ", + "<\"GET /internal/apm/data_view/dynamic\", undefined, ", { "pluginId": "apm", "scope": "server", @@ -846,8 +846,8 @@ "section": "def-server.APMRouteHandlerResources", "text": "APMRouteHandlerResources" }, - ", { dynamicIndexPattern: ", - "IndexPatternTitleAndFields", + ", { dynamicDataView: ", + "DataViewTitleAndFields", " | undefined; }, ", "APMRouteCreateOptions", ">; } & { \"GET /internal/apm/environments\": ", @@ -1042,6 +1042,12 @@ "Type", "; end: ", "Type", + "; }>, ", + "PartialC", + "<{ comparisonStart: ", + "Type", + "; comparisonEnd: ", + "Type", "; }>]>; }>, ", { "pluginId": "apm", @@ -1050,7 +1056,79 @@ "section": "def-server.APMRouteHandlerResources", "text": "APMRouteHandlerResources" }, - ", { noHits: boolean; buckets: { key: number; count: number; }[]; bucketSize: number; }, ", + ", { currentPeriod: { x: number; y: number; }[]; previousPeriod: { x: number; y: number | null | undefined; }[]; bucketSize: number; }, ", + "APMRouteCreateOptions", + ">; } & { \"POST /internal/apm/latency/overall_distribution\": ", + { + "pluginId": "@kbn/server-route-repository", + "scope": "server", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-server.ServerRoute", + "text": "ServerRoute" + }, + "<\"POST /internal/apm/latency/overall_distribution\", ", + "TypeC", + "<{ body: ", + "IntersectionC", + "<[", + "PartialC", + "<{ serviceName: ", + "StringC", + "; transactionName: ", + "StringC", + "; transactionType: ", + "StringC", + "; termFilters: ", + "ArrayC", + "<", + "TypeC", + "<{ fieldName: ", + "StringC", + "; fieldValue: ", + "UnionC", + "<[", + "StringC", + ", ", + "Type", + "]>; }>>; }>, ", + "TypeC", + "<{ environment: ", + "UnionC", + "<[", + "LiteralC", + "<\"ENVIRONMENT_NOT_DEFINED\">, ", + "LiteralC", + "<\"ENVIRONMENT_ALL\">, ", + "BrandC", + "<", + "StringC", + ", ", + "NonEmptyStringBrand", + ">]>; }>, ", + "TypeC", + "<{ kuery: ", + "StringC", + "; }>, ", + "TypeC", + "<{ start: ", + "Type", + "; end: ", + "Type", + "; }>, ", + "TypeC", + "<{ percentileThreshold: ", + "Type", + "; }>]>; }>, ", + { + "pluginId": "apm", + "scope": "server", + "docId": "kibApmPluginApi", + "section": "def-server.APMRouteHandlerResources", + "text": "APMRouteHandlerResources" + }, + ", ", + "OverallLatencyDistributionResponse", + ", ", "APMRouteCreateOptions", ">; } & { \"GET /internal/apm/services/{serviceName}/metrics/charts\": ", { @@ -1133,6 +1211,8 @@ "; }>, ", "TypeC", "<{ bucketSize: ", + "Type", + "; intervalString: ", "StringC", "; }>]>; }>, ", { @@ -1164,7 +1244,7 @@ "ApmIndicesConfig", "; }, ", "APMRouteCreateOptions", - ">; } & { \"GET /api/apm/rum/client-metrics\": ", + ">; } & { \"GET /internal/apm/ux/client-metrics\": ", { "pluginId": "@kbn/server-route-repository", "scope": "server", @@ -1172,7 +1252,7 @@ "section": "def-server.ServerRoute", "text": "ServerRoute" }, - "<\"GET /api/apm/rum/client-metrics\", ", + "<\"GET /internal/apm/ux/client-metrics\", ", "TypeC", "<{ query: ", "IntersectionC", @@ -1202,7 +1282,7 @@ }, ", { pageViews: { value: number; }; totalPageLoadDuration: { value: number; }; backEnd: { value: number; }; frontEnd: { value: number; }; }, ", "APMRouteCreateOptions", - ">; } & { \"GET /api/apm/rum-client/page-load-distribution\": ", + ">; } & { \"GET /internal/apm/ux/page-load-distribution\": ", { "pluginId": "@kbn/server-route-repository", "scope": "server", @@ -1210,7 +1290,7 @@ "section": "def-server.ServerRoute", "text": "ServerRoute" }, - "<\"GET /api/apm/rum-client/page-load-distribution\", ", + "<\"GET /internal/apm/ux/page-load-distribution\", ", "TypeC", "<{ query: ", "IntersectionC", @@ -1248,7 +1328,7 @@ }, ", { pageLoadDistribution: { pageLoadDistribution: { x: number; y: number; }[]; percentiles: Record | undefined; minDuration: number; maxDuration: number; } | null; }, ", "APMRouteCreateOptions", - ">; } & { \"GET /api/apm/rum-client/page-load-distribution/breakdown\": ", + ">; } & { \"GET /internal/apm/ux/page-load-distribution/breakdown\": ", { "pluginId": "@kbn/server-route-repository", "scope": "server", @@ -1256,7 +1336,7 @@ "section": "def-server.ServerRoute", "text": "ServerRoute" }, - "<\"GET /api/apm/rum-client/page-load-distribution/breakdown\", ", + "<\"GET /internal/apm/ux/page-load-distribution/breakdown\", ", "TypeC", "<{ query: ", "IntersectionC", @@ -1298,7 +1378,7 @@ }, ", { pageLoadDistBreakdown: { name: string; data: { x: number; y: number; }[]; }[] | undefined; }, ", "APMRouteCreateOptions", - ">; } & { \"GET /api/apm/rum-client/page-view-trends\": ", + ">; } & { \"GET /internal/apm/ux/page-view-trends\": ", { "pluginId": "@kbn/server-route-repository", "scope": "server", @@ -1306,7 +1386,7 @@ "section": "def-server.ServerRoute", "text": "ServerRoute" }, - "<\"GET /api/apm/rum-client/page-view-trends\", ", + "<\"GET /internal/apm/ux/page-view-trends\", ", "TypeC", "<{ query: ", "IntersectionC", @@ -1342,7 +1422,7 @@ }, ", { topItems: string[]; items: Record[]; }, ", "APMRouteCreateOptions", - ">; } & { \"GET /api/apm/rum-client/services\": ", + ">; } & { \"GET /internal/apm/ux/services\": ", { "pluginId": "@kbn/server-route-repository", "scope": "server", @@ -1350,7 +1430,7 @@ "section": "def-server.ServerRoute", "text": "ServerRoute" }, - "<\"GET /api/apm/rum-client/services\", ", + "<\"GET /internal/apm/ux/services\", ", "TypeC", "<{ query: ", "IntersectionC", @@ -1374,7 +1454,7 @@ }, ", { rumServices: string[]; }, ", "APMRouteCreateOptions", - ">; } & { \"GET /api/apm/rum-client/visitor-breakdown\": ", + ">; } & { \"GET /internal/apm/ux/visitor-breakdown\": ", { "pluginId": "@kbn/server-route-repository", "scope": "server", @@ -1382,7 +1462,7 @@ "section": "def-server.ServerRoute", "text": "ServerRoute" }, - "<\"GET /api/apm/rum-client/visitor-breakdown\", ", + "<\"GET /internal/apm/ux/visitor-breakdown\", ", "TypeC", "<{ query: ", "IntersectionC", @@ -1412,7 +1492,7 @@ }, ", { os: { count: number; name: string; }[]; browsers: { count: number; name: string; }[]; }, ", "APMRouteCreateOptions", - ">; } & { \"GET /api/apm/rum-client/web-core-vitals\": ", + ">; } & { \"GET /internal/apm/ux/web-core-vitals\": ", { "pluginId": "@kbn/server-route-repository", "scope": "server", @@ -1420,7 +1500,7 @@ "section": "def-server.ServerRoute", "text": "ServerRoute" }, - "<\"GET /api/apm/rum-client/web-core-vitals\", ", + "<\"GET /internal/apm/ux/web-core-vitals\", ", "TypeC", "<{ query: ", "IntersectionC", @@ -1450,7 +1530,7 @@ }, ", { coreVitalPages: number; cls: number | null; fid: number | null | undefined; lcp: number | null | undefined; tbt: number; fcp: number | null | undefined; lcpRanks: number[]; fidRanks: number[]; clsRanks: number[]; }, ", "APMRouteCreateOptions", - ">; } & { \"GET /api/apm/rum-client/long-task-metrics\": ", + ">; } & { \"GET /internal/apm/ux/long-task-metrics\": ", { "pluginId": "@kbn/server-route-repository", "scope": "server", @@ -1458,7 +1538,7 @@ "section": "def-server.ServerRoute", "text": "ServerRoute" }, - "<\"GET /api/apm/rum-client/long-task-metrics\", ", + "<\"GET /internal/apm/ux/long-task-metrics\", ", "TypeC", "<{ query: ", "IntersectionC", @@ -1488,7 +1568,7 @@ }, ", { noOfLongTasks: number; sumOfLongTasks: number; longestLongTask: number; }, ", "APMRouteCreateOptions", - ">; } & { \"GET /api/apm/rum-client/url-search\": ", + ">; } & { \"GET /internal/apm/ux/url-search\": ", { "pluginId": "@kbn/server-route-repository", "scope": "server", @@ -1496,7 +1576,7 @@ "section": "def-server.ServerRoute", "text": "ServerRoute" }, - "<\"GET /api/apm/rum-client/url-search\", ", + "<\"GET /internal/apm/ux/url-search\", ", "TypeC", "<{ query: ", "IntersectionC", @@ -1526,7 +1606,7 @@ }, ", { total: number; items: { url: string; count: number; pld: number; }[]; }, ", "APMRouteCreateOptions", - ">; } & { \"GET /api/apm/rum-client/js-errors\": ", + ">; } & { \"GET /internal/apm/ux/js-errors\": ", { "pluginId": "@kbn/server-route-repository", "scope": "server", @@ -1534,7 +1614,7 @@ "section": "def-server.ServerRoute", "text": "ServerRoute" }, - "<\"GET /api/apm/rum-client/js-errors\", ", + "<\"GET /internal/apm/ux/js-errors\", ", "TypeC", "<{ query: ", "IntersectionC", @@ -1692,7 +1772,7 @@ }, ", { avgMemoryUsage: number | null; avgCpuUsage: number | null; transactionStats: { avgTransactionDuration: number | null; avgRequestsPerMinute: number | null; }; avgErrorRate: number | null; }, ", "APMRouteCreateOptions", - ">; } & { \"GET /internal/apm/service-map/backend/{backendName}\": ", + ">; } & { \"GET /internal/apm/service-map/backend\": ", { "pluginId": "@kbn/server-route-repository", "scope": "server", @@ -1700,15 +1780,15 @@ "section": "def-server.ServerRoute", "text": "ServerRoute" }, - "<\"GET /internal/apm/service-map/backend/{backendName}\", ", + "<\"GET /internal/apm/service-map/backend\", ", "TypeC", - "<{ path: ", + "<{ query: ", + "IntersectionC", + "<[", "TypeC", "<{ backendName: ", "StringC", - "; }>; query: ", - "IntersectionC", - "<[", + "; }>, ", "TypeC", "<{ environment: ", "UnionC", @@ -2398,9 +2478,7 @@ "section": "def-server.APMRouteHandlerResources", "text": "APMRouteHandlerResources" }, - ", { currentPeriod: { x: number; y: number | null; }[]; previousPeriod: { x: number; y: number | null | undefined; }[]; throughputUnit: ", - "ThroughputUnit", - "; }, ", + ", { currentPeriod: { x: number; y: number | null; }[]; previousPeriod: { x: number; y: number | null | undefined; }[]; }, ", "APMRouteCreateOptions", ">; } & { \"GET /internal/apm/services/{serviceName}/service_overview_instances/main_statistics\": ", { @@ -3378,7 +3456,7 @@ "section": "def-server.APMRouteHandlerResources", "text": "APMRouteHandlerResources" }, - ", { noHits: boolean; traceSamples: { transactionId: string; traceId: string; }[]; }, ", + ", { traceSamples: { transactionId: string; traceId: string; }[]; }, ", "APMRouteCreateOptions", ">; } & { \"GET /internal/apm/services/{serviceName}/transaction/charts/breakdown\": ", { @@ -3502,9 +3580,9 @@ "section": "def-server.APMRouteHandlerResources", "text": "APMRouteHandlerResources" }, - ", { currentPeriod: { noHits: boolean; transactionErrorRate: ", + ", { currentPeriod: { timeseries: ", "Coordinate", - "[]; average: number | null; }; previousPeriod: { transactionErrorRate: { x: number; y: number | null | undefined; }[]; noHits: boolean; average: number | null; }; }, ", + "[]; average: number | null; }; previousPeriod: { timeseries: { x: number; y: number | null | undefined; }[]; average: number | null; }; }, ", "APMRouteCreateOptions", ">; } & { \"GET /internal/apm/alerts/chart_preview/transaction_error_rate\": ", { @@ -4000,7 +4078,7 @@ "section": "def-server.APMRouteHandlerResources", "text": "APMRouteHandlerResources" }, - ", { apmIndexSettings: { configurationName: \"error\" | \"metric\" | \"span\" | \"transaction\" | \"sourcemap\" | \"onboarding\"; defaultValue: string; savedValue: string | undefined; }[]; }, ", + ", { apmIndexSettings: { configurationName: \"metric\" | \"error\" | \"span\" | \"transaction\" | \"sourcemap\" | \"onboarding\"; defaultValue: string; savedValue: string | undefined; }[]; }, ", "APMRouteCreateOptions", ">; } & { \"GET /internal/apm/settings/apm-indices\": ", { @@ -4360,7 +4438,7 @@ }, ", { cloudStandaloneSetup: { apmServerUrl: string | undefined; secretToken: string | undefined; } | undefined; isFleetEnabled: boolean; fleetAgents: { id: string; name: string; apmServerUrl: any; secretToken: any; }[]; }, ", "APMRouteCreateOptions", - ">; } & { \"POST /internal/apm/fleet/apm_server_schema\": ", + ">; } & { \"POST /api/apm/fleet/apm_server_schema\": ", { "pluginId": "@kbn/server-route-repository", "scope": "server", @@ -4368,7 +4446,7 @@ "section": "def-server.ServerRoute", "text": "ServerRoute" }, - "<\"POST /internal/apm/fleet/apm_server_schema\", ", + "<\"POST /api/apm/fleet/apm_server_schema\", ", "TypeC", "<{ body: ", "TypeC", @@ -4422,7 +4500,15 @@ "section": "def-server.APMRouteHandlerResources", "text": "APMRouteHandlerResources" }, - ", { has_cloud_agent_policy: boolean; has_cloud_apm_package_policy: boolean; cloud_apm_migration_enabled: boolean; has_required_role: boolean | undefined; }, ", + ", { has_cloud_agent_policy: boolean; has_cloud_apm_package_policy: boolean; cloud_apm_migration_enabled: boolean; has_required_role: boolean | undefined; cloud_apm_package_policy: ", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.PackagePolicy", + "text": "PackagePolicy" + }, + " | undefined; }, ", "APMRouteCreateOptions", ">; } & { \"POST /internal/apm/fleet/cloud_apm_package_policy\": ", { @@ -4526,7 +4612,7 @@ "Node", "; }[]; }, ", "APMRouteCreateOptions", - ">; } & { \"GET /internal/apm/backends/{backendName}/upstream_services\": ", + ">; } & { \"GET /internal/apm/backends/upstream_services\": ", { "pluginId": "@kbn/server-route-repository", "scope": "server", @@ -4534,17 +4620,17 @@ "section": "def-server.ServerRoute", "text": "ServerRoute" }, - "<\"GET /internal/apm/backends/{backendName}/upstream_services\", ", + "<\"GET /internal/apm/backends/upstream_services\", ", "IntersectionC", "<[", "TypeC", - "<{ path: ", + "<{ query: ", + "IntersectionC", + "<[", "TypeC", "<{ backendName: ", "StringC", - "; }>; query: ", - "IntersectionC", - "<[", + "; }>, ", "TypeC", "<{ start: ", "Type", @@ -4608,7 +4694,7 @@ "Node", "; }[]; }, ", "APMRouteCreateOptions", - ">; } & { \"GET /internal/apm/backends/{backendName}/metadata\": ", + ">; } & { \"GET /internal/apm/backends/metadata\": ", { "pluginId": "@kbn/server-route-repository", "scope": "server", @@ -4616,19 +4702,21 @@ "section": "def-server.ServerRoute", "text": "ServerRoute" }, - "<\"GET /internal/apm/backends/{backendName}/metadata\", ", + "<\"GET /internal/apm/backends/metadata\", ", "TypeC", - "<{ path: ", + "<{ query: ", + "IntersectionC", + "<[", "TypeC", "<{ backendName: ", "StringC", - "; }>; query: ", + "; }>, ", "TypeC", "<{ start: ", "Type", "; end: ", "Type", - "; }>; }>, ", + "; }>]>; }>, ", { "pluginId": "apm", "scope": "server", @@ -4638,7 +4726,7 @@ }, ", { metadata: { spanType: string | undefined; spanSubtype: string | undefined; }; }, ", "APMRouteCreateOptions", - ">; } & { \"GET /internal/apm/backends/{backendName}/charts/latency\": ", + ">; } & { \"GET /internal/apm/backends/charts/latency\": ", { "pluginId": "@kbn/server-route-repository", "scope": "server", @@ -4646,15 +4734,15 @@ "section": "def-server.ServerRoute", "text": "ServerRoute" }, - "<\"GET /internal/apm/backends/{backendName}/charts/latency\", ", + "<\"GET /internal/apm/backends/charts/latency\", ", "TypeC", - "<{ path: ", + "<{ query: ", + "IntersectionC", + "<[", "TypeC", "<{ backendName: ", "StringC", - "; }>; query: ", - "IntersectionC", - "<[", + "; }>, ", "TypeC", "<{ start: ", "Type", @@ -4692,7 +4780,7 @@ }, ", { currentTimeseries: { x: number; y: number; }[]; comparisonTimeseries: { x: number; y: number; }[] | null; }, ", "APMRouteCreateOptions", - ">; } & { \"GET /internal/apm/backends/{backendName}/charts/throughput\": ", + ">; } & { \"GET /internal/apm/backends/charts/throughput\": ", { "pluginId": "@kbn/server-route-repository", "scope": "server", @@ -4700,15 +4788,15 @@ "section": "def-server.ServerRoute", "text": "ServerRoute" }, - "<\"GET /internal/apm/backends/{backendName}/charts/throughput\", ", + "<\"GET /internal/apm/backends/charts/throughput\", ", "TypeC", - "<{ path: ", + "<{ query: ", + "IntersectionC", + "<[", "TypeC", "<{ backendName: ", "StringC", - "; }>; query: ", - "IntersectionC", - "<[", + "; }>, ", "TypeC", "<{ start: ", "Type", @@ -4746,7 +4834,7 @@ }, ", { currentTimeseries: { x: number; y: number | null; }[]; comparisonTimeseries: { x: number; y: number | null; }[] | null; }, ", "APMRouteCreateOptions", - ">; } & { \"GET /internal/apm/backends/{backendName}/charts/error_rate\": ", + ">; } & { \"GET /internal/apm/backends/charts/error_rate\": ", { "pluginId": "@kbn/server-route-repository", "scope": "server", @@ -4754,15 +4842,15 @@ "section": "def-server.ServerRoute", "text": "ServerRoute" }, - "<\"GET /internal/apm/backends/{backendName}/charts/error_rate\", ", + "<\"GET /internal/apm/backends/charts/error_rate\", ", "TypeC", - "<{ path: ", + "<{ query: ", + "IntersectionC", + "<[", "TypeC", "<{ backendName: ", "StringC", - "; }>; query: ", - "IntersectionC", - "<[", + "; }>, ", "TypeC", "<{ start: ", "Type", @@ -4800,6 +4888,316 @@ }, ", { currentTimeseries: { x: number; y: number; }[]; comparisonTimeseries: { x: number; y: number; }[] | null; }, ", "APMRouteCreateOptions", + ">; } & { \"POST /internal/apm/correlations/p_values\": ", + { + "pluginId": "@kbn/server-route-repository", + "scope": "server", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-server.ServerRoute", + "text": "ServerRoute" + }, + "<\"POST /internal/apm/correlations/p_values\", ", + "TypeC", + "<{ body: ", + "IntersectionC", + "<[", + "PartialC", + "<{ serviceName: ", + "StringC", + "; transactionName: ", + "StringC", + "; transactionType: ", + "StringC", + "; }>, ", + "TypeC", + "<{ environment: ", + "UnionC", + "<[", + "LiteralC", + "<\"ENVIRONMENT_NOT_DEFINED\">, ", + "LiteralC", + "<\"ENVIRONMENT_ALL\">, ", + "BrandC", + "<", + "StringC", + ", ", + "NonEmptyStringBrand", + ">]>; }>, ", + "TypeC", + "<{ kuery: ", + "StringC", + "; }>, ", + "TypeC", + "<{ start: ", + "Type", + "; end: ", + "Type", + "; }>, ", + "TypeC", + "<{ fieldCandidates: ", + "ArrayC", + "<", + "StringC", + ">; }>]>; }>, ", + { + "pluginId": "apm", + "scope": "server", + "docId": "kibApmPluginApi", + "section": "def-server.APMRouteHandlerResources", + "text": "APMRouteHandlerResources" + }, + ", { failedTransactionsCorrelations: ", + "FailedTransactionsCorrelation", + "[]; ccsWarning: boolean; }, ", + "APMRouteCreateOptions", + ">; } & { \"GET /internal/apm/correlations/field_candidates\": ", + { + "pluginId": "@kbn/server-route-repository", + "scope": "server", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-server.ServerRoute", + "text": "ServerRoute" + }, + "<\"GET /internal/apm/correlations/field_candidates\", ", + "TypeC", + "<{ query: ", + "IntersectionC", + "<[", + "PartialC", + "<{ serviceName: ", + "StringC", + "; transactionName: ", + "StringC", + "; transactionType: ", + "StringC", + "; }>, ", + "TypeC", + "<{ environment: ", + "UnionC", + "<[", + "LiteralC", + "<\"ENVIRONMENT_NOT_DEFINED\">, ", + "LiteralC", + "<\"ENVIRONMENT_ALL\">, ", + "BrandC", + "<", + "StringC", + ", ", + "NonEmptyStringBrand", + ">]>; }>, ", + "TypeC", + "<{ kuery: ", + "StringC", + "; }>, ", + "TypeC", + "<{ start: ", + "Type", + "; end: ", + "Type", + "; }>]>; }>, ", + { + "pluginId": "apm", + "scope": "server", + "docId": "kibApmPluginApi", + "section": "def-server.APMRouteHandlerResources", + "text": "APMRouteHandlerResources" + }, + ", { fieldCandidates: string[]; }, ", + "APMRouteCreateOptions", + ">; } & { \"POST /internal/apm/correlations/field_stats\": ", + { + "pluginId": "@kbn/server-route-repository", + "scope": "server", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-server.ServerRoute", + "text": "ServerRoute" + }, + "<\"POST /internal/apm/correlations/field_stats\", ", + "TypeC", + "<{ body: ", + "IntersectionC", + "<[", + "PartialC", + "<{ serviceName: ", + "StringC", + "; transactionName: ", + "StringC", + "; transactionType: ", + "StringC", + "; }>, ", + "TypeC", + "<{ environment: ", + "UnionC", + "<[", + "LiteralC", + "<\"ENVIRONMENT_NOT_DEFINED\">, ", + "LiteralC", + "<\"ENVIRONMENT_ALL\">, ", + "BrandC", + "<", + "StringC", + ", ", + "NonEmptyStringBrand", + ">]>; }>, ", + "TypeC", + "<{ kuery: ", + "StringC", + "; }>, ", + "TypeC", + "<{ start: ", + "Type", + "; end: ", + "Type", + "; }>, ", + "TypeC", + "<{ fieldsToSample: ", + "ArrayC", + "<", + "StringC", + ">; }>]>; }>, ", + { + "pluginId": "apm", + "scope": "server", + "docId": "kibApmPluginApi", + "section": "def-server.APMRouteHandlerResources", + "text": "APMRouteHandlerResources" + }, + ", { stats: ", + "FieldStats", + "[]; errors: any[]; }, ", + "APMRouteCreateOptions", + ">; } & { \"POST /internal/apm/correlations/field_value_pairs\": ", + { + "pluginId": "@kbn/server-route-repository", + "scope": "server", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-server.ServerRoute", + "text": "ServerRoute" + }, + "<\"POST /internal/apm/correlations/field_value_pairs\", ", + "TypeC", + "<{ body: ", + "IntersectionC", + "<[", + "PartialC", + "<{ serviceName: ", + "StringC", + "; transactionName: ", + "StringC", + "; transactionType: ", + "StringC", + "; }>, ", + "TypeC", + "<{ environment: ", + "UnionC", + "<[", + "LiteralC", + "<\"ENVIRONMENT_NOT_DEFINED\">, ", + "LiteralC", + "<\"ENVIRONMENT_ALL\">, ", + "BrandC", + "<", + "StringC", + ", ", + "NonEmptyStringBrand", + ">]>; }>, ", + "TypeC", + "<{ kuery: ", + "StringC", + "; }>, ", + "TypeC", + "<{ start: ", + "Type", + "; end: ", + "Type", + "; }>, ", + "TypeC", + "<{ fieldCandidates: ", + "ArrayC", + "<", + "StringC", + ">; }>]>; }>, ", + { + "pluginId": "apm", + "scope": "server", + "docId": "kibApmPluginApi", + "section": "def-server.APMRouteHandlerResources", + "text": "APMRouteHandlerResources" + }, + ", { fieldValuePairs: ", + "FieldValuePair", + "[]; errors: any[]; }, ", + "APMRouteCreateOptions", + ">; } & { \"POST /internal/apm/correlations/significant_correlations\": ", + { + "pluginId": "@kbn/server-route-repository", + "scope": "server", + "docId": "kibKbnServerRouteRepositoryPluginApi", + "section": "def-server.ServerRoute", + "text": "ServerRoute" + }, + "<\"POST /internal/apm/correlations/significant_correlations\", ", + "TypeC", + "<{ body: ", + "IntersectionC", + "<[", + "PartialC", + "<{ serviceName: ", + "StringC", + "; transactionName: ", + "StringC", + "; transactionType: ", + "StringC", + "; }>, ", + "TypeC", + "<{ environment: ", + "UnionC", + "<[", + "LiteralC", + "<\"ENVIRONMENT_NOT_DEFINED\">, ", + "LiteralC", + "<\"ENVIRONMENT_ALL\">, ", + "BrandC", + "<", + "StringC", + ", ", + "NonEmptyStringBrand", + ">]>; }>, ", + "TypeC", + "<{ kuery: ", + "StringC", + "; }>, ", + "TypeC", + "<{ start: ", + "Type", + "; end: ", + "Type", + "; }>, ", + "TypeC", + "<{ fieldValuePairs: ", + "ArrayC", + "<", + "TypeC", + "<{ fieldName: ", + "StringC", + "; fieldValue: ", + "UnionC", + "<[", + "StringC", + ", ", + "Type", + "]>; }>>; }>]>; }>, ", + { + "pluginId": "apm", + "scope": "server", + "docId": "kibApmPluginApi", + "section": "def-server.APMRouteHandlerResources", + "text": "APMRouteHandlerResources" + }, + ", { latencyCorrelations: ", + "LatencyCorrelation", + "[]; ccsWarning: boolean; totalDocCount: number; }, ", + "APMRouteCreateOptions", ">; } & { \"GET /internal/apm/fallback_to_transactions\": ", { "pluginId": "@kbn/server-route-repository", @@ -4923,7 +5321,7 @@ "description": [], "signature": [ "Observable", - "; serviceMapEnabled: boolean; serviceMapFingerprintBucketSize: number; serviceMapTraceIdBucketSize: number; serviceMapFingerprintGlobalBucketSize: number; serviceMapTraceIdGlobalBucketSize: number; serviceMapMaxTracesPerRequest: number; autocreateApmIndexPattern: boolean; ui: Readonly<{} & { enabled: boolean; transactionGroupBucketSize: number; maxTraceItems: number; }>; searchAggregatedTransactions: ", + "; serviceMapEnabled: boolean; serviceMapFingerprintBucketSize: number; serviceMapTraceIdBucketSize: number; serviceMapFingerprintGlobalBucketSize: number; serviceMapTraceIdGlobalBucketSize: number; serviceMapMaxTracesPerRequest: number; autocreateApmIndexPattern: boolean; ui: Readonly<{} & { enabled: boolean; transactionGroupBucketSize: number; maxTraceItems: number; }>; searchAggregatedTransactions: ", "SearchAggregatedTransactionSetting", "; telemetryCollectionEnabled: boolean; metricsInterval: number; profilingEnabled: boolean; agent: Readonly<{} & { migrations: Readonly<{} & { enabled: boolean; }>; }>; }>>" ], diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/ClientMetrics/Metrics.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/ClientMetrics/Metrics.tsx index 3a9100a0712aa..ded242e2ce558 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/ClientMetrics/Metrics.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/ClientMetrics/Metrics.tsx @@ -55,7 +55,7 @@ export function Metrics() { (callApmApi) => { if (uxQuery) { return callApmApi({ - endpoint: 'GET /api/apm/rum/client-metrics', + endpoint: 'GET /internal/apm/ux/client-metrics', params: { query: { ...uxQuery, diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/ImpactfulMetrics/JSErrors.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/ImpactfulMetrics/JSErrors.tsx index b8bdc36ed4e0d..7f481d1c14dc2 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/ImpactfulMetrics/JSErrors.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/ImpactfulMetrics/JSErrors.tsx @@ -41,7 +41,7 @@ export function JSErrors() { (callApmApi) => { if (start && end && serviceName) { return callApmApi({ - endpoint: 'GET /api/apm/rum-client/js-errors', + endpoint: 'GET /internal/apm/ux/js-errors', params: { query: { start, diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/PageLoadDistribution/index.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/PageLoadDistribution/index.tsx index f75d0fd093b5a..6798fbe90e4de 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/PageLoadDistribution/index.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/PageLoadDistribution/index.tsx @@ -51,7 +51,7 @@ export function PageLoadDistribution() { (callApmApi) => { if (start && end && serviceName) { return callApmApi({ - endpoint: 'GET /api/apm/rum-client/page-load-distribution', + endpoint: 'GET /internal/apm/ux/page-load-distribution', params: { query: { start, diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/PageLoadDistribution/use_breakdowns.ts b/x-pack/plugins/apm/public/components/app/RumDashboard/PageLoadDistribution/use_breakdowns.ts index 0cfa293c87844..ee3acac73211f 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/PageLoadDistribution/use_breakdowns.ts +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/PageLoadDistribution/use_breakdowns.ts @@ -24,7 +24,7 @@ export const useBreakdowns = ({ percentileRange, field, value }: Props) => { (callApmApi) => { if (start && end && field && value) { return callApmApi({ - endpoint: 'GET /api/apm/rum-client/page-load-distribution/breakdown', + endpoint: 'GET /internal/apm/ux/page-load-distribution/breakdown', params: { query: { start, diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/PageViewsTrend/index.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/PageViewsTrend/index.tsx index 581260f5931e7..16605a83505ff 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/PageViewsTrend/index.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/PageViewsTrend/index.tsx @@ -39,7 +39,7 @@ export function PageViewsTrend() { (callApmApi) => { if (start && end && serviceName) { return callApmApi({ - endpoint: 'GET /api/apm/rum-client/page-view-trends', + endpoint: 'GET /internal/apm/ux/page-view-trends', params: { query: { start, diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/Panels/WebApplicationSelect.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/Panels/WebApplicationSelect.tsx index 5b1cca0ec44fa..ecba89b2651ac 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/Panels/WebApplicationSelect.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/Panels/WebApplicationSelect.tsx @@ -20,7 +20,7 @@ export function WebApplicationSelect() { (callApmApi) => { if (start && end) { return callApmApi({ - endpoint: 'GET /api/apm/rum-client/services', + endpoint: 'GET /internal/apm/ux/services', params: { query: { start, diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/URLFilter/URLSearch/use_url_search.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/URLFilter/URLSearch/use_url_search.tsx index 7b6b093c70367..8228ab4c6e83e 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/URLFilter/URLSearch/use_url_search.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/URLFilter/URLSearch/use_url_search.tsx @@ -38,7 +38,7 @@ export const useUrlSearch = ({ popoverIsOpen, query }: Props) => { (callApmApi) => { if (uxQuery && popoverIsOpen) { return callApmApi({ - endpoint: 'GET /api/apm/rum-client/url-search', + endpoint: 'GET /internal/apm/ux/url-search', params: { query: { ...uxQuery, diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/UXMetrics/KeyUXMetrics.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/UXMetrics/KeyUXMetrics.tsx index b8766e8b5ce67..4eaf0dccc3225 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/UXMetrics/KeyUXMetrics.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/UXMetrics/KeyUXMetrics.tsx @@ -56,7 +56,7 @@ export function KeyUXMetrics({ data, loading }: Props) { (callApmApi) => { if (uxQuery) { return callApmApi({ - endpoint: 'GET /api/apm/rum-client/long-task-metrics', + endpoint: 'GET /internal/apm/ux/long-task-metrics', params: { query: { ...uxQuery, diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/UXMetrics/index.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/UXMetrics/index.tsx index 673f045ecfb97..ab6843f94ee43 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/UXMetrics/index.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/UXMetrics/index.tsx @@ -34,7 +34,7 @@ export function UXMetrics() { (callApmApi) => { if (uxQuery) { return callApmApi({ - endpoint: 'GET /api/apm/rum-client/web-core-vitals', + endpoint: 'GET /internal/apm/ux/web-core-vitals', params: { query: uxQuery, }, diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdown/index.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdown/index.tsx index f044890a9b649..7a19690a4582e 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdown/index.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/VisitorBreakdown/index.tsx @@ -23,7 +23,7 @@ export function VisitorBreakdown() { if (start && end && serviceName) { return callApmApi({ - endpoint: 'GET /api/apm/rum-client/visitor-breakdown', + endpoint: 'GET /internal/apm/ux/visitor-breakdown', params: { query: { start, diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/ux_overview_fetchers.ts b/x-pack/plugins/apm/public/components/app/RumDashboard/ux_overview_fetchers.ts index 34dd2d53daf8e..61310a5c5ad2c 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/ux_overview_fetchers.ts +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/ux_overview_fetchers.ts @@ -21,7 +21,7 @@ export const fetchUxOverviewDate = async ({ serviceName, }: FetchDataParams): Promise => { const data = await callApmApi({ - endpoint: 'GET /api/apm/rum-client/web-core-vitals', + endpoint: 'GET /internal/apm/ux/web-core-vitals', signal: null, params: { query: { diff --git a/x-pack/plugins/apm/server/routes/rum_client.ts b/x-pack/plugins/apm/server/routes/rum_client.ts index c465e0e02da1c..49974bdfb045e 100644 --- a/x-pack/plugins/apm/server/routes/rum_client.ts +++ b/x-pack/plugins/apm/server/routes/rum_client.ts @@ -65,7 +65,7 @@ const uxQueryRt = t.intersection([ ]); const rumClientMetricsRoute = createApmServerRoute({ - endpoint: 'GET /api/apm/rum/client-metrics', + endpoint: 'GET /internal/apm/ux/client-metrics', params: t.type({ query: uxQueryRt, }), @@ -88,7 +88,7 @@ const rumClientMetricsRoute = createApmServerRoute({ }); const rumPageLoadDistributionRoute = createApmServerRoute({ - endpoint: 'GET /api/apm/rum-client/page-load-distribution', + endpoint: 'GET /internal/apm/ux/page-load-distribution', params: t.type({ query: t.intersection([uxQueryRt, percentileRangeRt]), }), @@ -114,7 +114,7 @@ const rumPageLoadDistributionRoute = createApmServerRoute({ }); const rumPageLoadDistBreakdownRoute = createApmServerRoute({ - endpoint: 'GET /api/apm/rum-client/page-load-distribution/breakdown', + endpoint: 'GET /internal/apm/ux/page-load-distribution/breakdown', params: t.type({ query: t.intersection([ uxQueryRt, @@ -145,7 +145,7 @@ const rumPageLoadDistBreakdownRoute = createApmServerRoute({ }); const rumPageViewsTrendRoute = createApmServerRoute({ - endpoint: 'GET /api/apm/rum-client/page-view-trends', + endpoint: 'GET /internal/apm/ux/page-view-trends', params: t.type({ query: t.intersection([uxQueryRt, t.partial({ breakdowns: t.string })]), }), @@ -168,7 +168,7 @@ const rumPageViewsTrendRoute = createApmServerRoute({ }); const rumServicesRoute = createApmServerRoute({ - endpoint: 'GET /api/apm/rum-client/services', + endpoint: 'GET /internal/apm/ux/services', params: t.type({ query: t.intersection([uiFiltersRt, rangeRt]), }), @@ -184,7 +184,7 @@ const rumServicesRoute = createApmServerRoute({ }); const rumVisitorsBreakdownRoute = createApmServerRoute({ - endpoint: 'GET /api/apm/rum-client/visitor-breakdown', + endpoint: 'GET /internal/apm/ux/visitor-breakdown', params: t.type({ query: uxQueryRt, }), @@ -206,7 +206,7 @@ const rumVisitorsBreakdownRoute = createApmServerRoute({ }); const rumWebCoreVitals = createApmServerRoute({ - endpoint: 'GET /api/apm/rum-client/web-core-vitals', + endpoint: 'GET /internal/apm/ux/web-core-vitals', params: t.type({ query: uxQueryRt, }), @@ -229,7 +229,7 @@ const rumWebCoreVitals = createApmServerRoute({ }); const rumLongTaskMetrics = createApmServerRoute({ - endpoint: 'GET /api/apm/rum-client/long-task-metrics', + endpoint: 'GET /internal/apm/ux/long-task-metrics', params: t.type({ query: uxQueryRt, }), @@ -252,7 +252,7 @@ const rumLongTaskMetrics = createApmServerRoute({ }); const rumUrlSearch = createApmServerRoute({ - endpoint: 'GET /api/apm/rum-client/url-search', + endpoint: 'GET /internal/apm/ux/url-search', params: t.type({ query: uxQueryRt, }), @@ -275,7 +275,7 @@ const rumUrlSearch = createApmServerRoute({ }); const rumJSErrors = createApmServerRoute({ - endpoint: 'GET /api/apm/rum-client/js-errors', + endpoint: 'GET /internal/apm/ux/js-errors', params: t.type({ query: t.intersection([ uiFiltersRt, diff --git a/x-pack/plugins/uptime/common/constants/rest_api.ts b/x-pack/plugins/uptime/common/constants/rest_api.ts index 52b0620586eb4..26b2c7aad20ac 100644 --- a/x-pack/plugins/uptime/common/constants/rest_api.ts +++ b/x-pack/plugins/uptime/common/constants/rest_api.ts @@ -6,16 +6,23 @@ */ export enum API_URLS { - INDEX_STATUS = '/api/uptime/index_status', - MONITOR_LIST = `/api/uptime/monitor/list`, - MONITOR_LOCATIONS = `/api/uptime/monitor/locations`, - MONITOR_DURATION = `/api/uptime/monitor/duration`, - MONITOR_DETAILS = `/api/uptime/monitor/details`, - MONITOR_STATUS = `/api/uptime/monitor/status`, - PINGS = '/api/uptime/pings', - PING_HISTOGRAM = `/api/uptime/ping/histogram`, - SNAPSHOT_COUNT = `/api/uptime/snapshot/count`, - LOG_PAGE_VIEW = `/api/uptime/log_page_view`, + DYNAMIC_SETTINGS = `/internal/uptime/dynamic_settings`, + INDEX_STATUS = '/internal/uptime/index_status', + MONITOR_LIST = `/internal/uptime/monitor/list`, + MONITOR_LOCATIONS = `/internal/uptime/monitor/locations`, + MONITOR_DURATION = `/internal/uptime/monitor/duration`, + MONITOR_DETAILS = `/internal/uptime/monitor/details`, + MONITOR_STATUS = `/internal/uptime/monitor/status`, + NETWORK_EVENTS = `/internal/uptime/network_events`, + PINGS = '/internal/uptime/pings', + PING_HISTOGRAM = `/internal/uptime/ping/histogram`, + SNAPSHOT_COUNT = `/internal/uptime/snapshot/count`, + SYNTHETICS_SUCCESSFUL_STEP = `/internal/uptime/synthetics/step/success`, + JOURNEY_CREATE = `/internal/uptime/journey/{checkGroup}`, + JOURNEY_FAILED_STEPS = `/internal/uptime/journeys/failed_steps`, + JOURNEY_SCREENSHOT = `/internal/uptime/journey/screenshot/{checkGroup}/{stepIndex}`, + JOURNEY_SCREENSHOT_BLOCKS = `/internal/uptime/journey/screenshot/block`, + LOG_PAGE_VIEW = `/internal/uptime/log_page_view`, ML_MODULE_JOBS = `/api/ml/modules/jobs_exist/`, ML_SETUP_MODULE = '/api/ml/modules/setup/', diff --git a/x-pack/plugins/uptime/public/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.tsx b/x-pack/plugins/uptime/public/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.tsx index 425f35b067026..ed7fb34b92f07 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.tsx @@ -48,7 +48,7 @@ export const PingTimestamp = ({ label, checkGroup, initialStepNo = 1 }: Props) = const { basePath } = useContext(UptimeSettingsContext); - const imgPath = `${basePath}/api/uptime/journey/screenshot/${checkGroup}/${stepNumber}`; + const imgPath = `${basePath}/internal/uptime/journey/screenshot/${checkGroup}/${stepNumber}`; const intersection = useIntersection(intersectionRef, { root: null, diff --git a/x-pack/plugins/uptime/public/components/synthetics/step_screenshot_display.tsx b/x-pack/plugins/uptime/public/components/synthetics/step_screenshot_display.tsx index c20445cf72c38..2a83fc3115ce3 100644 --- a/x-pack/plugins/uptime/public/components/synthetics/step_screenshot_display.tsx +++ b/x-pack/plugins/uptime/public/components/synthetics/step_screenshot_display.tsx @@ -123,7 +123,7 @@ export const StepScreenshotDisplay: FC = ({ } }, [hasIntersected, isIntersecting, setHasIntersected]); - const imgSrc = basePath + `/api/uptime/journey/screenshot/${checkGroup}/${stepIndex}`; + const imgSrc = basePath + `/internal/uptime/journey/screenshot/${checkGroup}/${stepIndex}`; // When loading a legacy screenshot, set `url` to full-size screenshot path. // Otherwise, we first need to composite the image. diff --git a/x-pack/plugins/uptime/public/state/api/dynamic_settings.ts b/x-pack/plugins/uptime/public/state/api/dynamic_settings.ts index 3aa300e69e3fe..a7bacfbba3462 100644 --- a/x-pack/plugins/uptime/public/state/api/dynamic_settings.ts +++ b/x-pack/plugins/uptime/public/state/api/dynamic_settings.ts @@ -12,8 +12,9 @@ import { DynamicSettingsSaveType, } from '../../../common/runtime_types'; import { apiService } from './utils'; +import { API_URLS } from '../../../common/constants'; -const apiPath = '/api/uptime/dynamic_settings'; +const apiPath = API_URLS.DYNAMIC_SETTINGS; interface SaveApiRequest { settings: DynamicSettings; diff --git a/x-pack/plugins/uptime/public/state/api/journey.ts b/x-pack/plugins/uptime/public/state/api/journey.ts index e73ed903d5734..fb23b1bd9ea65 100644 --- a/x-pack/plugins/uptime/public/state/api/journey.ts +++ b/x-pack/plugins/uptime/public/state/api/journey.ts @@ -18,16 +18,17 @@ import { SyntheticsJourneyApiResponse, SyntheticsJourneyApiResponseType, } from '../../../common/runtime_types/ping/synthetics'; +import { API_URLS } from '../../../common/constants'; export async function fetchScreenshotBlockSet(params: string[]): Promise { - return apiService.post('/api/uptime/journey/screenshot/block', { hashes: params }); + return apiService.post(API_URLS.JOURNEY_SCREENSHOT_BLOCKS, { hashes: params }); } export async function fetchJourneySteps( params: FetchJourneyStepsParams ): Promise { return apiService.get( - `/api/uptime/journey/${params.checkGroup}`, + `/internal/uptime/journey/${params.checkGroup}`, { syntheticEventTypes: params.syntheticEventTypes }, SyntheticsJourneyApiResponseType ); @@ -38,11 +39,7 @@ export async function fetchJourneysFailedSteps({ }: { checkGroups: string[]; }): Promise { - return apiService.get( - `/api/uptime/journeys/failed_steps`, - { checkGroups }, - FailedStepsApiResponseType - ); + return apiService.get(API_URLS.JOURNEY_FAILED_STEPS, { checkGroups }, FailedStepsApiResponseType); } export async function fetchLastSuccessfulStep({ @@ -57,7 +54,7 @@ export async function fetchLastSuccessfulStep({ location?: string; }): Promise { return await apiService.get( - `/api/uptime/synthetics/step/success/`, + API_URLS.SYNTHETICS_SUCCESSFUL_STEP, { monitorId, timestamp, diff --git a/x-pack/plugins/uptime/public/state/api/network_events.ts b/x-pack/plugins/uptime/public/state/api/network_events.ts index ea3bb6e5183e4..d9b3d518444a3 100644 --- a/x-pack/plugins/uptime/public/state/api/network_events.ts +++ b/x-pack/plugins/uptime/public/state/api/network_events.ts @@ -11,12 +11,13 @@ import { SyntheticsNetworkEventsApiResponse, SyntheticsNetworkEventsApiResponseType, } from '../../../common/runtime_types'; +import { API_URLS } from '../../../common/constants'; export async function fetchNetworkEvents( params: FetchNetworkEventsParams ): Promise { return (await apiService.get( - `/api/uptime/network_events`, + API_URLS.NETWORK_EVENTS, { checkGroup: params.checkGroup, stepIndex: params.stepIndex, diff --git a/x-pack/plugins/uptime/public/state/api/snapshot.test.ts b/x-pack/plugins/uptime/public/state/api/snapshot.test.ts index 38be97d74844f..01177eceb4720 100644 --- a/x-pack/plugins/uptime/public/state/api/snapshot.test.ts +++ b/x-pack/plugins/uptime/public/state/api/snapshot.test.ts @@ -8,6 +8,7 @@ import { HttpFetchError } from 'src/core/public'; import { fetchSnapshotCount } from './snapshot'; import { apiService } from './utils'; +import { API_URLS } from '../../../common/constants'; describe('snapshot API', () => { let fetchMock: jest.SpyInstance>; @@ -36,7 +37,7 @@ describe('snapshot API', () => { }); expect(fetchMock).toHaveBeenCalledWith({ asResponse: false, - path: '/api/uptime/snapshot/count', + path: API_URLS.SNAPSHOT_COUNT, query: { dateRangeEnd: 'now', dateRangeStart: 'now-15m', diff --git a/x-pack/plugins/uptime/server/rest_api/dynamic_settings.ts b/x-pack/plugins/uptime/server/rest_api/dynamic_settings.ts index 637ac72e12ee5..5d9947e23cf44 100644 --- a/x-pack/plugins/uptime/server/rest_api/dynamic_settings.ts +++ b/x-pack/plugins/uptime/server/rest_api/dynamic_settings.ts @@ -16,10 +16,11 @@ import { VALUE_MUST_BE_GREATER_THAN_ZERO, VALUE_MUST_BE_AN_INTEGER, } from '../../common/translations'; +import { API_URLS } from '../../common/constants'; export const createGetDynamicSettingsRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', - path: '/api/uptime/dynamic_settings', + path: API_URLS.DYNAMIC_SETTINGS, validate: false, handler: async ({ savedObjectsClient }): Promise => { return savedObjectsAdapter.getUptimeDynamicSettings(savedObjectsClient); @@ -47,7 +48,7 @@ export const validateCertsValues = ( export const createPostDynamicSettingsRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'POST', - path: '/api/uptime/dynamic_settings', + path: API_URLS.DYNAMIC_SETTINGS, validate: { body: schema.object({ heartbeatIndices: schema.string(), diff --git a/x-pack/plugins/uptime/server/rest_api/network_events/get_network_events.ts b/x-pack/plugins/uptime/server/rest_api/network_events/get_network_events.ts index 21ca946e574d1..0afe21413d4fb 100644 --- a/x-pack/plugins/uptime/server/rest_api/network_events/get_network_events.ts +++ b/x-pack/plugins/uptime/server/rest_api/network_events/get_network_events.ts @@ -8,10 +8,11 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; +import { API_URLS } from '../../../common/constants'; export const createNetworkEventsRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', - path: '/api/uptime/network_events', + path: API_URLS.NETWORK_EVENTS, validate: { query: schema.object({ checkGroup: schema.string(), diff --git a/x-pack/plugins/uptime/server/rest_api/pings/journey_screenshot_blocks.ts b/x-pack/plugins/uptime/server/rest_api/pings/journey_screenshot_blocks.ts index 4b06a13d29f4e..95c30b5f73689 100644 --- a/x-pack/plugins/uptime/server/rest_api/pings/journey_screenshot_blocks.ts +++ b/x-pack/plugins/uptime/server/rest_api/pings/journey_screenshot_blocks.ts @@ -10,6 +10,7 @@ import { isRight } from 'fp-ts/lib/Either'; import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; +import { API_URLS } from '../../../common/constants'; function isStringArray(data: unknown): data is string[] { return isRight(t.array(t.string).decode(data)); @@ -17,7 +18,7 @@ function isStringArray(data: unknown): data is string[] { export const createJourneyScreenshotBlocksRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'POST', - path: '/api/uptime/journey/screenshot/block', + path: API_URLS.JOURNEY_SCREENSHOT_BLOCKS, validate: { body: schema.object({ hashes: schema.arrayOf(schema.string()), diff --git a/x-pack/plugins/uptime/server/rest_api/pings/journey_screenshots.ts b/x-pack/plugins/uptime/server/rest_api/pings/journey_screenshots.ts index 3e71051816d30..146460295f444 100644 --- a/x-pack/plugins/uptime/server/rest_api/pings/journey_screenshots.ts +++ b/x-pack/plugins/uptime/server/rest_api/pings/journey_screenshots.ts @@ -10,6 +10,7 @@ import { isRefResult, isFullScreenshot } from '../../../common/runtime_types/pin import { UMServerLibs } from '../../lib/lib'; import { ScreenshotReturnTypesUnion } from '../../lib/requests/get_journey_screenshot'; import { UMRestApiRouteFactory } from '../types'; +import { API_URLS } from '../../../common/constants'; function getSharedHeaders(stepName: string, totalSteps: number) { return { @@ -21,7 +22,7 @@ function getSharedHeaders(stepName: string, totalSteps: number) { export const createJourneyScreenshotRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', - path: '/api/uptime/journey/screenshot/{checkGroup}/{stepIndex}', + path: API_URLS.JOURNEY_SCREENSHOT, validate: { params: schema.object({ checkGroup: schema.string(), diff --git a/x-pack/plugins/uptime/server/rest_api/pings/journeys.ts b/x-pack/plugins/uptime/server/rest_api/pings/journeys.ts index 7c3dcdfbe845c..bfc5a52e3e01f 100644 --- a/x-pack/plugins/uptime/server/rest_api/pings/journeys.ts +++ b/x-pack/plugins/uptime/server/rest_api/pings/journeys.ts @@ -8,10 +8,11 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; +import { API_URLS } from '../../../common/constants'; export const createJourneyRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', - path: '/api/uptime/journey/{checkGroup}', + path: API_URLS.JOURNEY_CREATE, validate: { params: schema.object({ checkGroup: schema.string(), @@ -54,7 +55,7 @@ export const createJourneyRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => export const createJourneyFailedStepsRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', - path: '/api/uptime/journeys/failed_steps', + path: API_URLS.JOURNEY_FAILED_STEPS, validate: { query: schema.object({ checkGroups: schema.arrayOf(schema.string()), diff --git a/x-pack/plugins/uptime/server/rest_api/synthetics/last_successful_step.ts b/x-pack/plugins/uptime/server/rest_api/synthetics/last_successful_step.ts index 81539459172cc..99695bbce09a0 100644 --- a/x-pack/plugins/uptime/server/rest_api/synthetics/last_successful_step.ts +++ b/x-pack/plugins/uptime/server/rest_api/synthetics/last_successful_step.ts @@ -13,10 +13,11 @@ import { } from '../../../common/runtime_types/ping/synthetics'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; +import { API_URLS } from '../../../common/constants'; export const createLastSuccessfulStepRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', - path: '/api/uptime/synthetics/step/success/', + path: API_URLS.SYNTHETICS_SUCCESSFUL_STEP, validate: { query: schema.object({ monitorId: schema.string(), diff --git a/x-pack/test/api_integration/apis/uptime/get_all_pings.ts b/x-pack/test/api_integration/apis/uptime/get_all_pings.ts index cf52d72823095..2658afd0d90d2 100644 --- a/x-pack/test/api_integration/apis/uptime/get_all_pings.ts +++ b/x-pack/test/api_integration/apis/uptime/get_all_pings.ts @@ -9,6 +9,7 @@ import moment from 'moment'; import expect from '@kbn/expect'; import { PINGS_DATE_RANGE_START, PINGS_DATE_RANGE_END } from './constants'; import { FtrProviderContext } from '../../ftr_provider_context'; +import { API_URLS } from '../../../../plugins/uptime/common/constants'; export default function ({ getService }: FtrProviderContext) { const supertest = getService('supertest'); @@ -22,9 +23,12 @@ export default function ({ getService }: FtrProviderContext) { it('should get all pings stored in index', async () => { const { body: apiResponse } = await supertest - .get( - `/api/uptime/pings?sort=desc&from=${PINGS_DATE_RANGE_START}&to=${PINGS_DATE_RANGE_END}` - ) + .get(API_URLS.PINGS) + .query({ + sort: 'desc', + from: PINGS_DATE_RANGE_START, + to: PINGS_DATE_RANGE_END, + }) .expect(200); expect(apiResponse.total).to.be(2); @@ -34,7 +38,12 @@ export default function ({ getService }: FtrProviderContext) { it('should sort pings according to timestamp', async () => { const { body: apiResponse } = await supertest - .get(`/api/uptime/pings?sort=asc&from=${PINGS_DATE_RANGE_START}&to=${PINGS_DATE_RANGE_END}`) + .get(API_URLS.PINGS) + .query({ + sort: 'asc', + from: PINGS_DATE_RANGE_START, + to: PINGS_DATE_RANGE_END, + }) .expect(200); expect(apiResponse.total).to.be(2); @@ -45,9 +54,13 @@ export default function ({ getService }: FtrProviderContext) { it('should return results of n length', async () => { const { body: apiResponse } = await supertest - .get( - `/api/uptime/pings?sort=desc&size=1&from=${PINGS_DATE_RANGE_START}&to=${PINGS_DATE_RANGE_END}` - ) + .get(API_URLS.PINGS) + .query({ + sort: 'desc', + size: 1, + from: PINGS_DATE_RANGE_START, + to: PINGS_DATE_RANGE_END, + }) .expect(200); expect(apiResponse.total).to.be(2); @@ -59,7 +72,8 @@ export default function ({ getService }: FtrProviderContext) { const from = moment('2002-01-01').valueOf(); const to = moment('2002-01-02').valueOf(); const { body: apiResponse } = await supertest - .get(`/api/uptime/pings?from=${from}&to=${to}`) + .get(API_URLS.PINGS) + .query({ from, to }) .expect(200); expect(apiResponse.total).to.be(0); diff --git a/x-pack/test/api_integration/apis/uptime/rest/dynamic_settings.ts b/x-pack/test/api_integration/apis/uptime/rest/dynamic_settings.ts index d5cf2078e377b..84e01ecef63d6 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/dynamic_settings.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/dynamic_settings.ts @@ -12,13 +12,16 @@ import { DynamicSettingsType, DynamicSettings, } from '../../../../../plugins/uptime/common/runtime_types'; -import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../../plugins/uptime/common/constants'; +import { + DYNAMIC_SETTINGS_DEFAULTS, + API_URLS, +} from '../../../../../plugins/uptime/common/constants'; export default function ({ getService }: FtrProviderContext) { const supertest = getService('supertest'); describe('dynamic settings', () => { it('returns the defaults when no user settings have been saved', async () => { - const apiResponse = await supertest.get(`/api/uptime/dynamic_settings`); + const apiResponse = await supertest.get(API_URLS.DYNAMIC_SETTINGS); expect(apiResponse.body).to.eql(DYNAMIC_SETTINGS_DEFAULTS); expect(isRight(DynamicSettingsType.decode(apiResponse.body))).to.be.ok(); }); @@ -31,14 +34,14 @@ export default function ({ getService }: FtrProviderContext) { defaultConnectors: [], }; const postResponse = await supertest - .post(`/api/uptime/dynamic_settings`) + .post(API_URLS.DYNAMIC_SETTINGS) .set('kbn-xsrf', 'true') .send(newSettings); expect(postResponse.body).to.eql({ success: true }); expect(postResponse.status).to.eql(200); - const getResponse = await supertest.get(`/api/uptime/dynamic_settings`); + const getResponse = await supertest.get(API_URLS.DYNAMIC_SETTINGS); expect(getResponse.body).to.eql(newSettings); expect(isRight(DynamicSettingsType.decode(getResponse.body))).to.be.ok(); }); diff --git a/x-pack/test/api_integration/apis/uptime/rest/filters.ts b/x-pack/test/api_integration/apis/uptime/rest/filters.ts deleted file mode 100644 index 5603d142cdb61..0000000000000 --- a/x-pack/test/api_integration/apis/uptime/rest/filters.ts +++ /dev/null @@ -1,28 +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 - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { expectFixtureEql } from './helper/expect_fixture_eql'; -import { FtrProviderContext } from '../../../ftr_provider_context'; - -const getApiPath = (dateRangeStart: string, dateRangeEnd: string, filters?: string) => - `/api/uptime/filters?dateRangeStart=${dateRangeStart}&dateRangeEnd=${dateRangeEnd}${ - filters ? `&filters=${filters}` : '' - }`; - -export default function ({ getService }: FtrProviderContext) { - const supertest = getService('supertest'); - - describe('filter group endpoint', () => { - const dateRangeStart = '2019-01-28T17:40:08.078Z'; - const dateRangeEnd = '2025-01-28T19:00:16.078Z'; - - it('returns expected filters', async () => { - const resp = await supertest.get(getApiPath(dateRangeStart, dateRangeEnd)); - expectFixtureEql(resp.body, 'filters'); - }); - }); -} diff --git a/x-pack/test/api_integration/apis/uptime/rest/monitor_duration.ts b/x-pack/test/api_integration/apis/uptime/rest/monitor_duration.ts index 92c5174c7263d..4fa0837e2e812 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/monitor_duration.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/monitor_duration.ts @@ -7,6 +7,7 @@ import { expectFixtureEql } from './helper/expect_fixture_eql'; import { FtrProviderContext } from '../../../ftr_provider_context'; +import { API_URLS } from '../../../../../plugins/uptime/common/constants'; export default function ({ getService }: FtrProviderContext) { describe('monitor duration query', () => { @@ -18,9 +19,11 @@ export default function ({ getService }: FtrProviderContext) { const monitorId = '0002-up'; - const apiResponse = await supertest.get( - `/api/uptime/monitor/duration?monitorId=${monitorId}&dateStart=${dateStart}&dateEnd=${dateEnd}` - ); + const apiResponse = await supertest.get(API_URLS.MONITOR_DURATION).query({ + monitorId, + dateStart, + dateEnd, + }); const data = apiResponse.body; expectFixtureEql(data, 'monitor_charts'); }); @@ -31,9 +34,11 @@ export default function ({ getService }: FtrProviderContext) { const monitorId = '0002-up'; - const apiResponse = await supertest.get( - `/api/uptime/monitor/duration?monitorId=${monitorId}&dateStart=${dateStart}&dateEnd=${dateEnd}` - ); + const apiResponse = await supertest.get(API_URLS.MONITOR_DURATION).query({ + monitorId, + dateStart, + dateEnd, + }); const data = apiResponse.body; expectFixtureEql(data, 'monitor_charts_empty_sets'); diff --git a/x-pack/test/api_integration/apis/uptime/rest/monitor_latest_status.ts b/x-pack/test/api_integration/apis/uptime/rest/monitor_latest_status.ts index 69b1bd0324ee6..036d3ad856f57 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/monitor_latest_status.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/monitor_latest_status.ts @@ -7,6 +7,7 @@ import { expectFixtureEql } from './helper/expect_fixture_eql'; import { FtrProviderContext } from '../../../ftr_provider_context'; +import { API_URLS } from '../../../../../plugins/uptime/common/constants'; export default function ({ getService }: FtrProviderContext) { describe('get monitor latest status API', () => { @@ -17,9 +18,11 @@ export default function ({ getService }: FtrProviderContext) { const supertest = getService('supertest'); it('returns the status for only the given monitor', async () => { - const apiResponse = await supertest.get( - `/api/uptime/monitor/status?monitorId=${monitorId}&dateStart=${dateStart}&dateEnd=${dateEnd}` - ); + const apiResponse = await supertest.get(API_URLS.MONITOR_STATUS).query({ + monitorId, + dateStart, + dateEnd, + }); expectFixtureEql(apiResponse.body, 'monitor_latest_status'); }); }); diff --git a/x-pack/test/api_integration/apis/uptime/rest/ping_histogram.ts b/x-pack/test/api_integration/apis/uptime/rest/ping_histogram.ts index 0d69b083d8f23..fcc0873be9a76 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/ping_histogram.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/ping_histogram.ts @@ -7,6 +7,7 @@ import { expectFixtureEql } from './helper/expect_fixture_eql'; import { FtrProviderContext } from '../../../ftr_provider_context'; +import { API_URLS } from '../../../../../plugins/uptime/common/constants'; export default function ({ getService }: FtrProviderContext) { describe('pingHistogram', () => { @@ -16,9 +17,10 @@ export default function ({ getService }: FtrProviderContext) { const dateStart = '2019-09-11T03:31:04.380Z'; const dateEnd = '2019-09-11T03:40:34.410Z'; - const apiResponse = await supertest.get( - `/api/uptime/ping/histogram?dateStart=${dateStart}&dateEnd=${dateEnd}` - ); + const apiResponse = await supertest.get(API_URLS.PING_HISTOGRAM).query({ + dateStart, + dateEnd, + }); const data = apiResponse.body; expectFixtureEql(data, 'ping_histogram'); @@ -29,9 +31,11 @@ export default function ({ getService }: FtrProviderContext) { const dateEnd = '2019-09-11T03:40:34.410Z'; const monitorId = '0002-up'; - const apiResponse = await supertest.get( - `/api/uptime/ping/histogram?monitorId=${monitorId}&dateStart=${dateStart}&dateEnd=${dateEnd}` - ); + const apiResponse = await supertest.get(API_URLS.PING_HISTOGRAM).query({ + monitorId, + dateStart, + dateEnd, + }); const data = apiResponse.body; expectFixtureEql(data, 'ping_histogram_by_id'); @@ -43,9 +47,11 @@ export default function ({ getService }: FtrProviderContext) { const filters = '{"bool":{"must":[{"match":{"monitor.status":{"query":"up","operator":"and"}}}]}}'; - const apiResponse = await supertest.get( - `/api/uptime/ping/histogram?dateStart=${dateStart}&dateEnd=${dateEnd}&filters=${filters}` - ); + const apiResponse = await supertest.get(API_URLS.PING_HISTOGRAM).query({ + dateStart, + dateEnd, + filters, + }); const data = apiResponse.body; expectFixtureEql(data, 'ping_histogram_by_filter'); diff --git a/x-pack/test/api_integration/apis/uptime/rest/ping_list.ts b/x-pack/test/api_integration/apis/uptime/rest/ping_list.ts index 860aae81703f4..7a0367728eed7 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/ping_list.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/ping_list.ts @@ -10,6 +10,7 @@ import { isLeft } from 'fp-ts/lib/Either'; import { PathReporter } from 'io-ts/lib/PathReporter'; import { PingsResponseType } from '../../../../../plugins/uptime/common/runtime_types'; import { FtrProviderContext } from '../../../ftr_provider_context'; +import { API_URLS } from '../../../../../plugins/uptime/common/constants'; function decodePingsResponseData(response: any) { const decoded = PingsResponseType.decode(response); @@ -33,7 +34,11 @@ export default function ({ getService }: FtrProviderContext) { const from = '2019-01-28T17:40:08.078Z'; const to = '2025-01-28T19:00:16.078Z'; - const apiResponse = await supertest.get(`/api/uptime/pings?from=${from}&to=${to}&size=10`); + const apiResponse = await supertest.get(API_URLS.PINGS).query({ + from, + to, + size: 10, + }); const { total, pings } = decodePingsResponseData(apiResponse.body); @@ -58,9 +63,11 @@ export default function ({ getService }: FtrProviderContext) { const to = '2025-01-28T19:00:16.078Z'; const size = 50; - const apiResponse = await supertest.get( - `/api/uptime/pings?from=${from}&to=${to}&size=${size}` - ); + const apiResponse = await supertest.get(API_URLS.PINGS).query({ + from, + to, + size, + }); const { total, pings } = decodePingsResponseData(apiResponse.body); @@ -126,9 +133,12 @@ export default function ({ getService }: FtrProviderContext) { const monitorId = '0001-up'; const size = 15; - const apiResponse = await supertest.get( - `/api/uptime/pings?from=${from}&to=${to}&monitorId=${monitorId}&size=${size}` - ); + const apiResponse = await supertest.get(API_URLS.PINGS).query({ + from, + to, + monitorId, + size, + }); const { total, pings } = decodePingsResponseData(apiResponse.body); @@ -160,9 +170,13 @@ export default function ({ getService }: FtrProviderContext) { const size = 5; const sort = 'asc'; - const apiResponse = await supertest.get( - `/api/uptime/pings?from=${from}&to=${to}&monitorId=${monitorId}&size=${size}&sort=${sort}` - ); + const apiResponse = await supertest.get(API_URLS.PINGS).query({ + from, + to, + monitorId, + size, + sort, + }); const { total, pings } = decodePingsResponseData(apiResponse.body); diff --git a/x-pack/test/api_integration/apis/uptime/rest/snapshot.ts b/x-pack/test/api_integration/apis/uptime/rest/snapshot.ts index 59393f7a4acf1..e7f604116e305 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/snapshot.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/snapshot.ts @@ -8,6 +8,7 @@ import { expectFixtureEql } from './helper/expect_fixture_eql'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { makeChecksWithStatus, getChecksDateRange } from './helper/make_checks'; +import { API_URLS } from '../../../../../plugins/uptime/common/constants'; export default function ({ getService }: FtrProviderContext) { const supertest = getService('supertest'); @@ -18,9 +19,10 @@ export default function ({ getService }: FtrProviderContext) { describe('when no data is present', async () => { it('returns a null snapshot', async () => { - const apiResponse = await supertest.get( - `/api/uptime/snapshot/count?dateRangeStart=${dateRangeStart}&dateRangeEnd=${dateRangeEnd}` - ); + const apiResponse = await supertest.get(API_URLS.SNAPSHOT_COUNT).query({ + dateRangeStart, + dateRangeEnd, + }); expectFixtureEql(apiResponse.body, 'snapshot_empty'); }); @@ -75,9 +77,10 @@ export default function ({ getService }: FtrProviderContext) { }); it('will count all statuses correctly', async () => { - const apiResponse = await supertest.get( - `/api/uptime/snapshot/count?dateRangeStart=${dateRange.start}&dateRangeEnd=${dateRange.end}` - ); + const apiResponse = await supertest.get(API_URLS.SNAPSHOT_COUNT).query({ + dateRangeStart: dateRange.start, + dateRangeEnd: dateRange.end, + }); expectFixtureEql(apiResponse.body, 'snapshot'); }); diff --git a/x-pack/test/apm_api_integration/tests/csm/csm_services.spec.ts b/x-pack/test/apm_api_integration/tests/csm/csm_services.spec.ts index 2d5f0ddf1cd4c..657e2485e1c21 100644 --- a/x-pack/test/apm_api_integration/tests/csm/csm_services.spec.ts +++ b/x-pack/test/apm_api_integration/tests/csm/csm_services.spec.ts @@ -14,9 +14,11 @@ export default function rumServicesApiTests({ getService }: FtrProviderContext) registry.when('CSM Services without data', { config: 'trial', archives: [] }, () => { it('returns empty list', async () => { - const response = await supertest.get( - '/api/apm/rum-client/services?start=2020-06-28T10%3A24%3A46.055Z&end=2020-07-29T10%3A24%3A46.055Z&uiFilters=%7B%22agentName%22%3A%5B%22js-base%22%2C%22rum-js%22%5D%7D' - ); + const response = await supertest.get('/internal/apm/ux/services').query({ + start: '2020-06-28T10:24:46.055Z', + end: '2020-07-29T10:24:46.055Z', + uiFilters: '{"agentName":["js-base","rum-js"]}', + }); expect(response.status).to.be(200); expect(response.body.rumServices).to.eql([]); @@ -28,9 +30,11 @@ export default function rumServicesApiTests({ getService }: FtrProviderContext) { config: 'trial', archives: ['8.0.0', 'rum_8.0.0'] }, () => { it('returns rum services list', async () => { - const response = await supertest.get( - '/api/apm/rum-client/services?start=2020-06-28T10%3A24%3A46.055Z&end=2020-07-29T10%3A24%3A46.055Z&uiFilters=%7B%22agentName%22%3A%5B%22js-base%22%2C%22rum-js%22%5D%7D' - ); + const response = await supertest.get('/internal/apm/ux/services').query({ + start: '2020-06-28T10:24:46.055Z', + end: '2020-07-29T10:24:46.055Z', + uiFilters: '{"agentName":["js-base","rum-js"]}', + }); expect(response.status).to.be(200); diff --git a/x-pack/test/apm_api_integration/tests/csm/js_errors.spec.ts b/x-pack/test/apm_api_integration/tests/csm/js_errors.spec.ts index 5e4f306552273..b23f365348328 100644 --- a/x-pack/test/apm_api_integration/tests/csm/js_errors.spec.ts +++ b/x-pack/test/apm_api_integration/tests/csm/js_errors.spec.ts @@ -14,9 +14,13 @@ export default function rumJsErrorsApiTests({ getService }: FtrProviderContext) registry.when('CSM JS errors with data', { config: 'trial', archives: [] }, () => { it('returns no js errors', async () => { - const response = await supertest.get( - '/api/apm/rum-client/js-errors?pageSize=5&pageIndex=0&start=2020-09-07T20%3A35%3A54.654Z&end=2020-09-14T20%3A35%3A54.654Z&uiFilters=%7B%22serviceName%22%3A%5B%22elastic-co-rum-test%22%5D%7D' - ); + const response = await supertest.get('/internal/apm/ux/js-errors').query({ + pageSize: 5, + pageIndex: 0, + start: '2020-09-07T20:35:54.654Z', + end: '2020-09-14T20:35:54.654Z', + uiFilters: '{"serviceName":["elastic-co-rum-test"]}', + }); expect(response.status).to.be(200); expectSnapshot(response.body).toMatchInline(` @@ -34,9 +38,13 @@ export default function rumJsErrorsApiTests({ getService }: FtrProviderContext) { config: 'trial', archives: ['8.0.0', 'rum_test_data'] }, () => { it('returns js errors', async () => { - const response = await supertest.get( - '/api/apm/rum-client/js-errors?start=2021-01-18T12%3A20%3A17.202Z&end=2021-01-18T12%3A25%3A17.203Z&uiFilters=%7B%22environment%22%3A%22ENVIRONMENT_ALL%22%2C%22serviceName%22%3A%5B%22elastic-co-frontend%22%5D%7D&pageSize=5&pageIndex=0' - ); + const response = await supertest.get('/internal/apm/ux/js-errors').query({ + start: '2021-01-18T12:20:17.202Z', + end: '2021-01-18T12:25:17.203Z', + uiFilters: '{"environment":"ENVIRONMENT_ALL","serviceName":["elastic-co-frontend"]}', + pageSize: 5, + pageIndex: 0, + }); expect(response.status).to.be(200); diff --git a/x-pack/test/apm_api_integration/tests/csm/long_task_metrics.spec.ts b/x-pack/test/apm_api_integration/tests/csm/long_task_metrics.spec.ts index ef1e537585b79..756d10bc4558d 100644 --- a/x-pack/test/apm_api_integration/tests/csm/long_task_metrics.spec.ts +++ b/x-pack/test/apm_api_integration/tests/csm/long_task_metrics.spec.ts @@ -14,9 +14,11 @@ export default function rumServicesApiTests({ getService }: FtrProviderContext) registry.when('CSM long task metrics without data', { config: 'trial', archives: [] }, () => { it('returns empty list', async () => { - const response = await supertest.get( - '/api/apm/rum-client/long-task-metrics?start=2020-09-07T20%3A35%3A54.654Z&end=2020-09-14T20%3A35%3A54.654Z&uiFilters=%7B%22serviceName%22%3A%5B%22elastic-co-rum-test%22%5D%7D' - ); + const response = await supertest.get('/internal/apm/ux/long-task-metrics').query({ + start: '2020-09-07T20:35:54.654Z', + end: '2020-09-14T20:35:54.654Z', + uiFilters: '{"serviceName":["elastic-co-rum-test"]}', + }); expect(response.status).to.be(200); expect(response.body).to.eql({ @@ -32,9 +34,11 @@ export default function rumServicesApiTests({ getService }: FtrProviderContext) { config: 'trial', archives: ['8.0.0', 'rum_8.0.0'] }, () => { it('returns web core vitals values', async () => { - const response = await supertest.get( - '/api/apm/rum-client/long-task-metrics?start=2020-09-07T20%3A35%3A54.654Z&end=2020-09-16T20%3A35%3A54.654Z&uiFilters=%7B%22serviceName%22%3A%5B%22kibana-frontend-8_0_0%22%5D%7D' - ); + const response = await supertest.get('/internal/apm/ux/long-task-metrics').query({ + start: '2020-09-07T20:35:54.654Z', + end: '2020-09-16T20:35:54.654Z', + uiFilters: '{"serviceName":["kibana-frontend-8_0_0"]}', + }); expect(response.status).to.be(200); diff --git a/x-pack/test/apm_api_integration/tests/csm/page_load_dist.spec.ts b/x-pack/test/apm_api_integration/tests/csm/page_load_dist.spec.ts index 1177b331c4c35..fd75a5cef33a2 100644 --- a/x-pack/test/apm_api_integration/tests/csm/page_load_dist.spec.ts +++ b/x-pack/test/apm_api_integration/tests/csm/page_load_dist.spec.ts @@ -14,18 +14,25 @@ export default function rumServicesApiTests({ getService }: FtrProviderContext) registry.when('UX page load dist without data', { config: 'trial', archives: [] }, () => { it('returns empty list', async () => { - const response = await supertest.get( - '/api/apm/rum-client/page-load-distribution?start=2020-09-07T20%3A35%3A54.654Z&end=2020-09-14T20%3A35%3A54.654Z&uiFilters=%7B%22serviceName%22%3A%5B%22elastic-co-rum-test%22%5D%7D' - ); + const response = await supertest.get('/internal/apm/ux/page-load-distribution').query({ + start: '2020-09-07T20:35:54.654Z', + end: '2020-09-14T20:35:54.654Z', + uiFilters: '{"serviceName":["elastic-co-rum-test"]}', + }); expect(response.status).to.be(200); expectSnapshot(response.body).toMatch(); }); it('returns empty list with breakdowns', async () => { - const response = await supertest.get( - '/api/apm/rum-client/page-load-distribution/breakdown?start=2020-09-07T20%3A35%3A54.654Z&end=2020-09-14T20%3A35%3A54.654Z&uiFilters=%7B%22serviceName%22%3A%5B%22elastic-co-rum-test%22%5D%7D&breakdown=Browser' - ); + const response = await supertest + .get('/internal/apm/ux/page-load-distribution/breakdown') + .query({ + start: '2020-09-07T20:35:54.654Z', + end: '2020-09-14T20:35:54.654Z', + uiFilters: '{"serviceName":["elastic-co-rum-test"]}', + breakdown: 'Browser', + }); expect(response.status).to.be(200); expectSnapshot(response.body).toMatch(); @@ -37,18 +44,25 @@ export default function rumServicesApiTests({ getService }: FtrProviderContext) { config: 'trial', archives: ['8.0.0', 'rum_8.0.0'] }, () => { it('returns page load distribution', async () => { - const response = await supertest.get( - '/api/apm/rum-client/page-load-distribution?start=2020-09-07T20%3A35%3A54.654Z&end=2020-09-16T20%3A35%3A54.654Z&uiFilters=%7B%22serviceName%22%3A%5B%22kibana-frontend-8_0_0%22%5D%7D' - ); + const response = await supertest.get('/internal/apm/ux/page-load-distribution').query({ + start: '2020-09-07T20:35:54.654Z', + end: '2020-09-16T20:35:54.654Z', + uiFilters: '{"serviceName":["kibana-frontend-8_0_0"]}', + }); expect(response.status).to.be(200); expectSnapshot(response.body).toMatch(); }); it('returns page load distribution with breakdown', async () => { - const response = await supertest.get( - '/api/apm/rum-client/page-load-distribution/breakdown?start=2020-09-07T20%3A35%3A54.654Z&end=2020-09-16T20%3A35%3A54.654Z&uiFilters=%7B%22serviceName%22%3A%5B%22kibana-frontend-8_0_0%22%5D%7D&breakdown=Browser' - ); + const response = await supertest + .get('/internal/apm/ux/page-load-distribution/breakdown') + .query({ + start: '2020-09-07T20:35:54.654Z', + end: '2020-09-16T20:35:54.654Z', + uiFilters: '{"serviceName":["kibana-frontend-8_0_0"]}', + breakdown: 'Browser', + }); expect(response.status).to.be(200); diff --git a/x-pack/test/apm_api_integration/tests/csm/page_views.spec.ts b/x-pack/test/apm_api_integration/tests/csm/page_views.spec.ts index 40aa88aa5ad82..f699fc9f8a3b1 100644 --- a/x-pack/test/apm_api_integration/tests/csm/page_views.spec.ts +++ b/x-pack/test/apm_api_integration/tests/csm/page_views.spec.ts @@ -14,18 +14,23 @@ export default function rumServicesApiTests({ getService }: FtrProviderContext) registry.when('CSM page views without data', { config: 'trial', archives: [] }, () => { it('returns empty list', async () => { - const response = await supertest.get( - '/api/apm/rum-client/page-view-trends?start=2020-09-07T20%3A35%3A54.654Z&end=2020-09-14T20%3A35%3A54.654Z&uiFilters=%7B%22serviceName%22%3A%5B%22elastic-co-rum-test%22%5D%7D' - ); + const response = await supertest.get('/internal/apm/ux/page-view-trends').query({ + start: '2020-09-07T20:35:54.654Z', + end: '2020-09-14T20:35:54.654Z', + uiFilters: '{"serviceName":["elastic-co-rum-test"]}', + }); expect(response.status).to.be(200); expectSnapshot(response.body).toMatch(); }); it('returns empty list with breakdowns', async () => { - const response = await supertest.get( - '/api/apm/rum-client/page-view-trends?start=2020-09-07T20%3A35%3A54.654Z&end=2020-09-14T20%3A35%3A54.654Z&uiFilters=%7B%22serviceName%22%3A%5B%22elastic-co-rum-test%22%5D%7D&breakdowns=%7B%22name%22%3A%22Browser%22%2C%22fieldName%22%3A%22user_agent.name%22%2C%22type%22%3A%22category%22%7D' - ); + const response = await supertest.get('/internal/apm/ux/page-view-trends').query({ + start: '2020-09-07T20:35:54.654Z', + end: '2020-09-14T20:35:54.654Z', + uiFilters: '{"serviceName":["elastic-co-rum-test"]}', + breakdowns: '{"name":"Browser","fieldName":"user_agent.name","type":"category"}', + }); expect(response.status).to.be(200); expectSnapshot(response.body).toMatch(); @@ -37,18 +42,23 @@ export default function rumServicesApiTests({ getService }: FtrProviderContext) { config: 'trial', archives: ['8.0.0', 'rum_8.0.0'] }, () => { it('returns page views', async () => { - const response = await supertest.get( - '/api/apm/rum-client/page-view-trends?start=2020-09-07T20%3A35%3A54.654Z&end=2020-09-16T20%3A35%3A54.654Z&uiFilters=%7B%22serviceName%22%3A%5B%22kibana-frontend-8_0_0%22%5D%7D' - ); + const response = await supertest.get('/internal/apm/ux/page-view-trends').query({ + start: '2020-09-07T20:35:54.654Z', + end: '2020-09-16T20:35:54.654Z', + uiFilters: '{"serviceName":["kibana-frontend-8_0_0"]}', + }); expect(response.status).to.be(200); expectSnapshot(response.body).toMatch(); }); it('returns page views with breakdown', async () => { - const response = await supertest.get( - '/api/apm/rum-client/page-view-trends?start=2020-09-07T20%3A35%3A54.654Z&end=2020-09-16T20%3A35%3A54.654Z&uiFilters=%7B%22serviceName%22%3A%5B%22kibana-frontend-8_0_0%22%5D%7D&breakdowns=%7B%22name%22%3A%22Browser%22%2C%22fieldName%22%3A%22user_agent.name%22%2C%22type%22%3A%22category%22%7D' - ); + const response = await supertest.get('/internal/apm/ux/page-view-trends').query({ + start: '2020-09-07T20:35:54.654Z', + end: '2020-09-16T20:35:54.654Z', + uiFilters: '{"serviceName":["kibana-frontend-8_0_0"]}', + breakdowns: '{"name":"Browser","fieldName":"user_agent.name","type":"category"}', + }); expect(response.status).to.be(200); diff --git a/x-pack/test/apm_api_integration/tests/csm/url_search.spec.ts b/x-pack/test/apm_api_integration/tests/csm/url_search.spec.ts index f45e82865983e..89e56face9343 100644 --- a/x-pack/test/apm_api_integration/tests/csm/url_search.spec.ts +++ b/x-pack/test/apm_api_integration/tests/csm/url_search.spec.ts @@ -14,9 +14,12 @@ export default function rumServicesApiTests({ getService }: FtrProviderContext) registry.when('CSM url search api without data', { config: 'trial', archives: [] }, () => { it('returns empty list', async () => { - const response = await supertest.get( - '/api/apm/rum-client/url-search?start=2020-09-07T20%3A35%3A54.654Z&end=2020-09-14T20%3A35%3A54.654Z&uiFilters=%7B%22serviceName%22%3A%5B%22elastic-co-rum-test%22%5D%7D&percentile=50' - ); + const response = await supertest.get('/internal/apm/ux/url-search').query({ + start: '2020-09-07T20:35:54.654Z', + end: '2020-09-14T20:35:54.654Z', + uiFilters: '{"serviceName":["elastic-co-rum-test"]}', + percentile: 50, + }); expect(response.status).to.be(200); expectSnapshot(response.body).toMatchInline(` @@ -33,9 +36,12 @@ export default function rumServicesApiTests({ getService }: FtrProviderContext) { config: 'trial', archives: ['8.0.0', 'rum_8.0.0'] }, () => { it('returns top urls when no query', async () => { - const response = await supertest.get( - '/api/apm/rum-client/url-search?start=2020-09-07T20%3A35%3A54.654Z&end=2020-09-16T20%3A35%3A54.654Z&uiFilters=%7B%22serviceName%22%3A%5B%22kibana-frontend-8_0_0%22%5D%7D&percentile=50' - ); + const response = await supertest.get('/internal/apm/ux/url-search').query({ + start: '2020-09-07T20:35:54.654Z', + end: '2020-09-16T20:35:54.654Z', + uiFilters: '{"serviceName":["kibana-frontend-8_0_0"]}', + percentile: 50, + }); expect(response.status).to.be(200); @@ -59,9 +65,13 @@ export default function rumServicesApiTests({ getService }: FtrProviderContext) }); it('returns specific results against query', async () => { - const response = await supertest.get( - '/api/apm/rum-client/url-search?start=2020-09-07T20%3A35%3A54.654Z&end=2020-09-16T20%3A35%3A54.654Z&uiFilters=%7B%22serviceName%22%3A%5B%22kibana-frontend-8_0_0%22%5D%7D&urlQuery=csm&percentile=50' - ); + const response = await supertest.get('/internal/apm/ux/url-search').query({ + start: '2020-09-07T20:35:54.654Z', + end: '2020-09-16T20:35:54.654Z', + uiFilters: '{"serviceName":["kibana-frontend-8_0_0"]}', + urlQuery: 'csm', + percentile: 50, + }); expect(response.status).to.be(200); diff --git a/x-pack/test/apm_api_integration/tests/csm/web_core_vitals.spec.ts b/x-pack/test/apm_api_integration/tests/csm/web_core_vitals.spec.ts index 421bafcb4064f..882e9e23a4314 100644 --- a/x-pack/test/apm_api_integration/tests/csm/web_core_vitals.spec.ts +++ b/x-pack/test/apm_api_integration/tests/csm/web_core_vitals.spec.ts @@ -14,9 +14,12 @@ export default function rumServicesApiTests({ getService }: FtrProviderContext) registry.when('CSM web core vitals without data', { config: 'trial', archives: [] }, () => { it('returns empty list', async () => { - const response = await supertest.get( - '/api/apm/rum-client/web-core-vitals?start=2020-09-07T20%3A35%3A54.654Z&end=2020-09-14T20%3A35%3A54.654Z&uiFilters=%7B%22serviceName%22%3A%5B%22elastic-co-rum-test%22%5D%7D&percentile=50' - ); + const response = await supertest.get('/internal/apm/ux/web-core-vitals').query({ + start: '2020-09-07T20:35:54.654Z', + end: '2020-09-14T20:35:54.654Z', + uiFilters: '{"serviceName":["elastic-co-rum-test"]}', + percentile: 50, + }); expect(response.status).to.be(200); expect(response.body).to.eql({ @@ -35,9 +38,12 @@ export default function rumServicesApiTests({ getService }: FtrProviderContext) { config: 'trial', archives: ['8.0.0', 'rum_8.0.0'] }, () => { it('returns web core vitals values', async () => { - const response = await supertest.get( - '/api/apm/rum-client/web-core-vitals?start=2020-09-07T20%3A35%3A54.654Z&end=2020-09-16T20%3A35%3A54.654Z&uiFilters=%7B%22serviceName%22%3A%5B%22kibana-frontend-8_0_0%22%5D%7D&percentile=50' - ); + const response = await supertest.get('/internal/apm/ux/web-core-vitals').query({ + start: '2020-09-07T20:35:54.654Z', + end: '2020-09-16T20:35:54.654Z', + uiFilters: '{"serviceName":["kibana-frontend-8_0_0"]}', + percentile: 50, + }); expect(response.status).to.be(200);