[7.x] [APM] Change labels of user agent (#39337) (#39567)

* [APM] Change labels of user agent

* Make everything but .name optional in TransactionRaw

* Fall back to os.name if os.full is undefined
This commit is contained in:
Dario Gieselaar 2019-06-25 13:49:20 +02:00 committed by GitHub
parent 4e0a2f4691
commit eff2e101af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 16 deletions

View file

@ -125,8 +125,8 @@ export function StickyTransactionProperties({
const { os, device } = userAgent;
const width = '25%';
stickyProperties.push({
label: i18n.translate('xpack.apm.transactionDetails.browserLabel', {
defaultMessage: 'Browser'
label: i18n.translate('xpack.apm.transactionDetails.userAgentLabel', {
defaultMessage: 'User agent'
}),
val: [userAgent.name, userAgent.version].filter(Boolean).join(' '),
truncated: true,
@ -135,22 +135,27 @@ export function StickyTransactionProperties({
if (os) {
stickyProperties.push({
label: i18n.translate('xpack.apm.transactionDetails.osLabel', {
defaultMessage: 'OS'
label: i18n.translate('xpack.apm.transactionDetails.userAgentOsLabel', {
defaultMessage: 'User agent OS'
}),
val: os.full,
val: os.full || os.name,
truncated: true,
width
});
}
stickyProperties.push({
label: i18n.translate('xpack.apm.transactionDetails.deviceLabel', {
defaultMessage: 'OS'
}),
val: device.name,
width
});
if (device) {
stickyProperties.push({
label: i18n.translate(
'xpack.apm.transactionDetails.userAgentDeviceLabel',
{
defaultMessage: 'User agent device'
}
),
val: device.name,
width
});
}
}
return <StickyProperties stickyProperties={stickyProperties} />;

View file

@ -5,15 +5,15 @@
*/
export interface UserAgent {
device: {
device?: {
name: string;
};
name: string;
name?: string;
original: string;
os?: {
name: string;
version: string;
full: string;
version?: string;
full?: string;
};
version?: string;
}