diff --git a/x-pack/legacy/plugins/apm/public/components/shared/MetadataTable/SpanMetadata/__test__/SpanMetadata.test.tsx b/x-pack/legacy/plugins/apm/public/components/shared/MetadataTable/SpanMetadata/__test__/SpanMetadata.test.tsx
index 4b6355034f16a..99d8a0790a816 100644
--- a/x-pack/legacy/plugins/apm/public/components/shared/MetadataTable/SpanMetadata/__test__/SpanMetadata.test.tsx
+++ b/x-pack/legacy/plugins/apm/public/components/shared/MetadataTable/SpanMetadata/__test__/SpanMetadata.test.tsx
@@ -31,11 +31,15 @@ describe('SpanMetadata', () => {
name: 'opbeans-java'
},
span: {
- id: '7efbc7056b746fcb'
+ id: '7efbc7056b746fcb',
+ message: {
+ age: { ms: 1577958057123 },
+ queue: { name: 'queue name' }
+ }
}
} as unknown) as Span;
const output = render(, renderOptions);
- expectTextsInDocument(output, ['Service', 'Agent']);
+ expectTextsInDocument(output, ['Service', 'Agent', 'Message']);
});
});
describe('when a span is presented', () => {
@@ -55,11 +59,15 @@ describe('SpanMetadata', () => {
response: { status_code: 200 }
},
subtype: 'http',
- type: 'external'
+ type: 'external',
+ message: {
+ age: { ms: 1577958057123 },
+ queue: { name: 'queue name' }
+ }
}
} as unknown) as Span;
const output = render(, renderOptions);
- expectTextsInDocument(output, ['Service', 'Agent', 'Span']);
+ expectTextsInDocument(output, ['Service', 'Agent', 'Span', 'Message']);
});
});
describe('when there is no id inside span', () => {
@@ -83,7 +91,7 @@ describe('SpanMetadata', () => {
} as unknown) as Span;
const output = render(, renderOptions);
expectTextsInDocument(output, ['Service', 'Agent']);
- expectTextsNotInDocument(output, ['Span']);
+ expectTextsNotInDocument(output, ['Span', 'Message']);
});
});
});
diff --git a/x-pack/legacy/plugins/apm/public/components/shared/MetadataTable/SpanMetadata/sections.ts b/x-pack/legacy/plugins/apm/public/components/shared/MetadataTable/SpanMetadata/sections.ts
index 7012bbcc8fcea..5a83a9bf4ef9e 100644
--- a/x-pack/legacy/plugins/apm/public/components/shared/MetadataTable/SpanMetadata/sections.ts
+++ b/x-pack/legacy/plugins/apm/public/components/shared/MetadataTable/SpanMetadata/sections.ts
@@ -11,7 +11,8 @@ import {
SPAN,
LABELS,
TRANSACTION,
- TRACE
+ TRACE,
+ MESSAGE_SPAN
} from '../sections';
export const SPAN_METADATA_SECTIONS: Section[] = [
@@ -20,5 +21,6 @@ export const SPAN_METADATA_SECTIONS: Section[] = [
TRANSACTION,
TRACE,
SERVICE,
+ MESSAGE_SPAN,
AGENT
];
diff --git a/x-pack/legacy/plugins/apm/public/components/shared/MetadataTable/TransactionMetadata/__test__/TransactionMetadata.test.tsx b/x-pack/legacy/plugins/apm/public/components/shared/MetadataTable/TransactionMetadata/__test__/TransactionMetadata.test.tsx
index 1fcb093fa0354..93e87e884ea76 100644
--- a/x-pack/legacy/plugins/apm/public/components/shared/MetadataTable/TransactionMetadata/__test__/TransactionMetadata.test.tsx
+++ b/x-pack/legacy/plugins/apm/public/components/shared/MetadataTable/TransactionMetadata/__test__/TransactionMetadata.test.tsx
@@ -35,6 +35,10 @@ function getTransaction() {
notIncluded: 'transaction not included value',
custom: {
someKey: 'custom value'
+ },
+ message: {
+ age: { ms: 1577958057123 },
+ queue: { name: 'queue name' }
}
}
} as unknown) as Transaction;
@@ -59,7 +63,8 @@ describe('TransactionMetadata', () => {
'Agent',
'URL',
'User',
- 'Custom'
+ 'Custom',
+ 'Message'
]);
});
@@ -81,7 +86,9 @@ describe('TransactionMetadata', () => {
'agent.someKey',
'url.someKey',
'user.someKey',
- 'transaction.custom.someKey'
+ 'transaction.custom.someKey',
+ 'transaction.message.age.ms',
+ 'transaction.message.queue.name'
]);
// excluded keys
@@ -109,7 +116,9 @@ describe('TransactionMetadata', () => {
'agent value',
'url value',
'user value',
- 'custom value'
+ 'custom value',
+ '1577958057123',
+ 'queue name'
]);
// excluded values
@@ -138,7 +147,8 @@ describe('TransactionMetadata', () => {
'Process',
'Agent',
'URL',
- 'Custom'
+ 'Custom',
+ 'Message'
]);
});
});
diff --git a/x-pack/legacy/plugins/apm/public/components/shared/MetadataTable/TransactionMetadata/sections.ts b/x-pack/legacy/plugins/apm/public/components/shared/MetadataTable/TransactionMetadata/sections.ts
index 6b30c82bc35a0..18751efc6e1c1 100644
--- a/x-pack/legacy/plugins/apm/public/components/shared/MetadataTable/TransactionMetadata/sections.ts
+++ b/x-pack/legacy/plugins/apm/public/components/shared/MetadataTable/TransactionMetadata/sections.ts
@@ -18,7 +18,8 @@ import {
PAGE,
USER,
USER_AGENT,
- CUSTOM_TRANSACTION
+ CUSTOM_TRANSACTION,
+ MESSAGE_TRANSACTION
} from '../sections';
export const TRANSACTION_METADATA_SECTIONS: Section[] = [
@@ -29,6 +30,7 @@ export const TRANSACTION_METADATA_SECTIONS: Section[] = [
CONTAINER,
SERVICE,
PROCESS,
+ MESSAGE_TRANSACTION,
AGENT,
URL,
{ ...PAGE, key: 'transaction.page' },
diff --git a/x-pack/legacy/plugins/apm/public/components/shared/MetadataTable/sections.ts b/x-pack/legacy/plugins/apm/public/components/shared/MetadataTable/sections.ts
index 403663ce2095a..ac8e9559357e3 100644
--- a/x-pack/legacy/plugins/apm/public/components/shared/MetadataTable/sections.ts
+++ b/x-pack/legacy/plugins/apm/public/components/shared/MetadataTable/sections.ts
@@ -136,3 +136,20 @@ export const CUSTOM_TRANSACTION: Section = {
key: 'transaction.custom',
label: customLabel
};
+
+const messageLabel = i18n.translate(
+ 'xpack.apm.metadataTable.section.messageLabel',
+ {
+ defaultMessage: 'Message'
+ }
+);
+
+export const MESSAGE_TRANSACTION: Section = {
+ key: 'transaction.message',
+ label: messageLabel
+};
+
+export const MESSAGE_SPAN: Section = {
+ key: 'span.message',
+ label: messageLabel
+};
diff --git a/x-pack/legacy/plugins/apm/typings/es_schemas/raw/SpanRaw.ts b/x-pack/legacy/plugins/apm/typings/es_schemas/raw/SpanRaw.ts
index 5e9b72ad0176c..28b73e2bd5c7d 100644
--- a/x-pack/legacy/plugins/apm/typings/es_schemas/raw/SpanRaw.ts
+++ b/x-pack/legacy/plugins/apm/typings/es_schemas/raw/SpanRaw.ts
@@ -42,6 +42,12 @@ export interface SpanRaw extends APMBaseDoc {
[key: string]: unknown;
};
[key: string]: unknown;
+ message?: {
+ queue?: { name: string };
+ age?: { ms: number };
+ body?: string;
+ headers?: Record;
+ };
};
transaction?: {
id: string;
diff --git a/x-pack/legacy/plugins/apm/typings/es_schemas/raw/TransactionRaw.ts b/x-pack/legacy/plugins/apm/typings/es_schemas/raw/TransactionRaw.ts
index 3f2083b523caf..db1e8b3eb4d95 100644
--- a/x-pack/legacy/plugins/apm/typings/es_schemas/raw/TransactionRaw.ts
+++ b/x-pack/legacy/plugins/apm/typings/es_schemas/raw/TransactionRaw.ts
@@ -44,6 +44,12 @@ export interface TransactionRaw extends APMBaseDoc {
};
type: string;
custom?: Record;
+ message?: {
+ queue?: { name: string };
+ age?: { ms: number };
+ body?: string;
+ headers?: Record;
+ };
};
[key: string]: unknown;