[APM] Add 'unknown' to EventOutcome (#112077)

This commit is contained in:
Søren Louv-Jansen 2021-09-15 01:23:17 +02:00 committed by GitHub
parent ef16b6a732
commit 6ea75f564c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 6 deletions

View file

@ -304,7 +304,7 @@ exports[`Span ERROR_LOG_MESSAGE 1`] = `undefined`;
exports[`Span ERROR_PAGE_URL 1`] = `undefined`;
exports[`Span EVENT_OUTCOME 1`] = `undefined`;
exports[`Span EVENT_OUTCOME 1`] = `"unknown"`;
exports[`Span FCP_FIELD 1`] = `undefined`;
@ -541,7 +541,7 @@ exports[`Transaction ERROR_LOG_MESSAGE 1`] = `undefined`;
exports[`Transaction ERROR_PAGE_URL 1`] = `undefined`;
exports[`Transaction EVENT_OUTCOME 1`] = `undefined`;
exports[`Transaction EVENT_OUTCOME 1`] = `"unknown"`;
exports[`Transaction FCP_FIELD 1`] = `undefined`;

View file

@ -30,6 +30,7 @@ describe('Transaction', () => {
provider: 'gcp',
region: 'europe-west1',
},
event: { outcome: 'unknown' },
http: {
request: { method: 'GET' },
response: { status_code: 200 },
@ -87,6 +88,7 @@ describe('Span', () => {
provider: 'gcp',
region: 'europe-west1',
},
event: { outcome: 'unknown' },
processor: {
name: 'transaction',
event: 'span',

View file

@ -8,15 +8,15 @@
import React from 'react';
import { EuiBadge, EuiToolTip } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { EventOutcome } from '../../../../../../../typings/es_schemas/raw/fields/event_outcome';
import { useTheme } from '../../../../../../hooks/use_theme';
import { euiStyled } from '../../../../../../../../../../src/plugins/kibana_react/common';
const ResetLineHeight = euiStyled.span`
line-height: initial;
`;
export function FailureBadge({ outcome }: { outcome?: 'success' | 'failure' }) {
export function FailureBadge({ outcome }: { outcome?: EventOutcome }) {
const theme = useTheme();
if (outcome !== 'failure') {

View file

@ -0,0 +1,8 @@
/*
* 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.
*/
export type EventOutcome = 'success' | 'failure' | 'unknown';

View file

@ -6,6 +6,7 @@
*/
import { APMBaseDoc } from './apm_base_doc';
import { EventOutcome } from './fields/event_outcome';
import { Stackframe } from './fields/stackframe';
import { TimestampUs } from './fields/timestamp_us';
@ -17,7 +18,7 @@ interface Processor {
export interface SpanRaw extends APMBaseDoc {
processor: Processor;
trace: { id: string }; // trace is required
event?: { outcome?: 'success' | 'failure' };
event?: { outcome?: EventOutcome };
service: {
name: string;
environment?: string;

View file

@ -8,6 +8,7 @@
import { APMBaseDoc } from './apm_base_doc';
import { Cloud } from './fields/cloud';
import { Container } from './fields/container';
import { EventOutcome } from './fields/event_outcome';
import { Host } from './fields/host';
import { Http } from './fields/http';
import { Kubernetes } from './fields/kubernetes';
@ -28,7 +29,7 @@ export interface TransactionRaw extends APMBaseDoc {
processor: Processor;
timestamp: TimestampUs;
trace: { id: string }; // trace is required
event?: { outcome?: 'success' | 'failure' };
event?: { outcome?: EventOutcome };
transaction: {
duration: { us: number };
id: string;