mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
parent
e582c96f84
commit
d916a37cdf
13 changed files with 244 additions and 19 deletions
|
@ -15,6 +15,9 @@ export type ApmApplicationMetricFields = Partial<{
|
|||
'system.cpu.total.norm.pct': number;
|
||||
'system.process.memory.rss.bytes': number;
|
||||
'system.process.cpu.total.norm.pct': number;
|
||||
'jvm.memory.heap.used': number;
|
||||
'jvm.memory.non_heap.used': number;
|
||||
'jvm.thread.count': number;
|
||||
}>;
|
||||
|
||||
export type ApmUserAgentFields = Partial<{
|
||||
|
|
|
@ -15,6 +15,7 @@ export class Service extends Entity<ApmFields> {
|
|||
return new Instance({
|
||||
...this.fields,
|
||||
['service.node.name']: instanceName,
|
||||
'host.name': instanceName,
|
||||
'container.id': instanceName,
|
||||
});
|
||||
}
|
||||
|
|
|
@ -70,6 +70,7 @@ describe('simple trace', () => {
|
|||
'agent.name': 'java',
|
||||
'container.id': 'instance-1',
|
||||
'event.outcome': 'success',
|
||||
'host.name': 'instance-1',
|
||||
'processor.event': 'transaction',
|
||||
'processor.name': 'transaction',
|
||||
'service.environment': 'production',
|
||||
|
@ -92,6 +93,7 @@ describe('simple trace', () => {
|
|||
'agent.name': 'java',
|
||||
'container.id': 'instance-1',
|
||||
'event.outcome': 'success',
|
||||
'host.name': 'instance-1',
|
||||
'parent.id': '0000000000000300',
|
||||
'processor.event': 'span',
|
||||
'processor.name': 'transaction',
|
||||
|
|
|
@ -7,6 +7,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"processor.event": "transaction",
|
||||
"processor.name": "transaction",
|
||||
"service.environment": "production",
|
||||
|
@ -24,6 +25,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"parent.id": "0000000000000000",
|
||||
"processor.event": "span",
|
||||
"processor.name": "transaction",
|
||||
|
@ -43,6 +45,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"processor.event": "transaction",
|
||||
"processor.name": "transaction",
|
||||
"service.environment": "production",
|
||||
|
@ -60,6 +63,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"parent.id": "0000000000000004",
|
||||
"processor.event": "span",
|
||||
"processor.name": "transaction",
|
||||
|
@ -79,6 +83,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"processor.event": "transaction",
|
||||
"processor.name": "transaction",
|
||||
"service.environment": "production",
|
||||
|
@ -96,6 +101,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"parent.id": "0000000000000008",
|
||||
"processor.event": "span",
|
||||
"processor.name": "transaction",
|
||||
|
@ -115,6 +121,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"processor.event": "transaction",
|
||||
"processor.name": "transaction",
|
||||
"service.environment": "production",
|
||||
|
@ -132,6 +139,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"parent.id": "0000000000000012",
|
||||
"processor.event": "span",
|
||||
"processor.name": "transaction",
|
||||
|
@ -151,6 +159,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"processor.event": "transaction",
|
||||
"processor.name": "transaction",
|
||||
"service.environment": "production",
|
||||
|
@ -168,6 +177,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"parent.id": "0000000000000016",
|
||||
"processor.event": "span",
|
||||
"processor.name": "transaction",
|
||||
|
@ -187,6 +197,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"processor.event": "transaction",
|
||||
"processor.name": "transaction",
|
||||
"service.environment": "production",
|
||||
|
@ -204,6 +215,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"parent.id": "0000000000000020",
|
||||
"processor.event": "span",
|
||||
"processor.name": "transaction",
|
||||
|
@ -223,6 +235,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"processor.event": "transaction",
|
||||
"processor.name": "transaction",
|
||||
"service.environment": "production",
|
||||
|
@ -240,6 +253,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"parent.id": "0000000000000024",
|
||||
"processor.event": "span",
|
||||
"processor.name": "transaction",
|
||||
|
@ -259,6 +273,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"processor.event": "transaction",
|
||||
"processor.name": "transaction",
|
||||
"service.environment": "production",
|
||||
|
@ -276,6 +291,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"parent.id": "0000000000000028",
|
||||
"processor.event": "span",
|
||||
"processor.name": "transaction",
|
||||
|
@ -295,6 +311,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"processor.event": "transaction",
|
||||
"processor.name": "transaction",
|
||||
"service.environment": "production",
|
||||
|
@ -312,6 +329,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"parent.id": "0000000000000032",
|
||||
"processor.event": "span",
|
||||
"processor.name": "transaction",
|
||||
|
@ -331,6 +349,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"processor.event": "transaction",
|
||||
"processor.name": "transaction",
|
||||
"service.environment": "production",
|
||||
|
@ -348,6 +367,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"parent.id": "0000000000000036",
|
||||
"processor.event": "span",
|
||||
"processor.name": "transaction",
|
||||
|
@ -367,6 +387,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"processor.event": "transaction",
|
||||
"processor.name": "transaction",
|
||||
"service.environment": "production",
|
||||
|
@ -384,6 +405,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"parent.id": "0000000000000040",
|
||||
"processor.event": "span",
|
||||
"processor.name": "transaction",
|
||||
|
@ -403,6 +425,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"processor.event": "transaction",
|
||||
"processor.name": "transaction",
|
||||
"service.environment": "production",
|
||||
|
@ -420,6 +443,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"parent.id": "0000000000000044",
|
||||
"processor.event": "span",
|
||||
"processor.name": "transaction",
|
||||
|
@ -439,6 +463,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"processor.event": "transaction",
|
||||
"processor.name": "transaction",
|
||||
"service.environment": "production",
|
||||
|
@ -456,6 +481,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"parent.id": "0000000000000048",
|
||||
"processor.event": "span",
|
||||
"processor.name": "transaction",
|
||||
|
@ -475,6 +501,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"processor.event": "transaction",
|
||||
"processor.name": "transaction",
|
||||
"service.environment": "production",
|
||||
|
@ -492,6 +519,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"parent.id": "0000000000000052",
|
||||
"processor.event": "span",
|
||||
"processor.name": "transaction",
|
||||
|
@ -511,6 +539,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"processor.event": "transaction",
|
||||
"processor.name": "transaction",
|
||||
"service.environment": "production",
|
||||
|
@ -528,6 +557,7 @@ Array [
|
|||
"agent.name": "java",
|
||||
"container.id": "instance-1",
|
||||
"event.outcome": "success",
|
||||
"host.name": "instance-1",
|
||||
"parent.id": "0000000000000056",
|
||||
"processor.event": "span",
|
||||
"processor.name": "transaction",
|
||||
|
|
|
@ -73,12 +73,12 @@ Object {
|
|||
}
|
||||
`;
|
||||
|
||||
exports[`Error HOST_NAME 1`] = `"my hostname"`;
|
||||
exports[`Error HOST_HOSTNAME 1`] = `"my hostname"`;
|
||||
|
||||
exports[`Error HOST_NAME 1`] = `undefined`;
|
||||
|
||||
exports[`Error HOST_OS_PLATFORM 1`] = `undefined`;
|
||||
|
||||
exports[`Error HOSTNAME 1`] = `undefined`;
|
||||
|
||||
exports[`Error HTTP_REQUEST_METHOD 1`] = `undefined`;
|
||||
|
||||
exports[`Error HTTP_RESPONSE_STATUS_CODE 1`] = `undefined`;
|
||||
|
@ -314,12 +314,12 @@ exports[`Span FID_FIELD 1`] = `undefined`;
|
|||
|
||||
exports[`Span HOST 1`] = `undefined`;
|
||||
|
||||
exports[`Span HOST_HOSTNAME 1`] = `undefined`;
|
||||
|
||||
exports[`Span HOST_NAME 1`] = `undefined`;
|
||||
|
||||
exports[`Span HOST_OS_PLATFORM 1`] = `undefined`;
|
||||
|
||||
exports[`Span HOSTNAME 1`] = `undefined`;
|
||||
|
||||
exports[`Span HTTP_REQUEST_METHOD 1`] = `undefined`;
|
||||
|
||||
exports[`Span HTTP_RESPONSE_STATUS_CODE 1`] = `undefined`;
|
||||
|
@ -555,12 +555,12 @@ Object {
|
|||
}
|
||||
`;
|
||||
|
||||
exports[`Transaction HOST_NAME 1`] = `"my hostname"`;
|
||||
exports[`Transaction HOST_HOSTNAME 1`] = `"my hostname"`;
|
||||
|
||||
exports[`Transaction HOST_NAME 1`] = `undefined`;
|
||||
|
||||
exports[`Transaction HOST_OS_PLATFORM 1`] = `undefined`;
|
||||
|
||||
exports[`Transaction HOSTNAME 1`] = `undefined`;
|
||||
|
||||
exports[`Transaction HTTP_REQUEST_METHOD 1`] = `"GET"`;
|
||||
|
||||
exports[`Transaction HTTP_RESPONSE_STATUS_CODE 1`] = `200`;
|
||||
|
|
|
@ -113,8 +113,8 @@ export const METRICSET_NAME = 'metricset.name';
|
|||
export const LABEL_NAME = 'labels.name';
|
||||
|
||||
export const HOST = 'host';
|
||||
export const HOST_NAME = 'host.hostname';
|
||||
export const HOSTNAME = 'host.name';
|
||||
export const HOST_HOSTNAME = 'host.hostname'; // Do not use. Please use `HOST_NAME` instead.
|
||||
export const HOST_NAME = 'host.name';
|
||||
export const HOST_OS_PLATFORM = 'host.os.platform';
|
||||
export const CONTAINER_ID = 'container.id';
|
||||
export const KUBERNETES = 'kubernetes';
|
||||
|
|
|
@ -17,7 +17,7 @@ import { APIReturnType } from '../../../services/rest/createCallApmApi';
|
|||
|
||||
import {
|
||||
CONTAINER_ID,
|
||||
HOSTNAME,
|
||||
HOST_NAME,
|
||||
SERVICE_NAME,
|
||||
} from '../../../../common/elasticsearch_fieldnames';
|
||||
import { useApmParams } from '../../../hooks/use_apm_params';
|
||||
|
@ -103,7 +103,7 @@ export const getInfrastructureKQLFilter = (
|
|||
|
||||
const infraAttributes = containerIds.length
|
||||
? containerIds.map((id) => `${CONTAINER_ID}: "${id}"`)
|
||||
: hostNames.map((id) => `${HOSTNAME}: "${id}"`);
|
||||
: hostNames.map((id) => `${HOST_NAME}: "${id}"`);
|
||||
|
||||
const infraAttributesJoined = infraAttributes.join(' or ');
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ Object {
|
|||
},
|
||||
"host": Object {
|
||||
"terms": Object {
|
||||
"field": "host.hostname",
|
||||
"field": "host.name",
|
||||
"size": 1,
|
||||
},
|
||||
},
|
||||
|
@ -74,7 +74,7 @@ Object {
|
|||
},
|
||||
"host": Object {
|
||||
"terms": Object {
|
||||
"field": "host.hostname",
|
||||
"field": "host.name",
|
||||
"size": 1,
|
||||
},
|
||||
},
|
||||
|
@ -145,7 +145,7 @@ Object {
|
|||
"top_metrics": Object {
|
||||
"metrics": Array [
|
||||
Object {
|
||||
"field": "host.hostname",
|
||||
"field": "host.name",
|
||||
},
|
||||
],
|
||||
"sort": Object {
|
||||
|
|
|
@ -109,7 +109,7 @@ const getServiceNodes = async ({
|
|||
name: bucket.key as string,
|
||||
cpu: bucket.cpu.value,
|
||||
heapMemory: bucket.heapMemory.value,
|
||||
hostName: bucket.latest.top?.[0]?.metrics?.['host.hostname'] as
|
||||
hostName: bucket.latest.top?.[0]?.metrics?.[HOST_NAME] as
|
||||
| string
|
||||
| null
|
||||
| undefined,
|
||||
|
|
|
@ -12,7 +12,7 @@ import { ProcessorEvent } from '../../../common/processor_event';
|
|||
import {
|
||||
SERVICE_NAME,
|
||||
CONTAINER_ID,
|
||||
HOSTNAME,
|
||||
HOST_NAME,
|
||||
} from '../../../common/elasticsearch_fieldnames';
|
||||
|
||||
export const getServiceInfrastructure = async ({
|
||||
|
@ -57,7 +57,7 @@ export const getServiceInfrastructure = async ({
|
|||
},
|
||||
hostNames: {
|
||||
terms: {
|
||||
field: HOSTNAME,
|
||||
field: HOST_NAME,
|
||||
size: 500,
|
||||
},
|
||||
},
|
||||
|
|
|
@ -106,7 +106,7 @@ export const METRIC_JAVA_GC_TIME = 'jvm.gc.time';
|
|||
export const LABEL_NAME = 'labels.name';
|
||||
|
||||
export const HOST = 'host';
|
||||
export const HOST_NAME = 'host.hostname';
|
||||
export const HOST_HOSTNAME = 'host.hostname';
|
||||
export const HOST_OS_PLATFORM = 'host.os.platform';
|
||||
export const CONTAINER_ID = 'container.id';
|
||||
export const KUBERNETES = 'kubernetes';
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
/*
|
||||
* 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 expect from '@kbn/expect';
|
||||
import { apm, timerange } from '@elastic/apm-synthtrace';
|
||||
import { FtrProviderContext } from '../../common/ftr_provider_context';
|
||||
|
||||
export default function ApiTest({ getService }: FtrProviderContext) {
|
||||
const apmApiClient = getService('apmApiClient');
|
||||
const registry = getService('registry');
|
||||
const synthtraceEsClient = getService('synthtraceEsClient');
|
||||
|
||||
const start = new Date('2021-01-01T00:00:00.000Z').getTime();
|
||||
const end = new Date('2021-01-01T00:15:00.000Z').getTime() - 1;
|
||||
const serviceName = 'synth-go';
|
||||
const instanceName = 'instance-a';
|
||||
|
||||
async function callApi() {
|
||||
return await apmApiClient.readUser({
|
||||
endpoint: 'GET /internal/apm/services/{serviceName}/serviceNodes',
|
||||
params: {
|
||||
path: { serviceName },
|
||||
query: {
|
||||
start: new Date(start).toISOString(),
|
||||
end: new Date(end).toISOString(),
|
||||
kuery: '',
|
||||
environment: 'ENVIRONMENT_ALL',
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
registry.when('Service nodes when data is not loaded', { config: 'basic', archives: [] }, () => {
|
||||
it('handles the empty state', async () => {
|
||||
const response = await callApi();
|
||||
|
||||
expect(response.status).to.be(200);
|
||||
|
||||
expectSnapshot(response.body).toMatchInline(`
|
||||
Object {
|
||||
"serviceNodes": Array [],
|
||||
}
|
||||
`);
|
||||
});
|
||||
});
|
||||
|
||||
registry.when(
|
||||
'Service nodes when data is loaded',
|
||||
{ config: 'basic', archives: ['apm_mappings_only_8.0.0'] },
|
||||
() => {
|
||||
before(async () => {
|
||||
const instance = apm.service(serviceName, 'production', 'go').instance(instanceName);
|
||||
await synthtraceEsClient.index(
|
||||
timerange(start, end)
|
||||
.interval('1m')
|
||||
.rate(1)
|
||||
.flatMap((timestamp) =>
|
||||
instance
|
||||
.appMetrics({
|
||||
'system.process.cpu.total.norm.pct': 1,
|
||||
'jvm.memory.heap.used': 1000,
|
||||
'jvm.memory.non_heap.used': 100,
|
||||
'jvm.thread.count': 25,
|
||||
})
|
||||
.timestamp(timestamp)
|
||||
.serialize()
|
||||
)
|
||||
);
|
||||
});
|
||||
after(() => synthtraceEsClient.clean());
|
||||
|
||||
it('returns service nodes', async () => {
|
||||
const response = await callApi();
|
||||
|
||||
expect(response.status).to.be(200);
|
||||
|
||||
expectSnapshot(response.body).toMatchInline(`
|
||||
Object {
|
||||
"serviceNodes": Array [
|
||||
Object {
|
||||
"cpu": 1,
|
||||
"heapMemory": 1000,
|
||||
"hostName": "instance-a",
|
||||
"name": "instance-a",
|
||||
"nonHeapMemory": 100,
|
||||
"threadCount": 25,
|
||||
},
|
||||
],
|
||||
}
|
||||
`);
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import expect from '@kbn/expect';
|
||||
import { apm, timerange } from '@elastic/apm-synthtrace';
|
||||
import { FtrProviderContext } from '../../common/ftr_provider_context';
|
||||
|
||||
export default function ApiTest({ getService }: FtrProviderContext) {
|
||||
const apmApiClient = getService('apmApiClient');
|
||||
const registry = getService('registry');
|
||||
const synthtraceEsClient = getService('synthtraceEsClient');
|
||||
|
||||
const start = new Date('2021-01-01T00:00:00.000Z').getTime();
|
||||
const end = new Date('2021-01-01T00:15:00.000Z').getTime() - 1;
|
||||
const serviceName = 'synth-go';
|
||||
const instanceName = 'instance-a';
|
||||
|
||||
async function callApi() {
|
||||
return await apmApiClient.readUser({
|
||||
endpoint: 'GET /internal/apm/services/{serviceName}/node/{serviceNodeName}/metadata',
|
||||
params: {
|
||||
path: { serviceName, serviceNodeName: instanceName },
|
||||
query: {
|
||||
start: new Date(start).toISOString(),
|
||||
end: new Date(end).toISOString(),
|
||||
kuery: '',
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
registry.when(
|
||||
'Service node metadata when data is not loaded',
|
||||
{ config: 'basic', archives: [] },
|
||||
() => {
|
||||
it('handles the empty state', async () => {
|
||||
const response = await callApi();
|
||||
|
||||
expect(response.status).to.be(200);
|
||||
|
||||
expectSnapshot(response.body).toMatchInline(`
|
||||
Object {
|
||||
"containerId": "N/A",
|
||||
"host": "N/A",
|
||||
}
|
||||
`);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
registry.when(
|
||||
'Service node metadata when data is loaded',
|
||||
{ config: 'basic', archives: ['apm_mappings_only_8.0.0'] },
|
||||
() => {
|
||||
before(async () => {
|
||||
const instance = apm.service(serviceName, 'production', 'go').instance(instanceName);
|
||||
await synthtraceEsClient.index(
|
||||
timerange(start, end)
|
||||
.interval('1m')
|
||||
.rate(1)
|
||||
.flatMap((timestamp) =>
|
||||
instance
|
||||
.transaction('GET /api/product/list')
|
||||
.timestamp(timestamp)
|
||||
.duration(1000)
|
||||
.success()
|
||||
.serialize()
|
||||
)
|
||||
);
|
||||
});
|
||||
after(() => synthtraceEsClient.clean());
|
||||
|
||||
it('returns service node metadata', async () => {
|
||||
const response = await callApi();
|
||||
|
||||
expect(response.status).to.be(200);
|
||||
|
||||
expectSnapshot(response.body).toMatchInline(`
|
||||
Object {
|
||||
"containerId": "instance-a",
|
||||
"host": "instance-a",
|
||||
}
|
||||
`);
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue