[APM] fix inconsistencies in ESC type migrations (#32097) (#32253)

* [APM] fix inconsistencies in ESC type migrations

* [APM] audit ESC schema types and removed unused fields

* [APM] removed unused line property type from IStackFrameBase
This commit is contained in:
Oliver Gupte 2019-02-28 15:02:23 -08:00 committed by GitHub
parent ba82d027cd
commit 0008df6bb4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 6 additions and 89 deletions

View file

@ -50,45 +50,6 @@ const transaction: Transaction = {
],
ppid: 0
},
context: {
request: {
headers: {
Accept: '*/*',
'User-Agent': 'Python/3.7 aiohttp/3.3.2',
'Accept-Encoding': 'gzip, deflate'
},
method: 'GET',
http_version: '1.1',
socket: {
remote_address: '172.18.0.12'
},
url: {
protocol: 'http',
hostname: '172.18.0.7',
port: '3000',
full: 'http://172.18.0.7:3000/api/products/3/customers',
pathname: '/api/products/3/customers'
}
},
system: {
hostname: '8acb9c1a71f3',
ip: '172.18.0.7',
platform: 'linux',
architecture: 'amd64'
},
response: {
headers: {
'X-Frame-Options': 'SAMEORIGIN',
Server: 'gunicorn/19.9.0',
Vary: 'Cookie',
'Content-Length': '31646',
Date: 'Tue, 18 Dec 2018 00:14:45 GMT',
'Content-Type': 'application/json; charset=utf-8'
},
status_code: 200
}
},
transaction: {
result: 'HTTP 2xx',
duration: {

View file

@ -5,12 +5,9 @@
*/
import { APMDoc } from './APMDoc';
import { Container } from './fields/Container';
import { Context } from './fields/Context';
import { Host } from './fields/Host';
import { Http } from './fields/Http';
import { Kubernetes } from './fields/Kubernetes';
import { Process } from './fields/Process';
import { Service } from './fields/Service';
import { IStackframe } from './fields/Stackframe';
import { Url } from './fields/Url';
@ -24,18 +21,13 @@ interface Processor {
interface Exception {
message?: string; // either message or type are given
type?: string;
code?: string;
module?: string;
attributes?: unknown;
handled?: boolean;
stacktrace?: IStackframe[];
}
interface Log {
message: string;
param_message?: string;
logger_name?: string;
level?: string;
stacktrace?: IStackframe[];
}
@ -45,7 +37,6 @@ export interface APMError extends APMDoc {
transaction: {
id: string;
sampled?: boolean;
type?: string;
};
error: {
id: string;
@ -57,12 +48,9 @@ export interface APMError extends APMDoc {
};
// Shared by errors and transactions
container?: Container;
context?: Context;
host?: Host;
http?: Http;
kubernetes?: Kubernetes;
process?: Process;
service: Service;
url?: Url;
user?: User;

View file

@ -14,7 +14,9 @@ interface Processor {
export interface Span extends APMDoc {
processor: Processor;
service: { name: string };
service: {
name: string;
};
span: {
action: string;
duration: { us: number };
@ -28,19 +30,13 @@ export interface Span extends APMDoc {
url?: {
original?: string;
};
response?: {
status_code?: number;
};
method?: string;
};
db?: {
instance?: string;
statement?: string;
type?: string;
user?: {
name?: string;
};
};
};
transaction: { id: string };
transaction: {
id: string;
};
}

View file

@ -6,5 +6,4 @@
export interface Context {
page?: { url: string }; // only for RUM agent
[key: string]: unknown;
}

View file

@ -5,8 +5,5 @@
*/
export interface Host {
architecture?: string;
hostname?: string;
ip?: string;
os?: { platform?: string };
}

View file

@ -6,42 +6,21 @@
interface IStackframeBase {
filename: string;
line: {
number: number;
column?: number;
context?: string;
};
abs_path?: string;
colno?: number;
context_line?: string;
function?: string;
library_frame?: boolean;
exclude_from_grouping?: boolean;
module?: string;
context?: {
post?: string[];
pre?: string[];
};
sourcemap?: {
updated?: boolean;
error?: string;
};
vars?: {
[key: string]: unknown;
};
orig?: {
filename?: string;
abs_path?: string;
function?: string;
lineno?: number;
colno?: number;
};
}
interface IStackframeWithoutLineContext extends IStackframeBase {
line: {
number: number;
column?: number;
context: undefined;
};
}
@ -49,7 +28,6 @@ interface IStackframeWithoutLineContext extends IStackframeBase {
export interface IStackframeWithLineContext extends IStackframeBase {
line: {
number: number;
column?: number;
context: string;
};
}

View file

@ -6,6 +6,4 @@
export interface User {
id: string;
username?: string;
email?: string;
}