Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[APM] Remove rate aggregations #114187

Merged
merged 23 commits into from
Oct 14, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixing api tests
cauemarcondes committed Oct 12, 2021
commit 4f0272bd0c0d3f394f1ee2ad6d44caa159c9cbc4
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
const commonQuery = { start: new Date(start).toISOString(), end: new Date(end).toISOString() };
const [serviceInventoryAPIResponse, observabilityOverviewAPIResponse] = await Promise.all([
apmApiClient.readUser({
endpoint: 'GET /api/apm/services',
endpoint: 'GET /internal/apm/services',
params: {
query: {
...commonQuery,
@@ -36,7 +36,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
},
}),
apmApiClient.readUser({
endpoint: `GET /api/apm/observability_overview`,
endpoint: `GET /internal/apm/observability_overview`,
params: {
query: {
...commonQuery,
@@ -65,7 +65,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
describe('when data is not loaded', () => {
it('handles the empty state', async () => {
const response = await apmApiClient.readUser({
endpoint: `GET /api/apm/observability_overview`,
endpoint: `GET /internal/apm/observability_overview`,
params: {
query: {
start: new Date(start).toISOString(),
19 changes: 18 additions & 1 deletion x-pack/test/apm_api_integration/tests/services/throughput.ts
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
comparisonEnd?: string;
}) {
const response = await apmApiClient.readUser({
endpoint: 'GET /api/apm/services/{serviceName}/throughput',
endpoint: 'GET /internal/apm/services/{serviceName}/throughput',
params: {
path: {
serviceName: 'synth-go',
@@ -68,12 +68,19 @@ export default function ApiTest({ getService }: FtrProviderContext) {
before(async () => {
const GO_PROD_RATE = 10;
const GO_DEV_RATE = 5;
const JAVA_PROD_RATE = 20;

const serviceGoProdInstance = service(serviceName, 'production', 'go').instance(
'instance-a'
);
const serviceGoDevInstance = service(serviceName, 'development', 'go').instance(
'instance-b'
);

const serviceJavaInstance = service('synth-java', 'development', 'java').instance(
'instance-c'
);

await traceData.index([
...timerange(start, end)
.interval('1s')
@@ -95,6 +102,16 @@ export default function ApiTest({ getService }: FtrProviderContext) {
.timestamp(timestamp)
.serialize()
),
...timerange(start, end)
.interval('1s')
.rate(JAVA_PROD_RATE)
.flatMap((timestamp) =>
serviceJavaInstance
.transaction('POST /api/product/buy')
.duration(1000)
.timestamp(timestamp)
.serialize()
),
]);
});

Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
backendThroughputChartAPIResponse,
] = await Promise.all([
apmApiClient.readUser({
endpoint: `GET /api/apm/services/{serviceName}/dependencies`,
endpoint: `GET /internal/apm/services/{serviceName}/dependencies`,
params: {
path: { serviceName },
query: {
@@ -43,7 +43,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
},
}),
apmApiClient.readUser({
endpoint: `GET /api/apm/backends/top_backends`,
endpoint: `GET /internal/apm/backends/top_backends`,
params: {
query: {
...commonQuery,
@@ -53,7 +53,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
},
}),
apmApiClient.readUser({
endpoint: `GET /api/apm/backends/{backendName}/charts/throughput`,
endpoint: `GET /internal/apm/backends/{backendName}/charts/throughput`,
params: {
path: { backendName: 'elasticsearch' },
query: {
10 changes: 5 additions & 5 deletions x-pack/test/apm_api_integration/tests/throughput/service_apis.ts
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
serviceInstancesAPIResponse,
] = await Promise.all([
apmApiClient.readUser({
endpoint: 'GET /api/apm/services',
endpoint: 'GET /internal/apm/services',
params: {
query: {
...commonQuery,
@@ -43,7 +43,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
},
}),
apmApiClient.readUser({
endpoint: 'GET /api/apm/services/{serviceName}/throughput',
endpoint: 'GET /internal/apm/services/{serviceName}/throughput',
params: {
path: { serviceName },
query: {
@@ -54,7 +54,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
},
}),
apmApiClient.readUser({
endpoint: `GET /api/apm/services/{serviceName}/transactions/groups/main_statistics`,
endpoint: `GET /internal/apm/services/{serviceName}/transactions/groups/main_statistics`,
params: {
path: { serviceName },
query: {
@@ -66,7 +66,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
},
}),
apmApiClient.readUser({
endpoint: `GET /api/apm/services/{serviceName}/service_overview_instances/main_statistics`,
endpoint: `GET /internal/apm/services/{serviceName}/service_overview_instances/main_statistics`,
params: {
path: { serviceName },
query: {
@@ -79,7 +79,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
}),
// TODO: not using it for now since the instance name is empty for metric documents
// apmApiClient.readUser({
// endpoint: `GET /api/apm/services/{serviceName}/service_overview_instances/detailed_statistics`,
// endpoint: `GET /internal/apm/services/{serviceName}/service_overview_instances/detailed_statistics`,
// params: {
// path: { serviceName },
// query: {