Skip to content

Commit

Permalink
Revert "Merge pull request #6 from jennypavlova/196161-apmotel-fix-an…
Browse files Browse the repository at this point in the history
…-error-with-mobile-services"

This reverts commit 40d5fa9, reversing
changes made to cba684f.
  • Loading branch information
crespocarlos committed Oct 15, 2024
1 parent 241a62f commit db19165
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
6 changes: 3 additions & 3 deletions packages/kbn-apm-types/src/es_schemas/raw/transaction_raw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface TransactionRaw extends APMBaseDoc {
trace: { id: string }; // trace is required
event?: { outcome?: EventOutcome };
transaction: {
duration?: { us?: number };
duration: { us: number };
id: string;
marks?: {
// "agent": not defined by APM Server - only sent by RUM agent
Expand All @@ -46,12 +46,12 @@ export interface TransactionRaw extends APMBaseDoc {
name?: string;
page?: Page; // special property for RUM: shared by error and transaction
result?: string;
sampled?: boolean;
sampled: boolean;
span_count?: {
started?: number;
dropped?: number;
};
type?: string;
type: string;
custom?: Record<string, unknown>;
message?: {
queue?: { name: string };
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-apm-types/src/es_schemas/ui/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Agent } from './fields/agent';
// and thus it doesn't make sense to treat it as optional
type InnerTransaction = TransactionRaw['transaction'];
interface InnerTransactionWithName extends InnerTransaction {
name?: string;
name: string;
}

export interface Transaction extends TransactionRaw {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ export interface WaterfallTransaction {
event?: { outcome?: EventOutcome };
parent?: { id?: string };
processor: { event: 'transaction' };
transaction?: {
duration?: { us?: number };
transaction: {
duration: { us: number };
id: string;
name?: string;
type?: string;
name: string;
type: string;
result?: string;
};
faas?: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,12 @@ async function getTraceDocsPerPage({
PROCESSOR_EVENT,
] as const);

const requiredTxFields = asMutableArray([TRANSACTION_ID] as const);
const requiredTxFields = asMutableArray([
TRANSACTION_ID,
TRANSACTION_DURATION,
TRANSACTION_NAME,
TRANSACTION_TYPE,
] as const);

const requiredSpanFields = asMutableArray([
SPAN_ID,
Expand All @@ -296,9 +301,6 @@ async function getTraceDocsPerPage({
SPAN_COMPOSITE_SUM,
SPAN_SYNC,
CHILD_ID,
TRANSACTION_NAME,
TRANSACTION_TYPE,
TRANSACTION_DURATION,
] as const);

const body = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,14 @@ export async function getTransaction({
TIMESTAMP_US,
SERVICE_NAME,
TRANSACTION_ID,
] as const);

const optionalFields = asMutableArray([
PROCESSOR_NAME,
SERVICE_LANGUAGE_NAME,
TRANSACTION_DURATION,
TRANSACTION_NAME,
TRANSACTION_SAMPLED,
TRANSACTION_TYPE,
] as const);

const optionalFields = asMutableArray([PROCESSOR_NAME, SERVICE_LANGUAGE_NAME] as const);

const resp = await apmEventClient.search('get_transaction', {
apm: {
sources: [
Expand All @@ -86,7 +83,7 @@ export async function getTransaction({
},
},
fields: [...requiredFields, ...optionalFields],
_source: [SPAN_LINKS, TRANSACTION_AGENT_MARKS, TRANSACTION_NAME],
_source: [SPAN_LINKS, TRANSACTION_AGENT_MARKS],
},
});

Expand Down

0 comments on commit db19165

Please sign in to comment.