Relocate internal APM API endpoints to /internal (#114196) (#114494)

All endpoints except annotations, source maps, and agent configuration are now at /internal/apm instead of /api/apm.

None of the UX endpoints have been updated, only APM.

If you search for "/api/apm" in the codebase, you should only see the above endpoints.

Fixes #113383.
# Conflicts:
#	x-pack/plugins/apm/public/components/shared/MetadataTable/ErrorMetadata/index.tsx
#	x-pack/plugins/apm/public/components/shared/MetadataTable/SpanMetadata/index.tsx
#	x-pack/plugins/apm/public/components/shared/MetadataTable/TransactionMetadata/index.tsx
#	x-pack/plugins/apm/server/routes/event_metadata.ts
#	x-pack/test/apm_api_integration/tests/metadata/event_metadata.ts
#	x-pack/test/apm_api_integration/tests/services/throughput.ts
This commit is contained in:
Nathan L Smith 2021-10-11 11:12:32 -05:00 committed by GitHub
parent 50908d8542
commit f6e4f1b225
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
160 changed files with 452 additions and 423 deletions

View file

@ -46,4 +46,4 @@ This will create:
All APM api endpoints accept `_inspect=true` as a query param that will output all Elasticsearch queries performed in that request. It will be available in the browser response and on localhost it is also available in the Kibana Node.js process output.
Example:
`/api/apm/services/my_service?_inspect=true`
`/internal/apm/services/my_service?_inspect=true`

View file

@ -6,7 +6,7 @@
*/
/* eslint-disable @typescript-eslint/naming-convention */
const apmIndicesSaveURL = '/api/apm/settings/apm-indices/save';
const apmIndicesSaveURL = '/internal/apm/settings/apm-indices/save';
describe('No data screen', () => {
describe('bypass no data screen on settings pages', () => {

View file

@ -17,11 +17,11 @@ const serviceInventoryHref = url.format({
const apisToIntercept = [
{
endpoint: '/api/apm/service?*',
endpoint: '/internal/apm/service?*',
name: 'servicesMainStatistics',
},
{
endpoint: '/api/apm/services/detailed_statistics?*',
endpoint: '/internal/apm/services/detailed_statistics?*',
name: 'servicesDetailedStatistics',
},
];

View file

@ -16,43 +16,47 @@ const serviceOverviewHref = url.format({
const apisToIntercept = [
{
endpoint: '/api/apm/services/opbeans-node/transactions/charts/latency?*',
endpoint:
'/internal/apm/services/opbeans-node/transactions/charts/latency?*',
name: 'latencyChartRequest',
},
{
endpoint: '/api/apm/services/opbeans-node/throughput?*',
endpoint: '/internal/apm/services/opbeans-node/throughput?*',
name: 'throughputChartRequest',
},
{
endpoint: '/api/apm/services/opbeans-node/transactions/charts/error_rate?*',
endpoint:
'/internal/apm/services/opbeans-node/transactions/charts/error_rate?*',
name: 'errorRateChartRequest',
},
{
endpoint:
'/api/apm/services/opbeans-node/transactions/groups/detailed_statistics?*',
'/internal/apm/services/opbeans-node/transactions/groups/detailed_statistics?*',
name: 'transactionGroupsDetailedRequest',
},
{
endpoint:
'/api/apm/services/opbeans-node/service_overview_instances/detailed_statistics?*',
'/internal/apm/services/opbeans-node/service_overview_instances/detailed_statistics?*',
name: 'instancesDetailedRequest',
},
{
endpoint:
'/api/apm/services/opbeans-node/service_overview_instances/main_statistics?*',
'/internal/apm/services/opbeans-node/service_overview_instances/main_statistics?*',
name: 'instancesMainStatisticsRequest',
},
{
endpoint: '/api/apm/services/opbeans-node/error_groups/main_statistics?*',
endpoint:
'/internal/apm/services/opbeans-node/error_groups/main_statistics?*',
name: 'errorGroupsMainStatisticsRequest',
},
{
endpoint: '/api/apm/services/opbeans-node/transaction/charts/breakdown?*',
endpoint:
'/internal/apm/services/opbeans-node/transaction/charts/breakdown?*',
name: 'transactonBreakdownRequest',
},
{
endpoint:
'/api/apm/services/opbeans-node/transactions/groups/main_statistics?*',
'/internal/apm/services/opbeans-node/transactions/groups/main_statistics?*',
name: 'transactionsGroupsMainStatisticsRequest',
},
];

View file

@ -18,17 +18,17 @@ const serviceOverviewHref = url.format({
const apisToIntercept = [
{
endpoint:
'/api/apm/services/opbeans-java/service_overview_instances/main_statistics?*',
'/internal/apm/services/opbeans-java/service_overview_instances/main_statistics?*',
name: 'instancesMainRequest',
},
{
endpoint:
'/api/apm/services/opbeans-java/service_overview_instances/detailed_statistics?*',
'/internal/apm/services/opbeans-java/service_overview_instances/detailed_statistics?*',
name: 'instancesDetailsRequest',
},
{
endpoint:
'/api/apm/services/opbeans-java/service_overview_instances/details/31651f3c624b81c55dd4633df0b5b9f9ab06b151121b0404ae796632cd1f87ad?*',
'/internal/apm/services/opbeans-java/service_overview_instances/details/31651f3c624b81c55dd4633df0b5b9f9ab06b151121b0404ae796632cd1f87ad?*',
name: 'instanceDetailsRequest',
},
];

View file

@ -59,7 +59,7 @@ describe('Service Overview', () => {
});
it('hides dependency tab when RUM service', () => {
cy.intercept('GET', '/api/apm/services/opbeans-rum/agent?*').as(
cy.intercept('GET', '/internal/apm/services/opbeans-rum/agent?*').as(
'agentRequest'
);
cy.visit(

View file

@ -18,30 +18,32 @@ const serviceOverviewHref = url.format({
const apisToIntercept = [
{
endpoint: '/api/apm/services/opbeans-java/transactions/charts/latency?*',
endpoint:
'/internal/apm/services/opbeans-java/transactions/charts/latency?*',
name: 'latencyChartRequest',
},
{
endpoint: '/api/apm/services/opbeans-java/throughput?*',
endpoint: '/internal/apm/services/opbeans-java/throughput?*',
name: 'throughputChartRequest',
},
{
endpoint: '/api/apm/services/opbeans-java/transactions/charts/error_rate?*',
endpoint:
'/internal/apm/services/opbeans-java/transactions/charts/error_rate?*',
name: 'errorRateChartRequest',
},
{
endpoint:
'/api/apm/services/opbeans-java/transactions/groups/detailed_statistics?*',
'/internal/apm/services/opbeans-java/transactions/groups/detailed_statistics?*',
name: 'transactionGroupsDetailedRequest',
},
{
endpoint:
'/api/apm/services/opbeans-java/error_groups/detailed_statistics?*',
'/internal/apm/services/opbeans-java/error_groups/detailed_statistics?*',
name: 'errorGroupsDetailedRequest',
},
{
endpoint:
'/api/apm/services/opbeans-java/service_overview_instances/detailed_statistics?*',
'/internal/apm/services/opbeans-java/service_overview_instances/detailed_statistics?*',
name: 'instancesDetailedRequest',
},
];

View file

@ -61,7 +61,8 @@ export function ErrorCountAlertTrigger(props: Props) {
});
if (interval && start && end) {
return callApmApi({
endpoint: 'GET /api/apm/alerts/chart_preview/transaction_error_count',
endpoint:
'GET /internal/apm/alerts/chart_preview/transaction_error_count',
params: {
query: {
environment: params.environment,

View file

@ -99,7 +99,8 @@ export function TransactionDurationAlertTrigger(props: Props) {
});
if (interval && start && end) {
return callApmApi({
endpoint: 'GET /api/apm/alerts/chart_preview/transaction_duration',
endpoint:
'GET /internal/apm/alerts/chart_preview/transaction_duration',
params: {
query: {
aggregationType: params.aggregationType,

View file

@ -68,7 +68,8 @@ export function TransactionErrorRateAlertTrigger(props: Props) {
});
if (interval && start && end) {
return callApmApi({
endpoint: 'GET /api/apm/alerts/chart_preview/transaction_error_rate',
endpoint:
'GET /internal/apm/alerts/chart_preview/transaction_error_rate',
params: {
query: {
environment: params.environment,

View file

@ -76,7 +76,7 @@ async function saveApmIndices({
apmIndices: Record<string, string>;
}) {
await callApmApi({
endpoint: 'POST /api/apm/settings/apm-indices/save',
endpoint: 'POST /internal/apm/settings/apm-indices/save',
signal: null,
params: {
body: apmIndices,
@ -86,7 +86,8 @@ async function saveApmIndices({
clearCache();
}
type ApiResponse = APIReturnType<`GET /api/apm/settings/apm-index-settings`>;
type ApiResponse =
APIReturnType<`GET /internal/apm/settings/apm-index-settings`>;
// avoid infinite loop by initializing the state outside the component
const INITIAL_STATE: ApiResponse = { apmIndexSettings: [] };
@ -103,7 +104,7 @@ export function ApmIndices() {
(_callApmApi) => {
if (canSave) {
return _callApmApi({
endpoint: `GET /api/apm/settings/apm-index-settings`,
endpoint: `GET /internal/apm/settings/apm-index-settings`,
});
}
},

View file

@ -35,7 +35,7 @@ interface Props {
}
type ApiResponse =
APIReturnType<'GET /api/apm/settings/anomaly-detection/environments'>;
APIReturnType<'GET /internal/apm/settings/anomaly-detection/environments'>;
const INITIAL_DATA: ApiResponse = { environments: [] };
export function AddEnvironments({
@ -50,7 +50,7 @@ export function AddEnvironments({
const { data = INITIAL_DATA, status } = useFetcher(
(callApmApi) =>
callApmApi({
endpoint: `GET /api/apm/settings/anomaly-detection/environments`,
endpoint: `GET /internal/apm/settings/anomaly-detection/environments`,
}),
[],
{ preservePreviousData: false }

View file

@ -28,7 +28,7 @@ export async function createJobs({
}) {
try {
await callApmApi({
endpoint: 'POST /api/apm/settings/anomaly-detection/jobs',
endpoint: 'POST /internal/apm/settings/anomaly-detection/jobs',
signal: null,
params: {
body: { environments },

View file

@ -17,7 +17,7 @@ import { useLicenseContext } from '../../../../context/license/use_license_conte
import { APIReturnType } from '../../../../services/rest/createCallApmApi';
export type AnomalyDetectionApiResponse =
APIReturnType<'GET /api/apm/settings/anomaly-detection/jobs'>;
APIReturnType<'GET /internal/apm/settings/anomaly-detection/jobs'>;
const DEFAULT_VALUE: AnomalyDetectionApiResponse = {
jobs: [],
@ -40,7 +40,7 @@ export function AnomalyDetection() {
(callApmApi) => {
if (canGetJobs) {
return callApmApi({
endpoint: `GET /api/apm/settings/anomaly-detection/jobs`,
endpoint: `GET /internal/apm/settings/anomaly-detection/jobs`,
});
}
},

View file

@ -49,7 +49,7 @@ async function deleteConfig(
) {
try {
await callApmApi({
endpoint: 'DELETE /api/apm/settings/custom_links/{id}',
endpoint: 'DELETE /internal/apm/settings/custom_links/{id}',
signal: null,
params: {
path: { id: customLinkId },

View file

@ -34,7 +34,7 @@ const fetchTransaction = debounce(
async (filters: Filter[], callback: (transaction: Transaction) => void) => {
const transaction = await callApmApi({
signal: null,
endpoint: 'GET /api/apm/settings/custom_links/transaction',
endpoint: 'GET /internal/apm/settings/custom_links/transaction',
params: { query: convertFiltersToQuery(filters) },
});
callback(transaction);

View file

@ -35,7 +35,7 @@ export async function saveCustomLink({
if (id) {
await callApmApi({
endpoint: 'PUT /api/apm/settings/custom_links/{id}',
endpoint: 'PUT /internal/apm/settings/custom_links/{id}',
signal: null,
params: {
path: { id },
@ -44,7 +44,7 @@ export async function saveCustomLink({
});
} else {
await callApmApi({
endpoint: 'POST /api/apm/settings/custom_links',
endpoint: 'POST /internal/apm/settings/custom_links',
signal: null,
params: {
body: customLink,

View file

@ -38,7 +38,7 @@ export function CustomLinkOverview() {
async (callApmApi) => {
if (hasValidLicense) {
return callApmApi({
endpoint: 'GET /api/apm/settings/custom_links',
endpoint: 'GET /internal/apm/settings/custom_links',
});
}
},

View file

@ -20,7 +20,7 @@ import {
import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context';
type FleetMigrationCheckResponse =
APIReturnType<'GET /api/apm/fleet/migration_check'>;
APIReturnType<'GET /internal/apm/fleet/migration_check'>;
const APM_DATA_STREAMS_MIGRATION_STATUS_LS = {
value: '',
@ -46,7 +46,8 @@ export function Schema() {
data = {} as FleetMigrationCheckResponse,
status,
} = useFetcher(
(callApi) => callApi({ endpoint: 'GET /api/apm/fleet/migration_check' }),
(callApi) =>
callApi({ endpoint: 'GET /internal/apm/fleet/migration_check' }),
[],
{ preservePreviousData: false }
);
@ -118,7 +119,7 @@ async function getUnsupportedApmServerConfigs(
) {
try {
const { unsupported } = await callApmApi({
endpoint: 'GET /api/apm/fleet/apm_server_schema/unsupported',
endpoint: 'GET /internal/apm/fleet/apm_server_schema/unsupported',
signal: null,
});
return unsupported;
@ -142,7 +143,7 @@ async function createCloudApmPackagePolicy(
updateLocalStorage(FETCH_STATUS.LOADING);
try {
const { cloudApmPackagePolicy } = await callApmApi({
endpoint: 'POST /api/apm/fleet/cloud_apm_package_policy',
endpoint: 'POST /internal/apm/fleet/cloud_apm_package_policy',
signal: null,
});
updateLocalStorage(FETCH_STATUS.SUCCESS);

View file

@ -29,7 +29,7 @@ export function TraceLink() {
(callApmApi) => {
if (traceId) {
return callApmApi({
endpoint: 'GET /api/apm/traces/{traceId}/root_transaction',
endpoint: 'GET /internal/apm/traces/{traceId}/root_transaction',
params: {
path: {
traceId,

View file

@ -44,7 +44,7 @@ export function BackendDetailDependenciesTable() {
}
return callApmApi({
endpoint: 'GET /api/apm/backends/{backendName}/upstream_services',
endpoint: 'GET /internal/apm/backends/{backendName}/upstream_services',
params: {
path: {
backendName,

View file

@ -44,7 +44,7 @@ export function BackendFailedTransactionRateChart({
}
return callApmApi({
endpoint: 'GET /api/apm/backends/{backendName}/charts/error_rate',
endpoint: 'GET /internal/apm/backends/{backendName}/charts/error_rate',
params: {
path: {
backendName,

View file

@ -40,7 +40,7 @@ export function BackendLatencyChart({ height }: { height: number }) {
}
return callApmApi({
endpoint: 'GET /api/apm/backends/{backendName}/charts/latency',
endpoint: 'GET /internal/apm/backends/{backendName}/charts/latency',
params: {
path: {
backendName,

View file

@ -36,7 +36,7 @@ export function BackendThroughputChart({ height }: { height: number }) {
}
return callApmApi({
endpoint: 'GET /api/apm/backends/{backendName}/charts/throughput',
endpoint: 'GET /internal/apm/backends/{backendName}/charts/throughput',
params: {
path: {
backendName,

View file

@ -45,7 +45,7 @@ export function BackendInventoryDependenciesTable() {
}
return callApmApi({
endpoint: 'GET /api/apm/backends/top_backends',
endpoint: 'GET /internal/apm/backends/top_backends',
params: {
query: { start, end, environment, numBuckets: 20, offset, kuery },
},

View file

@ -35,7 +35,7 @@ const ALERT_RULE_TYPE_ID: typeof ALERT_RULE_TYPE_ID_TYPED =
ALERT_RULE_TYPE_ID_NON_TYPED;
type ErrorDistributionAPIResponse =
APIReturnType<'GET /api/apm/services/{serviceName}/errors/distribution'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/errors/distribution'>;
interface FormattedBucket {
x0: number;

View file

@ -54,7 +54,7 @@ const TransactionLinkName = euiStyled.div`
`;
interface Props {
errorGroup: APIReturnType<'GET /api/apm/services/{serviceName}/errors/{groupId}'>;
errorGroup: APIReturnType<'GET /internal/apm/services/{serviceName}/errors/{groupId}'>;
urlParams: ApmUrlParams;
kuery: string;
}

View file

@ -127,7 +127,7 @@ export function ErrorGroupDetails() {
(callApmApi) => {
if (start && end) {
return callApmApi({
endpoint: 'GET /api/apm/services/{serviceName}/errors/{groupId}',
endpoint: 'GET /internal/apm/services/{serviceName}/errors/{groupId}',
params: {
path: {
serviceName,

View file

@ -48,7 +48,7 @@ const Culprit = euiStyled.div`
`;
type ErrorGroupItem =
APIReturnType<'GET /api/apm/services/{serviceName}/errors'>['errorGroups'][0];
APIReturnType<'GET /internal/apm/services/{serviceName}/errors'>['errorGroups'][0];
interface Props {
items: ErrorGroupItem[];

View file

@ -44,7 +44,7 @@ export function ErrorGroupOverview() {
if (start && end) {
return callApmApi({
endpoint: 'GET /api/apm/services/{serviceName}/errors',
endpoint: 'GET /internal/apm/services/{serviceName}/errors',
params: {
path: {
serviceName,

View file

@ -29,7 +29,8 @@ export function ServiceDependenciesBreakdownChart({
const { data, status } = useFetcher(
(callApmApi) => {
return callApmApi({
endpoint: 'GET /api/apm/services/{serviceName}/dependencies/breakdown',
endpoint:
'GET /internal/apm/services/{serviceName}/dependencies/breakdown',
params: {
path: {
serviceName,

View file

@ -64,7 +64,7 @@ function useServicesFetcher() {
(callApmApi) => {
if (start && end) {
return callApmApi({
endpoint: 'GET /api/apm/services',
endpoint: 'GET /internal/apm/services',
params: {
query: {
environment,
@ -90,7 +90,7 @@ function useServicesFetcher() {
(callApmApi) => {
if (start && end && mainStatisticsData.items.length) {
return callApmApi({
endpoint: 'GET /api/apm/services/detailed_statistics',
endpoint: 'GET /internal/apm/services/detailed_statistics',
params: {
query: {
environment,

View file

@ -7,7 +7,7 @@
import { APIReturnType } from '../../../../../services/rest/createCallApmApi';
type ServiceListAPIResponse = APIReturnType<'GET /api/apm/services'>;
type ServiceListAPIResponse = APIReturnType<'GET /internal/apm/services'>;
export const items: ServiceListAPIResponse['items'] = [
{

View file

@ -43,10 +43,10 @@ import { ServiceLink } from '../../../shared/service_link';
import { TruncateWithTooltip } from '../../../shared/truncate_with_tooltip';
import { HealthBadge } from './HealthBadge';
type ServiceListAPIResponse = APIReturnType<'GET /api/apm/services'>;
type ServiceListAPIResponse = APIReturnType<'GET /internal/apm/services'>;
type Items = ServiceListAPIResponse['items'];
type ServicesDetailedStatisticsAPIResponse =
APIReturnType<'GET /api/apm/services/detailed_statistics'>;
APIReturnType<'GET /internal/apm/services/detailed_statistics'>;
type ServiceListItem = ValuesType<Items>;

View file

@ -33,7 +33,7 @@ describe('ServiceList', () => {
const callApmApiSpy = getCallApmApiSpy().mockImplementation(
({ endpoint }) => {
if (endpoint === 'GET /api/apm/fallback_to_transactions') {
if (endpoint === 'GET /internal/apm/fallback_to_transactions') {
return Promise.resolve({ fallbackToTransactions: false });
}
return Promise.reject(`Response for ${endpoint} is not defined`);

View file

@ -35,7 +35,7 @@ export function ServiceLogs() {
(callApmApi) => {
if (start && end) {
return callApmApi({
endpoint: 'GET /api/apm/services/{serviceName}/infrastructure',
endpoint: 'GET /internal/apm/services/{serviceName}/infrastructure',
params: {
path: { serviceName },
query: {
@ -92,7 +92,7 @@ export function ServiceLogs() {
}
export const getInfrastructureKQLFilter = (
data?: APIReturnType<'GET /api/apm/services/{serviceName}/infrastructure'>
data?: APIReturnType<'GET /internal/apm/services/{serviceName}/infrastructure'>
) => {
const containerIds = data?.serviceInfrastructure?.containerIds ?? [];
const hostNames = data?.serviceInfrastructure?.hostNames ?? [];

View file

@ -38,7 +38,7 @@ export function BackendContents({
(callApmApi) => {
if (backendName) {
return callApmApi({
endpoint: 'GET /api/apm/service-map/backend/{backendName}',
endpoint: 'GET /internal/apm/service-map/backend/{backendName}',
params: {
path: { backendName },
query: {

View file

@ -47,7 +47,7 @@ export function ServiceContents({
(callApmApi) => {
if (serviceName && start && end) {
return callApmApi({
endpoint: 'GET /api/apm/service-map/service/{serviceName}',
endpoint: 'GET /internal/apm/service-map/service/{serviceName}',
params: {
path: { serviceName },
query: { environment, start, end },

View file

@ -124,7 +124,7 @@ export function ServiceMap({
return callApmApi({
isCachable: false,
endpoint: 'GET /api/apm/service-map',
endpoint: 'GET /internal/apm/service-map',
params: {
query: {
start,

View file

@ -85,7 +85,7 @@ export function ServiceNodeMetrics() {
if (start && end) {
return callApmApi({
endpoint:
'GET /api/apm/services/{serviceName}/node/{serviceNodeName}/metadata',
'GET /internal/apm/services/{serviceName}/node/{serviceNodeName}/metadata',
params: {
path: { serviceName, serviceNodeName },
query: {

View file

@ -48,7 +48,7 @@ function ServiceNodeOverview() {
return undefined;
}
return callApmApi({
endpoint: 'GET /api/apm/services/{serviceName}/serviceNodes',
endpoint: 'GET /internal/apm/services/{serviceName}/serviceNodes',
params: {
path: {
serviceName,

View file

@ -99,21 +99,21 @@ describe('ServiceOverview', () => {
/* eslint-disable @typescript-eslint/naming-convention */
const calls = {
'GET /api/apm/services/{serviceName}/error_groups/main_statistics': {
'GET /internal/apm/services/{serviceName}/error_groups/main_statistics': {
error_groups: [] as any[],
},
'GET /api/apm/services/{serviceName}/transactions/groups/main_statistics':
'GET /internal/apm/services/{serviceName}/transactions/groups/main_statistics':
{
transactionGroups: [] as any[],
totalTransactionGroups: 0,
isAggregationAccurate: true,
},
'GET /api/apm/services/{serviceName}/dependencies': {
'GET /internal/apm/services/{serviceName}/dependencies': {
serviceDependencies: [],
},
'GET /api/apm/services/{serviceName}/service_overview_instances/main_statistics':
'GET /internal/apm/services/{serviceName}/service_overview_instances/main_statistics':
[],
'GET /api/apm/services/{serviceName}/transactions/charts/latency': {
'GET /internal/apm/services/{serviceName}/transactions/charts/latency': {
currentPeriod: {
overallAvgDuration: null,
latencyTimeseries: [],
@ -123,26 +123,27 @@ describe('ServiceOverview', () => {
latencyTimeseries: [],
},
},
'GET /api/apm/services/{serviceName}/throughput': {
'GET /internal/apm/services/{serviceName}/throughput': {
currentPeriod: [],
previousPeriod: [],
},
'GET /api/apm/services/{serviceName}/transactions/charts/error_rate': {
currentPeriod: {
transactionErrorRate: [],
noHits: true,
average: null,
'GET /internal/apm/services/{serviceName}/transactions/charts/error_rate':
{
currentPeriod: {
transactionErrorRate: [],
noHits: true,
average: null,
},
previousPeriod: {
transactionErrorRate: [],
noHits: true,
average: null,
},
},
previousPeriod: {
transactionErrorRate: [],
noHits: true,
average: null,
},
},
'GET /api/apm/services/{serviceName}/annotation/search': {
annotations: [],
},
'GET /api/apm/fallback_to_transactions': {
'GET /internal/apm/fallback_to_transactions': {
fallbackToTransactions: false,
},
};

View file

@ -59,7 +59,7 @@ export function ServiceOverviewDependenciesTable({
}
return callApmApi({
endpoint: 'GET /api/apm/services/{serviceName}/dependencies',
endpoint: 'GET /internal/apm/services/{serviceName}/dependencies',
params: {
path: { serviceName },
query: { start, end, environment, numBuckets: 20, offset },

View file

@ -16,9 +16,9 @@ import { TimestampTooltip } from '../../../shared/TimestampTooltip';
import { TruncateWithTooltip } from '../../../shared/truncate_with_tooltip';
type ErrorGroupMainStatistics =
APIReturnType<'GET /api/apm/services/{serviceName}/error_groups/main_statistics'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/error_groups/main_statistics'>;
type ErrorGroupDetailedStatistics =
APIReturnType<'GET /api/apm/services/{serviceName}/error_groups/detailed_statistics'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/error_groups/detailed_statistics'>;
export function getColumns({
serviceName,

View file

@ -30,9 +30,9 @@ interface Props {
serviceName: string;
}
type ErrorGroupMainStatistics =
APIReturnType<'GET /api/apm/services/{serviceName}/error_groups/main_statistics'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/error_groups/main_statistics'>;
type ErrorGroupDetailedStatistics =
APIReturnType<'GET /api/apm/services/{serviceName}/error_groups/detailed_statistics'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/error_groups/detailed_statistics'>;
type SortDirection = 'asc' | 'desc';
type SortField = 'name' | 'lastSeen' | 'occurrences';
@ -97,7 +97,7 @@ export function ServiceOverviewErrorsTable({ serviceName }: Props) {
}
return callApmApi({
endpoint:
'GET /api/apm/services/{serviceName}/error_groups/main_statistics',
'GET /internal/apm/services/{serviceName}/error_groups/main_statistics',
params: {
path: { serviceName },
query: {
@ -150,7 +150,7 @@ export function ServiceOverviewErrorsTable({ serviceName }: Props) {
if (requestId && items.length && start && end && transactionType) {
return callApmApi({
endpoint:
'GET /api/apm/services/{serviceName}/error_groups/detailed_statistics',
'GET /internal/apm/services/{serviceName}/error_groups/detailed_statistics',
params: {
path: { serviceName },
query: {

View file

@ -28,9 +28,9 @@ interface ServiceOverviewInstancesChartAndTableProps {
}
type ApiResponseMainStats =
APIReturnType<'GET /api/apm/services/{serviceName}/service_overview_instances/main_statistics'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/service_overview_instances/main_statistics'>;
type ApiResponseDetailedStats =
APIReturnType<'GET /api/apm/services/{serviceName}/service_overview_instances/detailed_statistics'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/service_overview_instances/detailed_statistics'>;
const INITIAL_STATE_MAIN_STATS = {
currentPeriodItems: [] as ApiResponseMainStats['currentPeriod'],
@ -100,7 +100,7 @@ export function ServiceOverviewInstancesChartAndTable({
return callApmApi({
endpoint:
'GET /api/apm/services/{serviceName}/service_overview_instances/main_statistics',
'GET /internal/apm/services/{serviceName}/service_overview_instances/main_statistics',
params: {
path: {
serviceName,
@ -181,7 +181,7 @@ export function ServiceOverviewInstancesChartAndTable({
return callApmApi({
endpoint:
'GET /api/apm/services/{serviceName}/service_overview_instances/detailed_statistics',
'GET /internal/apm/services/{serviceName}/service_overview_instances/detailed_statistics',
params: {
path: {
serviceName,

View file

@ -33,11 +33,11 @@ import { TruncateWithTooltip } from '../../../shared/truncate_with_tooltip';
import { InstanceActionsMenu } from './instance_actions_menu';
type ServiceInstanceMainStatistics =
APIReturnType<'GET /api/apm/services/{serviceName}/service_overview_instances/main_statistics'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/service_overview_instances/main_statistics'>;
type MainStatsServiceInstanceItem =
ServiceInstanceMainStatistics['currentPeriod'][0];
type ServiceInstanceDetailedStatistics =
APIReturnType<'GET /api/apm/services/{serviceName}/service_overview_instances/detailed_statistics'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/service_overview_instances/detailed_statistics'>;
export function getColumns({
serviceName,

View file

@ -29,11 +29,11 @@ import { useApmParams } from '../../../../hooks/use_apm_params';
import { useBreakpoints } from '../../../../hooks/use_breakpoints';
type ServiceInstanceMainStatistics =
APIReturnType<'GET /api/apm/services/{serviceName}/service_overview_instances/main_statistics'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/service_overview_instances/main_statistics'>;
type MainStatsServiceInstanceItem =
ServiceInstanceMainStatistics['currentPeriod'][0];
type ServiceInstanceDetailedStatistics =
APIReturnType<'GET /api/apm/services/{serviceName}/service_overview_instances/detailed_statistics'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/service_overview_instances/detailed_statistics'>;
export interface TableOptions {
pageIndex: number;

View file

@ -17,7 +17,7 @@ import {
} from '../../../../shared/transaction_action_menu/sections_helper';
type InstaceDetails =
APIReturnType<'GET /api/apm/services/{serviceName}/service_overview_instances/details/{serviceNodeName}'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/service_overview_instances/details/{serviceNodeName}'>;
function getInfraMetricsQuery(timestamp?: string) {
if (!timestamp) {

View file

@ -16,7 +16,7 @@ import { InstanceDetails } from './intance_details';
import * as useInstanceDetailsFetcher from './use_instance_details_fetcher';
type ServiceInstanceDetails =
APIReturnType<'GET /api/apm/services/{serviceName}/service_overview_instances/details/{serviceNodeName}'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/service_overview_instances/details/{serviceNodeName}'>;
describe('InstanceDetails', () => {
it('renders loading spinner when data is being fetched', () => {

View file

@ -34,7 +34,7 @@ import { getCloudIcon, getContainerIcon } from '../../../shared/service_icons';
import { useInstanceDetailsFetcher } from './use_instance_details_fetcher';
type ServiceInstanceDetails =
APIReturnType<'GET /api/apm/services/{serviceName}/service_overview_instances/details/{serviceNodeName}'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/service_overview_instances/details/{serviceNodeName}'>;
interface Props {
serviceName: string;

View file

@ -28,7 +28,7 @@ export function useInstanceDetailsFetcher({
}
return callApmApi({
endpoint:
'GET /api/apm/services/{serviceName}/service_overview_instances/details/{serviceNodeName}',
'GET /internal/apm/services/{serviceName}/service_overview_instances/details/{serviceNodeName}',
params: {
path: {
serviceName,

View file

@ -69,7 +69,7 @@ export function ServiceOverviewThroughputChart({
(callApmApi) => {
if (serviceName && transactionType && start && end) {
return callApmApi({
endpoint: 'GET /api/apm/services/{serviceName}/throughput',
endpoint: 'GET /internal/apm/services/{serviceName}/throughput',
params: {
path: {
serviceName,

View file

@ -19,7 +19,7 @@ import { ServiceProfilingFlamegraph } from './service_profiling_flamegraph';
import { ServiceProfilingTimeline } from './service_profiling_timeline';
type ApiResponse =
APIReturnType<'GET /api/apm/services/{serviceName}/profiling/timeline'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/profiling/timeline'>;
const DEFAULT_DATA: ApiResponse = { profilingTimeline: [] };
export function ServiceProfiling() {
@ -38,7 +38,7 @@ export function ServiceProfiling() {
}
return callApmApi({
endpoint: 'GET /api/apm/services/{serviceName}/profiling/timeline',
endpoint: 'GET /internal/apm/services/{serviceName}/profiling/timeline',
params: {
path: { serviceName },
query: {

View file

@ -147,7 +147,8 @@ export function ServiceProfilingFlamegraph({
}
return callApmApi({
endpoint: 'GET /api/apm/services/{serviceName}/profiling/statistics',
endpoint:
'GET /internal/apm/services/{serviceName}/profiling/statistics',
params: {
path: {
serviceName,

View file

@ -16,7 +16,7 @@ import { useFallbackToTransactionsFetcher } from '../../../hooks/use_fallback_to
import { AggregatedTransactionsBadge } from '../../shared/aggregated_transactions_badge';
import { useTimeRange } from '../../../hooks/use_time_range';
type TracesAPIResponse = APIReturnType<'GET /api/apm/traces'>;
type TracesAPIResponse = APIReturnType<'GET /internal/apm/traces'>;
const DEFAULT_RESPONSE: TracesAPIResponse = {
items: [],
};
@ -35,7 +35,7 @@ export function TraceOverview() {
(callApmApi) => {
if (start && end) {
return callApmApi({
endpoint: 'GET /api/apm/traces',
endpoint: 'GET /internal/apm/traces',
params: {
query: {
environment,

View file

@ -20,7 +20,7 @@ import { ImpactBar } from '../../shared/ImpactBar';
import { TransactionDetailLink } from '../../shared/Links/apm/transaction_detail_link';
import { ITableColumn, ManagedTable } from '../../shared/managed_table';
type TraceGroup = APIReturnType<'GET /api/apm/traces'>['items'][0];
type TraceGroup = APIReturnType<'GET /internal/apm/traces'>['items'][0];
const StyledTransactionLink = euiStyled(TransactionDetailLink)`
font-size: ${({ theme }) => theme.eui.euiFontSizeS};

View file

@ -36,7 +36,7 @@ export function useWaterfallFetcher() {
(callApmApi) => {
if (traceId && start && end) {
return callApmApi({
endpoint: 'GET /api/apm/traces/{traceId}',
endpoint: 'GET /internal/apm/traces/{traceId}',
params: {
path: { traceId },
query: {

View file

@ -12,7 +12,7 @@ import { APMError } from '../../../../../../../../typings/es_schemas/ui/apm_erro
import { Span } from '../../../../../../../../typings/es_schemas/ui/span';
import { Transaction } from '../../../../../../../../typings/es_schemas/ui/transaction';
type TraceAPIResponse = APIReturnType<'GET /api/apm/traces/{traceId}'>;
type TraceAPIResponse = APIReturnType<'GET /internal/apm/traces/{traceId}'>;
interface IWaterfallGroup {
[key: string]: IWaterfallSpanOrTransaction[];

View file

@ -16,7 +16,7 @@ export const location = {
hash: '',
} as Location;
type TraceAPIResponse = APIReturnType<'GET /api/apm/traces/{traceId}'>;
type TraceAPIResponse = APIReturnType<'GET /internal/apm/traces/{traceId}'>;
export const urlParams = {
start: '2020-03-22T15:16:38.742Z',

View file

@ -28,7 +28,7 @@ export function TransactionLink() {
(callApmApi) => {
if (transactionId) {
return callApmApi({
endpoint: 'GET /api/apm/transactions/{transactionId}',
endpoint: 'GET /internal/apm/transactions/{transactionId}',
params: {
path: {
transactionId,

View file

@ -49,7 +49,7 @@ export function ApmMainTemplate({
services.observability.navigation.PageTemplate;
const { data } = useFetcher((callApmApi) => {
return callApmApi({ endpoint: 'GET /api/apm/has_data' });
return callApmApi({ endpoint: 'GET /internal/apm/has_data' });
}, []);
const noDataConfig = getNoDataConfig({

View file

@ -27,7 +27,7 @@ import { APIReturnType } from '../../../services/rest/createCallApmApi';
import { getAPMHref } from '../Links/apm/APMLink';
export type AnomalyDetectionApiResponse =
APIReturnType<'GET /api/apm/settings/anomaly-detection/jobs'>;
APIReturnType<'GET /internal/apm/settings/anomaly-detection/jobs'>;
const DEFAULT_DATA = { jobs: [], hasLegacyJobs: false };

View file

@ -30,7 +30,7 @@ import { APIReturnType } from '../../../../services/rest/createCallApmApi';
import { getAlertAnnotations } from './get_alert_annotations';
type Alert = ValuesType<
APIReturnType<'GET /api/apm/services/{serviceName}/alerts'>['alerts']
APIReturnType<'GET /internal/apm/services/{serviceName}/alerts'>['alerts']
>;
const euiColorDanger = 'red';

View file

@ -46,7 +46,7 @@ const ALERT_RULE_TYPE_ID: typeof ALERT_RULE_TYPE_ID_TYPED =
const ALERT_RULE_NAME: typeof ALERT_RULE_NAME_TYPED = ALERT_RULE_NAME_NON_TYPED;
type Alert = ValuesType<
APIReturnType<'GET /api/apm/services/{serviceName}/alerts'>['alerts']
APIReturnType<'GET /internal/apm/services/{serviceName}/alerts'>['alerts']
>;
function getAlertColor({

View file

@ -12,7 +12,7 @@ import { getDurationFormatter } from '../../../../../common/utils/formatters';
import { CustomTooltip } from './custom_tooltip';
type ServiceInstanceMainStatistics =
APIReturnType<'GET /api/apm/services/{serviceName}/service_overview_instances/main_statistics'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/service_overview_instances/main_statistics'>;
type MainStatsServiceInstanceItem =
ServiceInstanceMainStatistics['currentPeriod'][0];

View file

@ -18,7 +18,7 @@ import {
import { useTheme } from '../../../../hooks/use_theme';
type ServiceInstanceMainStatistics =
APIReturnType<'GET /api/apm/services/{serviceName}/service_overview_instances/main_statistics'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/service_overview_instances/main_statistics'>;
type MainStatsServiceInstanceItem =
ServiceInstanceMainStatistics['currentPeriod'][0];

View file

@ -37,7 +37,7 @@ import { getResponseTimeTickFormatter } from '../transaction_charts/helper';
import { CustomTooltip } from './custom_tooltip';
type ApiResponseMainStats =
APIReturnType<'GET /api/apm/services/{serviceName}/service_overview_instances/main_statistics'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/service_overview_instances/main_statistics'>;
export interface InstancesLatencyDistributionChartProps {
height: number;

View file

@ -42,8 +42,8 @@ import {
import { LatencyChart } from './';
interface Args {
alertsResponse: APIReturnType<'GET /api/apm/services/{serviceName}/alerts'>;
latencyChartResponse: APIReturnType<'GET /api/apm/services/{serviceName}/transactions/charts/latency'>;
alertsResponse: APIReturnType<'GET /internal/apm/services/{serviceName}/alerts'>;
latencyChartResponse: APIReturnType<'GET /internal/apm/services/{serviceName}/transactions/charts/latency'>;
}
export default {
@ -70,7 +70,7 @@ export default {
basePath: { prepend: () => {} },
get: (endpoint: string) => {
switch (endpoint) {
case `/api/apm/services/${serviceName}/transactions/charts/latency`:
case `/internal/apm/services/${serviceName}/transactions/charts/latency`:
return latencyChartResponse;
default:
return {};

View file

@ -39,7 +39,7 @@ export function useTransactionBreakdown({
if (serviceName && start && end && transactionType) {
return callApmApi({
endpoint:
'GET /api/apm/services/{serviceName}/transaction/charts/breakdown',
'GET /internal/apm/services/{serviceName}/transaction/charts/breakdown',
params: {
path: { serviceName },
query: {

View file

@ -36,7 +36,7 @@ interface Props {
}
type ErrorRate =
APIReturnType<'GET /api/apm/services/{serviceName}/transactions/charts/error_rate'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/transactions/charts/error_rate'>;
const INITIAL_STATE: ErrorRate = {
currentPeriod: {
@ -82,7 +82,7 @@ export function TransactionErrorRateChart({
if (transactionType && serviceName && start && end) {
return callApmApi({
endpoint:
'GET /api/apm/services/{serviceName}/transactions/charts/error_rate',
'GET /internal/apm/services/{serviceName}/transactions/charts/error_rate',
params: {
path: {
serviceName,

View file

@ -12,7 +12,7 @@ import React from 'react';
import { APIReturnType } from '../../../services/rest/createCallApmApi';
type ServiceDetailsReturnType =
APIReturnType<'GET /api/apm/services/{serviceName}/metadata/details'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/metadata/details'>;
interface Props {
cloud: ServiceDetailsReturnType['cloud'];

View file

@ -13,7 +13,7 @@ import { asInteger } from '../../../../common/utils/formatters';
import { APIReturnType } from '../../../services/rest/createCallApmApi';
type ServiceDetailsReturnType =
APIReturnType<'GET /api/apm/services/{serviceName}/metadata/details'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/metadata/details'>;
interface Props {
container: ServiceDetailsReturnType['container'];

View file

@ -186,7 +186,7 @@ describe('ServiceIcons', () => {
};
it('Shows loading spinner while fetching data', () => {
const apisMockData = {
'GET /api/apm/services/{serviceName}/metadata/icons': {
'GET /internal/apm/services/{serviceName}/metadata/icons': {
data: {
agentName: 'java',
containerType: 'Kubernetes',
@ -195,7 +195,7 @@ describe('ServiceIcons', () => {
status: fetcherHook.FETCH_STATUS.SUCCESS,
refetch: jest.fn(),
},
'GET /api/apm/services/{serviceName}/metadata/details': {
'GET /internal/apm/services/{serviceName}/metadata/details': {
data: undefined,
status: fetcherHook.FETCH_STATUS.LOADING,
refetch: jest.fn(),
@ -228,7 +228,7 @@ describe('ServiceIcons', () => {
it('shows service content', () => {
const apisMockData = {
'GET /api/apm/services/{serviceName}/metadata/icons': {
'GET /internal/apm/services/{serviceName}/metadata/icons': {
data: {
agentName: 'java',
containerType: 'Kubernetes',
@ -237,7 +237,7 @@ describe('ServiceIcons', () => {
status: fetcherHook.FETCH_STATUS.SUCCESS,
refetch: jest.fn(),
},
'GET /api/apm/services/{serviceName}/metadata/details': {
'GET /internal/apm/services/{serviceName}/metadata/details': {
data: { service: { versions: ['v1.0.0'] } },
status: fetcherHook.FETCH_STATUS.SUCCESS,
refetch: jest.fn(),

View file

@ -71,7 +71,7 @@ export function ServiceIcons({ start, end, serviceName }: Props) {
(callApmApi) => {
if (serviceName && start && end) {
return callApmApi({
endpoint: 'GET /api/apm/services/{serviceName}/metadata/icons',
endpoint: 'GET /internal/apm/services/{serviceName}/metadata/icons',
params: {
path: { serviceName },
query: { start, end },
@ -87,7 +87,7 @@ export function ServiceIcons({ start, end, serviceName }: Props) {
if (selectedIconPopover && serviceName && start && end) {
return callApmApi({
isCachable: true,
endpoint: 'GET /api/apm/services/{serviceName}/metadata/details',
endpoint: 'GET /internal/apm/services/{serviceName}/metadata/details',
params: {
path: { serviceName },
query: { start, end },

View file

@ -12,7 +12,7 @@ import React from 'react';
import { APIReturnType } from '../../../services/rest/createCallApmApi';
type ServiceDetailsReturnType =
APIReturnType<'GET /api/apm/services/{serviceName}/metadata/details'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/metadata/details'>;
interface Props {
service: ServiceDetailsReturnType['service'];

View file

@ -61,7 +61,7 @@ export function CustomLinkMenuSection({
(callApmApi) =>
callApmApi({
isCachable: false,
endpoint: 'GET /api/apm/settings/custom_links',
endpoint: 'GET /internal/apm/settings/custom_links',
params: { query: convertFiltersToQuery(filters) },
}),
[filters]

View file

@ -28,13 +28,13 @@ import { TruncateWithTooltip } from '../truncate_with_tooltip';
import { getLatencyColumnLabel } from './get_latency_column_label';
type TransactionGroupMainStatistics =
APIReturnType<'GET /api/apm/services/{serviceName}/transactions/groups/main_statistics'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/transactions/groups/main_statistics'>;
type ServiceTransactionGroupItem = ValuesType<
TransactionGroupMainStatistics['transactionGroups']
>;
type TransactionGroupDetailedStatistics =
APIReturnType<'GET /api/apm/services/{serviceName}/transactions/groups/detailed_statistics'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/transactions/groups/detailed_statistics'>;
export function getColumns({
serviceName,

View file

@ -30,7 +30,7 @@ import { ElasticDocsLink } from '../Links/ElasticDocsLink';
import { useBreakpoints } from '../../../hooks/use_breakpoints';
type ApiResponse =
APIReturnType<'GET /api/apm/services/{serviceName}/transactions/groups/main_statistics'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/transactions/groups/main_statistics'>;
interface InitialState {
requestId: string;
@ -116,7 +116,7 @@ export function TransactionsTable({
}
return callApmApi({
endpoint:
'GET /api/apm/services/{serviceName}/transactions/groups/main_statistics',
'GET /internal/apm/services/{serviceName}/transactions/groups/main_statistics',
params: {
path: { serviceName },
query: {
@ -189,7 +189,7 @@ export function TransactionsTable({
) {
return callApmApi({
endpoint:
'GET /api/apm/services/{serviceName}/transactions/groups/detailed_statistics',
'GET /internal/apm/services/{serviceName}/transactions/groups/detailed_statistics',
params: {
path: { serviceName },
query: {

View file

@ -10,7 +10,7 @@ import { FETCH_STATUS, useFetcher } from '../../hooks/use_fetcher';
import { APIReturnType } from '../../services/rest/createCallApmApi';
export interface AnomalyDetectionJobsContextValue {
anomalyDetectionJobsData?: APIReturnType<'GET /api/apm/settings/anomaly-detection/jobs'>;
anomalyDetectionJobsData?: APIReturnType<'GET /internal/apm/settings/anomaly-detection/jobs'>;
anomalyDetectionJobsStatus: FETCH_STATUS;
anomalyDetectionJobsRefetch: () => void;
}
@ -30,7 +30,7 @@ export function AnomalyDetectionJobsContextProvider({
const { data, status } = useFetcher(
(callApmApi) =>
callApmApi({
endpoint: `GET /api/apm/settings/anomaly-detection/jobs`,
endpoint: `GET /internal/apm/settings/anomaly-detection/jobs`,
}),
[fetchId], // eslint-disable-line react-hooks/exhaustive-deps
{ showToastOnError: false }

View file

@ -15,7 +15,7 @@ export const ApmBackendContext = createContext<
| {
backendName: string;
metadata: {
data?: APIReturnType<'GET /api/apm/backends/{backendName}/metadata'>;
data?: APIReturnType<'GET /internal/apm/backends/{backendName}/metadata'>;
status?: FETCH_STATUS;
};
}
@ -41,7 +41,7 @@ export function ApmBackendContextProvider({
}
return callApmApi({
endpoint: 'GET /api/apm/backends/{backendName}/metadata',
endpoint: 'GET /internal/apm/backends/{backendName}/metadata',
params: {
path: {
backendName,

View file

@ -20,7 +20,7 @@ import { useApmParams } from '../../hooks/use_apm_params';
import { useTimeRange } from '../../hooks/use_time_range';
export type APMServiceAlert = ValuesType<
APIReturnType<'GET /api/apm/services/{serviceName}/alerts'>['alerts']
APIReturnType<'GET /internal/apm/services/{serviceName}/alerts'>['alerts']
>;
export const APMServiceContext = createContext<{

View file

@ -29,7 +29,7 @@ export function useServiceAgentFetcher({
(callApmApi) => {
if (serviceName) {
return callApmApi({
endpoint: 'GET /api/apm/services/{serviceName}/agent',
endpoint: 'GET /internal/apm/services/{serviceName}/agent',
params: {
path: { serviceName },
query: { start, end },

View file

@ -41,7 +41,7 @@ export function useServiceAlertsFetcher({
}
return callApmApi({
endpoint: 'GET /api/apm/services/{serviceName}/alerts',
endpoint: 'GET /internal/apm/services/{serviceName}/alerts',
params: {
path: {
serviceName,

View file

@ -22,7 +22,8 @@ export function useServiceTransactionTypesFetcher({
(callApmApi) => {
if (serviceName && start && end) {
return callApmApi({
endpoint: 'GET /api/apm/services/{serviceName}/transaction_types',
endpoint:
'GET /internal/apm/services/{serviceName}/transaction_types',
params: {
path: { serviceName },
query: { start, end },

View file

@ -10,7 +10,7 @@ import { useFetcher } from './use_fetcher';
export function useDynamicIndexPatternFetcher() {
const { data, status } = useFetcher((callApmApi) => {
return callApmApi({
endpoint: 'GET /api/apm/index_pattern/dynamic',
endpoint: 'GET /internal/apm/index_pattern/dynamic',
isCachable: true,
});
}, []);

View file

@ -38,7 +38,7 @@ export function useEnvironmentsFetcher({
(callApmApi) => {
if (start && end) {
return callApmApi({
endpoint: 'GET /api/apm/environments',
endpoint: 'GET /internal/apm/environments',
params: {
query: {
start,

View file

@ -30,7 +30,8 @@ export function useErrorGroupDistributionFetcher({
(callApmApi) => {
if (start && end) {
return callApmApi({
endpoint: 'GET /api/apm/services/{serviceName}/errors/distribution',
endpoint:
'GET /internal/apm/services/{serviceName}/errors/distribution',
params: {
path: { serviceName },
query: {

View file

@ -19,7 +19,7 @@ export function useFallbackToTransactionsFetcher({ kuery }: { kuery: string }) {
const { data = { fallbackToTransactions: false } } = useFetcher(
(callApmApi) => {
return callApmApi({
endpoint: 'GET /api/apm/fallback_to_transactions',
endpoint: 'GET /internal/apm/fallback_to_transactions',
params: {
query: { kuery, start, end },
},

View file

@ -40,7 +40,7 @@ export function useServiceMetricChartsFetcher({
(callApmApi) => {
if (serviceName && start && end && agentName) {
return callApmApi({
endpoint: 'GET /api/apm/services/{serviceName}/metrics/charts',
endpoint: 'GET /internal/apm/services/{serviceName}/metrics/charts',
params: {
path: { serviceName },
query: {

View file

@ -57,7 +57,7 @@ export function useTransactionLatencyChartsFetcher({
) {
return callApmApi({
endpoint:
'GET /api/apm/services/{serviceName}/transactions/charts/latency',
'GET /internal/apm/services/{serviceName}/transactions/charts/latency',
params: {
path: { serviceName },
query: {

View file

@ -51,7 +51,7 @@ export function useTransactionTraceSamplesFetcher({
if (serviceName && start && end && transactionType && transactionName) {
const response = await callApmApi({
endpoint:
'GET /api/apm/services/{serviceName}/transactions/traces/samples',
'GET /internal/apm/services/{serviceName}/transactions/traces/samples',
params: {
path: {
serviceName,

View file

@ -14,7 +14,7 @@ import { APMChartSpec, Coordinate } from '../../typings/timeseries';
import { APIReturnType } from '../services/rest/createCallApmApi';
export type LatencyChartsResponse =
APIReturnType<'GET /api/apm/services/{serviceName}/transactions/charts/latency'>;
APIReturnType<'GET /internal/apm/services/{serviceName}/transactions/charts/latency'>;
export interface LatencyChartData {
currentPeriod?: APMChartSpec<Coordinate>;

View file

@ -41,11 +41,14 @@ describe('callApi', () => {
});
it('should add debug param for APM endpoints', async () => {
await callApi(core, { pathname: `/api/apm/status/server` });
await callApi(core, { pathname: `/internal/apm/status/server` });
expect(core.http.get).toHaveBeenCalledWith('/api/apm/status/server', {
query: { _inspect: true },
});
expect(core.http.get).toHaveBeenCalledWith(
'/internal/apm/status/server',
{
query: { _inspect: true },
}
);
});
it('should not add debug param for non-APM endpoints', async () => {

View file

@ -24,7 +24,7 @@ describe('callApmApi', () => {
it('should format the pathname with the given path params', async () => {
await callApmApi({
endpoint: 'GET /api/apm/{param1}/to/{param2}',
endpoint: 'GET /internal/apm/{param1}/to/{param2}',
params: {
path: {
param1: 'foo',
@ -36,14 +36,14 @@ describe('callApmApi', () => {
expect(callApi).toHaveBeenCalledWith(
{},
expect.objectContaining({
pathname: '/api/apm/foo/to/bar',
pathname: '/internal/apm/foo/to/bar',
})
);
});
it('should add the query parameters to the options object', async () => {
await callApmApi({
endpoint: 'GET /api/apm',
endpoint: 'GET /internal/apm',
params: {
query: {
foo: 'bar',
@ -55,7 +55,7 @@ describe('callApmApi', () => {
expect(callApi).toHaveBeenCalledWith(
{},
expect.objectContaining({
pathname: '/api/apm',
pathname: '/internal/apm',
query: {
foo: 'bar',
bar: 'foo',
@ -66,7 +66,7 @@ describe('callApmApi', () => {
it('should stringify the body and add it to the options object', async () => {
await callApmApi({
endpoint: 'POST /api/apm',
endpoint: 'POST /internal/apm',
params: {
body: {
foo: 'bar',
@ -78,7 +78,7 @@ describe('callApmApi', () => {
expect(callApi).toHaveBeenCalledWith(
{},
expect.objectContaining({
pathname: '/api/apm',
pathname: '/internal/apm',
method: 'post',
body: {
foo: 'bar',

View file

@ -17,7 +17,7 @@ export const fetchObservabilityOverviewPageData = async ({
bucketSize,
}: FetchDataParams): Promise<ApmFetchDataResponse> => {
const data = await callApmApi({
endpoint: 'GET /api/apm/observability_overview',
endpoint: 'GET /internal/apm/observability_overview',
signal: null,
params: {
query: {
@ -52,7 +52,7 @@ export const fetchObservabilityOverviewPageData = async ({
export async function getHasData() {
return await callApmApi({
endpoint: 'GET /api/apm/observability_overview/has_data',
endpoint: 'GET /internal/apm/observability_overview/has_data',
signal: null,
});
}

View file

@ -18,7 +18,7 @@ function fetchOptionsWithDebug(
) {
const debugEnabled =
inspectableEsQueriesEnabled &&
startsWith(fetchOptions.pathname, '/api/apm');
startsWith(fetchOptions.pathname, '/internal/apm');
const { body, ...rest } = fetchOptions;

View file

@ -9,7 +9,7 @@ import { callApmApi } from './createCallApmApi';
export const createStaticIndexPattern = async () => {
return await callApmApi({
endpoint: 'POST /api/apm/index_pattern/static',
endpoint: 'POST /internal/apm/index_pattern/static',
signal: null,
});
};

View file

@ -12,7 +12,7 @@ import { POLICY_ELASTIC_AGENT_ON_CLOUD } from '../../../common/fleet';
import TutorialConfigAgent from './';
import { APIReturnType } from '../../services/rest/createCallApmApi';
export type APIResponseType = APIReturnType<'GET /api/apm/fleet/agents'>;
export type APIResponseType = APIReturnType<'GET /internal/apm/fleet/agents'>;
interface Args {
apmAgent: string;

View file

@ -7,7 +7,7 @@
import { getPolicyOptions } from './get_policy_options';
import { APIReturnType } from '../../services/rest/createCallApmApi';
type APIResponseType = APIReturnType<'GET /api/apm/fleet/agents'>;
type APIResponseType = APIReturnType<'GET /internal/apm/fleet/agents'>;
const policyElasticAgentOnCloudAgent = {
id: 'policy-elastic-agent-on-cloud',

Some files were not shown because too many files have changed in this diff Show more