eas-cli 27.1.0 → 27.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +221 -146
- package/build/analytics/AnalyticsManager.d.ts +2 -0
- package/build/analytics/AnalyticsManager.js +2 -0
- package/build/build/build.d.ts +1 -2
- package/build/build/build.js +3 -4
- package/build/build/freeTierNearLimitAgentUpdatesTip.d.ts +98 -0
- package/build/build/freeTierNearLimitAgentUpdatesTip.js +205 -0
- package/build/build/runBuildAndSubmit.d.ts +2 -0
- package/build/build/runBuildAndSubmit.js +3 -0
- package/build/build/simulatorsLaunchHint.d.ts +7 -0
- package/build/build/simulatorsLaunchHint.js +40 -0
- package/build/commands/build/index.js +8 -1
- package/build/commands/observe/session.js +4 -3
- package/build/commands/observe/trace.d.ts +17 -0
- package/build/commands/observe/trace.js +58 -0
- package/build/commands/observe/traces.d.ts +33 -0
- package/build/commands/observe/traces.js +159 -0
- package/build/credentials/ios/appstore/capabilityIdentifiers.js +6 -3
- package/build/graphql/generated.d.ts +404 -0
- package/build/graphql/mutations/UserPreferenceMutation.d.ts +5 -0
- package/build/graphql/mutations/UserPreferenceMutation.js +24 -0
- package/build/graphql/queries/AccountQuery.d.ts +3 -1
- package/build/graphql/queries/AccountQuery.js +54 -0
- package/build/graphql/queries/ObserveQuery.d.ts +24 -1
- package/build/graphql/queries/ObserveQuery.js +114 -1
- package/build/graphql/queries/UserPreferenceQuery.d.ts +8 -0
- package/build/graphql/queries/UserPreferenceQuery.js +28 -0
- package/build/graphql/types/Observe.d.ts +1 -0
- package/build/graphql/types/Observe.js +53 -1
- package/build/observe/fetchSessions.d.ts +12 -1
- package/build/observe/fetchSessions.js +39 -2
- package/build/observe/fetchSpans.d.ts +27 -0
- package/build/observe/fetchSpans.js +36 -0
- package/build/observe/formatSessions.d.ts +3 -1
- package/build/observe/formatSessions.js +40 -3
- package/build/observe/formatSpans.d.ts +110 -0
- package/build/observe/formatSpans.js +250 -0
- package/build/observe/spanFilters.d.ts +5 -0
- package/build/observe/spanFilters.js +32 -0
- package/oclif.manifest.json +1493 -1143
- package/package.json +7 -7
- package/build/build/freeTierLimitGuidance.d.ts +0 -19
- package/build/build/freeTierLimitGuidance.js +0 -39
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserPreferenceMutation = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
6
|
+
const client_1 = require("../client");
|
|
7
|
+
exports.UserPreferenceMutation = {
|
|
8
|
+
/** Stores the JSON value under the key for the current user. Rejects for robot viewers. */
|
|
9
|
+
async setAsync(graphqlClient, key, value) {
|
|
10
|
+
await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
11
|
+
.mutation((0, graphql_tag_1.default) `
|
|
12
|
+
mutation SetUserPreference($key: String!, $value: JSON!) {
|
|
13
|
+
userPreference {
|
|
14
|
+
set(key: $key, value: $value) {
|
|
15
|
+
id
|
|
16
|
+
key
|
|
17
|
+
value
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
`, { key, value }, { additionalTypenames: ['UserPreference'], noRetry: true })
|
|
22
|
+
.toPromise());
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
-
import { AccountByNameQuery as AccountByNameQueryType, AccountFullUsageQuery as AccountFullUsageQueryType, AccountSubscriptionQuery as AccountSubscriptionQueryType, AccountUsageForOverageWarningQuery } from '../generated';
|
|
2
|
+
import { AccountByNameQuery as AccountByNameQueryType, AccountFreeTierBuildUsageQuery, AccountFullUsageQuery as AccountFullUsageQueryType, AccountSubscriptionQuery as AccountSubscriptionQueryType, AccountUsageForOverageWarningQuery } from '../generated';
|
|
3
3
|
export type AccountFullUsageData = NonNullable<AccountFullUsageQueryType['account']['byId']>;
|
|
4
|
+
export type AccountFreeTierBuildUsageData = NonNullable<AccountFreeTierBuildUsageQuery['account']['byId']>;
|
|
4
5
|
export type AccountSubscriptionInfo = NonNullable<NonNullable<AccountSubscriptionQueryType['account']['byId']>['subscription']>;
|
|
5
6
|
export declare const AccountQuery: {
|
|
6
7
|
getByNameAsync(graphqlClient: ExpoGraphqlClient, accountName: string): Promise<AccountByNameQueryType["account"]["byName"] | null>;
|
|
7
8
|
getFullUsageAsync(graphqlClient: ExpoGraphqlClient, accountId: string, currentDate: Date, startDate: Date, endDate: Date): Promise<AccountFullUsageData>;
|
|
9
|
+
getFreeTierBuildUsageAsync(graphqlClient: ExpoGraphqlClient, accountId: string, currentDate: Date): Promise<AccountFreeTierBuildUsageData>;
|
|
8
10
|
getUsageForOverageWarningAsync(graphqlClient: ExpoGraphqlClient, accountId: string, currentDate: Date): Promise<AccountUsageForOverageWarningQuery["account"]["byId"]>;
|
|
9
11
|
getBillingPeriodAsync(graphqlClient: ExpoGraphqlClient, accountId: string, currentDate: Date): Promise<{
|
|
10
12
|
start: Date;
|
|
@@ -163,6 +163,60 @@ exports.AccountQuery = {
|
|
|
163
163
|
}
|
|
164
164
|
return data.account.byId;
|
|
165
165
|
},
|
|
166
|
+
async getFreeTierBuildUsageAsync(graphqlClient, accountId, currentDate) {
|
|
167
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
168
|
+
.query((0, graphql_tag_1.default) `
|
|
169
|
+
query AccountFreeTierBuildUsage($accountId: String!, $currentDate: DateTime!) {
|
|
170
|
+
account {
|
|
171
|
+
byId(accountId: $accountId) {
|
|
172
|
+
id
|
|
173
|
+
subscription {
|
|
174
|
+
id
|
|
175
|
+
name
|
|
176
|
+
}
|
|
177
|
+
billingPeriod(date: $currentDate) {
|
|
178
|
+
id
|
|
179
|
+
start
|
|
180
|
+
end
|
|
181
|
+
}
|
|
182
|
+
usageMetrics {
|
|
183
|
+
EAS_BUILD: byBillingPeriod(date: $currentDate, service: BUILDS) {
|
|
184
|
+
id
|
|
185
|
+
planMetrics {
|
|
186
|
+
id
|
|
187
|
+
serviceMetric
|
|
188
|
+
metricType
|
|
189
|
+
value
|
|
190
|
+
limit
|
|
191
|
+
platformBreakdown {
|
|
192
|
+
ios {
|
|
193
|
+
value
|
|
194
|
+
limit
|
|
195
|
+
}
|
|
196
|
+
android {
|
|
197
|
+
value
|
|
198
|
+
limit
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
`, { accountId, currentDate: currentDate.toISOString() }, {
|
|
208
|
+
additionalTypenames: [
|
|
209
|
+
'Account',
|
|
210
|
+
'AccountUsageMetrics',
|
|
211
|
+
'UsageMetricTotal',
|
|
212
|
+
'BillingPeriod',
|
|
213
|
+
'EstimatedUsage',
|
|
214
|
+
],
|
|
215
|
+
noRetry: true,
|
|
216
|
+
})
|
|
217
|
+
.toPromise());
|
|
218
|
+
return data.account.byId;
|
|
219
|
+
},
|
|
166
220
|
async getUsageForOverageWarningAsync(graphqlClient, accountId, currentDate) {
|
|
167
221
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
168
222
|
.query((0, graphql_tag_1.default) `
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
-
import { AppObserveAppVersion, AppObserveError, AppObserveErrorGroup, AppObserveErrorOccurrencesFilter, AppObserveErrorOccurrencesOrderBy, AppObserveErrorsGroupsInput, AppObserveLogsOrderBy, AppObserveMetric, AppObserveMetricsListFilter, AppObserveMetricsListOrderBy, AppObserveNavigationFilter, AppObserveNavigationOrderBy, AppObserveNavigationRoute, AppObservePlatform, AppObserveUserEvent, AppObserveUserEventListFilter, AppObserveUserEventListOrderBy, AppObserveUserEventName, PageInfo } from '../generated';
|
|
2
|
+
import { AppObserveAppVersion, AppObserveError, AppObserveErrorGroup, AppObserveErrorOccurrencesFilter, AppObserveErrorOccurrencesOrderBy, AppObserveErrorsGroupsInput, AppObserveLogsOrderBy, AppObserveMetric, AppObserveMetricsListFilter, AppObserveMetricsListOrderBy, AppObserveNavigationFilter, AppObserveNavigationOrderBy, AppObserveNavigationRoute, AppObservePlatform, AppObserveSpan, AppObserveSpanListFilter, AppObserveSpanListOrderBy, AppObserveSpanName, AppObserveSpanNamesInput, AppObserveTrace, AppObserveUserEvent, AppObserveUserEventListFilter, AppObserveUserEventListOrderBy, AppObserveUserEventName, PageInfo } from '../generated';
|
|
3
3
|
/** A `session.logs` node is a user event or an error (the `AppObserveLog` interface). */
|
|
4
4
|
export type AppObserveSessionLog = ({
|
|
5
5
|
__typename: 'AppObserveUserEvent';
|
|
@@ -40,6 +40,18 @@ type AppObserveSessionEventsQueryVariables = {
|
|
|
40
40
|
first?: number;
|
|
41
41
|
metricsOrderBy?: AppObserveMetricsListOrderBy;
|
|
42
42
|
logsOrderBy?: AppObserveLogsOrderBy;
|
|
43
|
+
spansOrderBy?: AppObserveSpanListOrderBy;
|
|
44
|
+
};
|
|
45
|
+
type AppObserveSpanListQueryVariables = {
|
|
46
|
+
appId: string;
|
|
47
|
+
filter: AppObserveSpanListFilter;
|
|
48
|
+
first?: number;
|
|
49
|
+
after?: string;
|
|
50
|
+
orderBy?: AppObserveSpanListOrderBy;
|
|
51
|
+
};
|
|
52
|
+
type AppObserveSpanNamesQueryVariables = {
|
|
53
|
+
appId: string;
|
|
54
|
+
input: AppObserveSpanNamesInput;
|
|
43
55
|
};
|
|
44
56
|
type AppObserveByIdQueryVariables = {
|
|
45
57
|
appId: string;
|
|
@@ -90,9 +102,20 @@ export declare const ObserveQuery: {
|
|
|
90
102
|
sessionEventsAsync(graphqlClient: ExpoGraphqlClient, variables: AppObserveSessionEventsQueryVariables): Promise<{
|
|
91
103
|
metrics: AppObserveMetric[];
|
|
92
104
|
logs: AppObserveSessionLog[];
|
|
105
|
+
spans: AppObserveSpan[];
|
|
93
106
|
metricsPageInfo: PageInfo;
|
|
94
107
|
logsPageInfo: PageInfo;
|
|
108
|
+
spansPageInfo: PageInfo;
|
|
109
|
+
}>;
|
|
110
|
+
spanListAsync(graphqlClient: ExpoGraphqlClient, variables: AppObserveSpanListQueryVariables): Promise<{
|
|
111
|
+
spans: AppObserveSpan[];
|
|
112
|
+
pageInfo: PageInfo;
|
|
113
|
+
}>;
|
|
114
|
+
spanNamesAsync(graphqlClient: ExpoGraphqlClient, variables: AppObserveSpanNamesQueryVariables): Promise<{
|
|
115
|
+
names: AppObserveSpanName[];
|
|
116
|
+
isTruncated: boolean;
|
|
95
117
|
}>;
|
|
118
|
+
traceByIdAsync(graphqlClient: ExpoGraphqlClient, { appId, id }: AppObserveByIdQueryVariables): Promise<AppObserveTrace | null>;
|
|
96
119
|
metricByIdAsync(graphqlClient: ExpoGraphqlClient, { appId, id }: AppObserveByIdQueryVariables): Promise<AppObserveMetric | null>;
|
|
97
120
|
logByIdAsync(graphqlClient: ExpoGraphqlClient, { appId, id }: AppObserveByIdQueryVariables): Promise<AppObserveSessionLog | null>;
|
|
98
121
|
};
|
|
@@ -293,6 +293,7 @@ exports.ObserveQuery = {
|
|
|
293
293
|
$first: Int
|
|
294
294
|
$metricsOrderBy: AppObserveMetricsListOrderBy
|
|
295
295
|
$logsOrderBy: AppObserveLogsOrderBy
|
|
296
|
+
$spansOrderBy: AppObserveSpanListOrderBy
|
|
296
297
|
) {
|
|
297
298
|
app {
|
|
298
299
|
byId(appId: $appId) {
|
|
@@ -332,6 +333,19 @@ exports.ObserveQuery = {
|
|
|
332
333
|
}
|
|
333
334
|
}
|
|
334
335
|
}
|
|
336
|
+
spans(first: $first, orderBy: $spansOrderBy) {
|
|
337
|
+
pageInfo {
|
|
338
|
+
hasNextPage
|
|
339
|
+
hasPreviousPage
|
|
340
|
+
endCursor
|
|
341
|
+
}
|
|
342
|
+
edges {
|
|
343
|
+
node {
|
|
344
|
+
id
|
|
345
|
+
...AppObserveSpanFragment
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
335
349
|
}
|
|
336
350
|
}
|
|
337
351
|
}
|
|
@@ -340,16 +354,115 @@ exports.ObserveQuery = {
|
|
|
340
354
|
${(0, graphql_1.print)(Observe_1.AppObserveMetricFragmentNode)}
|
|
341
355
|
${(0, graphql_1.print)(Observe_1.AppObserveUserEventFragmentNode)}
|
|
342
356
|
${(0, graphql_1.print)(Observe_1.AppObserveErrorFragmentNode)}
|
|
357
|
+
${(0, graphql_1.print)(Observe_1.AppObserveSpanFragmentNode)}
|
|
343
358
|
`, variables)
|
|
344
359
|
.toPromise());
|
|
345
|
-
const { metrics, logs } = data.app.byId.observe.session;
|
|
360
|
+
const { metrics, logs, spans } = data.app.byId.observe.session;
|
|
346
361
|
return {
|
|
347
362
|
metrics: metrics.edges.map(edge => edge.node),
|
|
348
363
|
logs: logs.edges.map(edge => edge.node),
|
|
364
|
+
spans: spans.edges.map(edge => edge.node),
|
|
349
365
|
metricsPageInfo: metrics.pageInfo,
|
|
350
366
|
logsPageInfo: logs.pageInfo,
|
|
367
|
+
spansPageInfo: spans.pageInfo,
|
|
351
368
|
};
|
|
352
369
|
},
|
|
370
|
+
async spanListAsync(graphqlClient, variables) {
|
|
371
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
372
|
+
.query((0, graphql_tag_1.default) `
|
|
373
|
+
query AppObserveSpanList(
|
|
374
|
+
$appId: String!
|
|
375
|
+
$filter: AppObserveSpanListFilter!
|
|
376
|
+
$first: Int
|
|
377
|
+
$after: String
|
|
378
|
+
$orderBy: AppObserveSpanListOrderBy
|
|
379
|
+
) {
|
|
380
|
+
app {
|
|
381
|
+
byId(appId: $appId) {
|
|
382
|
+
id
|
|
383
|
+
observe {
|
|
384
|
+
traces {
|
|
385
|
+
spans(filter: $filter, first: $first, after: $after, orderBy: $orderBy) {
|
|
386
|
+
pageInfo {
|
|
387
|
+
hasNextPage
|
|
388
|
+
hasPreviousPage
|
|
389
|
+
endCursor
|
|
390
|
+
}
|
|
391
|
+
edges {
|
|
392
|
+
cursor
|
|
393
|
+
node {
|
|
394
|
+
id
|
|
395
|
+
...AppObserveSpanFragment
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
${(0, graphql_1.print)(Observe_1.AppObserveSpanFragmentNode)}
|
|
405
|
+
`, variables)
|
|
406
|
+
.toPromise());
|
|
407
|
+
const { edges, pageInfo } = data.app.byId.observe.traces.spans;
|
|
408
|
+
return {
|
|
409
|
+
spans: edges.map(edge => edge.node),
|
|
410
|
+
pageInfo,
|
|
411
|
+
};
|
|
412
|
+
},
|
|
413
|
+
async spanNamesAsync(graphqlClient, variables) {
|
|
414
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
415
|
+
.query((0, graphql_tag_1.default) `
|
|
416
|
+
query AppObserveSpanNames($appId: String!, $input: AppObserveSpanNamesInput!) {
|
|
417
|
+
app {
|
|
418
|
+
byId(appId: $appId) {
|
|
419
|
+
id
|
|
420
|
+
observe {
|
|
421
|
+
traces {
|
|
422
|
+
names(input: $input) {
|
|
423
|
+
isTruncated
|
|
424
|
+
names {
|
|
425
|
+
name
|
|
426
|
+
kind
|
|
427
|
+
count
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
`, variables)
|
|
436
|
+
.toPromise());
|
|
437
|
+
return data.app.byId.observe.traces.names;
|
|
438
|
+
},
|
|
439
|
+
async traceByIdAsync(graphqlClient, { appId, id }) {
|
|
440
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
441
|
+
.query((0, graphql_tag_1.default) `
|
|
442
|
+
query AppObserveTraceById($appId: String!, $id: ID!) {
|
|
443
|
+
app {
|
|
444
|
+
byId(appId: $appId) {
|
|
445
|
+
id
|
|
446
|
+
observe {
|
|
447
|
+
traces {
|
|
448
|
+
trace(id: $id) {
|
|
449
|
+
id
|
|
450
|
+
isTruncated
|
|
451
|
+
spans {
|
|
452
|
+
id
|
|
453
|
+
...AppObserveSpanFragment
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
${(0, graphql_1.print)(Observe_1.AppObserveSpanFragmentNode)}
|
|
462
|
+
`, { appId, id })
|
|
463
|
+
.toPromise());
|
|
464
|
+
return data.app.byId.observe.traces.trace ?? null;
|
|
465
|
+
},
|
|
353
466
|
async metricByIdAsync(graphqlClient, { appId, id }) {
|
|
354
467
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
355
468
|
.query((0, graphql_tag_1.default) `
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
+
export declare const UserPreferenceQuery: {
|
|
3
|
+
/**
|
|
4
|
+
* Returns the JSON value stored under the key for the current user, or null when the key is not
|
|
5
|
+
* set or the viewer is not a user (for example a robot).
|
|
6
|
+
*/
|
|
7
|
+
getValueAsync(graphqlClient: ExpoGraphqlClient, key: string): Promise<unknown>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserPreferenceQuery = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
6
|
+
const client_1 = require("../client");
|
|
7
|
+
exports.UserPreferenceQuery = {
|
|
8
|
+
/**
|
|
9
|
+
* Returns the JSON value stored under the key for the current user, or null when the key is not
|
|
10
|
+
* set or the viewer is not a user (for example a robot).
|
|
11
|
+
*/
|
|
12
|
+
async getValueAsync(graphqlClient, key) {
|
|
13
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
14
|
+
.query((0, graphql_tag_1.default) `
|
|
15
|
+
query UserPreferenceByKey($key: String!) {
|
|
16
|
+
userPreference {
|
|
17
|
+
get(key: $key) {
|
|
18
|
+
id
|
|
19
|
+
key
|
|
20
|
+
value
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`, { key }, { additionalTypenames: ['UserPreference'], noRetry: true })
|
|
25
|
+
.toPromise());
|
|
26
|
+
return data.userPreference.get?.value ?? null;
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -4,3 +4,4 @@ export declare const AppObserveErrorOccurrenceFragmentNode: import("graphql").Do
|
|
|
4
4
|
export declare const AppObserveMetricFragmentNode: import("graphql").DocumentNode;
|
|
5
5
|
export declare const AppObserveErrorGroupFragmentNode: import("graphql").DocumentNode;
|
|
6
6
|
export declare const AppObserveAppVersionFragmentNode: import("graphql").DocumentNode;
|
|
7
|
+
export declare const AppObserveSpanFragmentNode: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AppObserveAppVersionFragmentNode = exports.AppObserveErrorGroupFragmentNode = exports.AppObserveMetricFragmentNode = exports.AppObserveErrorOccurrenceFragmentNode = exports.AppObserveErrorFragmentNode = exports.AppObserveUserEventFragmentNode = void 0;
|
|
3
|
+
exports.AppObserveSpanFragmentNode = exports.AppObserveAppVersionFragmentNode = exports.AppObserveErrorGroupFragmentNode = exports.AppObserveMetricFragmentNode = exports.AppObserveErrorOccurrenceFragmentNode = exports.AppObserveErrorFragmentNode = exports.AppObserveUserEventFragmentNode = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
6
6
|
exports.AppObserveUserEventFragmentNode = (0, graphql_tag_1.default) `
|
|
@@ -168,3 +168,55 @@ exports.AppObserveAppVersionFragmentNode = (0, graphql_tag_1.default) `
|
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
`;
|
|
171
|
+
exports.AppObserveSpanFragmentNode = (0, graphql_tag_1.default) `
|
|
172
|
+
fragment AppObserveSpanFragment on AppObserveSpan {
|
|
173
|
+
id
|
|
174
|
+
traceId
|
|
175
|
+
spanId
|
|
176
|
+
parentSpanId
|
|
177
|
+
name
|
|
178
|
+
kind
|
|
179
|
+
startTimestamp
|
|
180
|
+
endTimestamp
|
|
181
|
+
durationMs
|
|
182
|
+
statusCode
|
|
183
|
+
statusMessage
|
|
184
|
+
sessionId
|
|
185
|
+
http {
|
|
186
|
+
method
|
|
187
|
+
statusCode
|
|
188
|
+
urlHost
|
|
189
|
+
urlFull
|
|
190
|
+
protocolVersion
|
|
191
|
+
requestSize
|
|
192
|
+
responseSize
|
|
193
|
+
errorType
|
|
194
|
+
}
|
|
195
|
+
attributes {
|
|
196
|
+
key
|
|
197
|
+
value
|
|
198
|
+
type
|
|
199
|
+
}
|
|
200
|
+
events {
|
|
201
|
+
name
|
|
202
|
+
timestamp
|
|
203
|
+
attributes
|
|
204
|
+
}
|
|
205
|
+
droppedAttributesCount
|
|
206
|
+
droppedEventsCount
|
|
207
|
+
droppedLinksCount
|
|
208
|
+
ingestedAt
|
|
209
|
+
appVersion
|
|
210
|
+
appBuildNumber
|
|
211
|
+
appUpdateId
|
|
212
|
+
appEasBuildId
|
|
213
|
+
expoSdkVersion
|
|
214
|
+
reactNativeVersion
|
|
215
|
+
deviceOs
|
|
216
|
+
deviceOsVersion
|
|
217
|
+
deviceModel
|
|
218
|
+
environment
|
|
219
|
+
easClientId
|
|
220
|
+
countryCode
|
|
221
|
+
}
|
|
222
|
+
`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
2
|
import { AppObserveMetric, AppObserveUserEvent } from '../graphql/generated';
|
|
3
3
|
export interface SessionEventEntry {
|
|
4
|
-
source: 'metric' | 'log';
|
|
4
|
+
source: 'metric' | 'log' | 'span';
|
|
5
5
|
id: string;
|
|
6
6
|
timestamp: string;
|
|
7
7
|
sessionId: string;
|
|
@@ -27,6 +27,16 @@ export interface SessionEventEntry {
|
|
|
27
27
|
type: string;
|
|
28
28
|
}>;
|
|
29
29
|
environment?: string | null;
|
|
30
|
+
traceId?: string;
|
|
31
|
+
spanId?: string;
|
|
32
|
+
parentSpanId?: string | null;
|
|
33
|
+
durationMs?: number;
|
|
34
|
+
statusCode?: string;
|
|
35
|
+
httpMethod?: string | null;
|
|
36
|
+
httpStatusCode?: number | null;
|
|
37
|
+
httpErrorType?: string | null;
|
|
38
|
+
urlHost?: string | null;
|
|
39
|
+
urlFull?: string | null;
|
|
30
40
|
}
|
|
31
41
|
export interface SessionMetadata {
|
|
32
42
|
appVersion: string;
|
|
@@ -48,6 +58,7 @@ export interface FetchSessionEventsResult {
|
|
|
48
58
|
metadata: SessionMetadata | null;
|
|
49
59
|
hasMoreMetricEvents: boolean;
|
|
50
60
|
hasMoreLogEvents: boolean;
|
|
61
|
+
hasMoreSpans: boolean;
|
|
51
62
|
}
|
|
52
63
|
/**
|
|
53
64
|
* Issues a throwaway session-scoped query so the server-side session-timeline
|
|
@@ -74,6 +74,34 @@ function errorToEntry(event) {
|
|
|
74
74
|
environment: event.environment ?? null,
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
+
function spanToEntry(span) {
|
|
78
|
+
return {
|
|
79
|
+
source: 'span',
|
|
80
|
+
id: span.id,
|
|
81
|
+
timestamp: span.startTimestamp,
|
|
82
|
+
sessionId: span.sessionId ?? '',
|
|
83
|
+
name: span.name,
|
|
84
|
+
appVersion: span.appVersion,
|
|
85
|
+
appBuildNumber: span.appBuildNumber,
|
|
86
|
+
appUpdateId: span.appUpdateId ?? null,
|
|
87
|
+
deviceModel: span.deviceModel,
|
|
88
|
+
deviceOs: span.deviceOs,
|
|
89
|
+
deviceOsVersion: span.deviceOsVersion,
|
|
90
|
+
countryCode: span.countryCode ?? null,
|
|
91
|
+
easClientId: span.easClientId,
|
|
92
|
+
environment: span.environment ?? null,
|
|
93
|
+
traceId: span.traceId,
|
|
94
|
+
spanId: span.spanId,
|
|
95
|
+
parentSpanId: span.parentSpanId ?? null,
|
|
96
|
+
durationMs: span.durationMs,
|
|
97
|
+
statusCode: span.statusCode,
|
|
98
|
+
httpMethod: span.http?.method ?? null,
|
|
99
|
+
httpStatusCode: span.http?.statusCode ?? null,
|
|
100
|
+
httpErrorType: span.http?.errorType ?? null,
|
|
101
|
+
urlHost: span.http?.urlHost ?? null,
|
|
102
|
+
urlFull: span.http?.urlFull ?? null,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
77
105
|
function sessionLogToEntry(log) {
|
|
78
106
|
return log.__typename === 'AppObserveError' ? errorToEntry(log) : userEventToEntry(log);
|
|
79
107
|
}
|
|
@@ -93,7 +121,7 @@ async function verifyObserveSessionAccessAsync(graphqlClient, appId) {
|
|
|
93
121
|
});
|
|
94
122
|
}
|
|
95
123
|
async function fetchObserveSessionEventsAsync(graphqlClient, appId, options) {
|
|
96
|
-
const { metrics, logs, metricsPageInfo, logsPageInfo } = await ObserveQuery_1.ObserveQuery.sessionEventsAsync(graphqlClient, {
|
|
124
|
+
const { metrics, logs, spans, metricsPageInfo, logsPageInfo, spansPageInfo } = await ObserveQuery_1.ObserveQuery.sessionEventsAsync(graphqlClient, {
|
|
97
125
|
appId,
|
|
98
126
|
id: options.sessionId,
|
|
99
127
|
first: options.limit,
|
|
@@ -105,8 +133,16 @@ async function fetchObserveSessionEventsAsync(graphqlClient, appId, options) {
|
|
|
105
133
|
field: generated_1.AppObserveLogsOrderByField.Timestamp,
|
|
106
134
|
direction: generated_1.AppObserveOrderDirection.Asc,
|
|
107
135
|
},
|
|
136
|
+
spansOrderBy: {
|
|
137
|
+
field: generated_1.AppObserveSpanListOrderByField.StartTimestamp,
|
|
138
|
+
direction: generated_1.AppObserveOrderDirection.Asc,
|
|
139
|
+
},
|
|
108
140
|
});
|
|
109
|
-
const entries = [
|
|
141
|
+
const entries = [
|
|
142
|
+
...metrics.map(metricEventToEntry),
|
|
143
|
+
...logs.map(sessionLogToEntry),
|
|
144
|
+
...spans.map(spanToEntry),
|
|
145
|
+
].sort((a, b) => (a.timestamp < b.timestamp ? -1 : a.timestamp > b.timestamp ? 1 : 0));
|
|
110
146
|
let metadata = null;
|
|
111
147
|
if (entries.length > 0) {
|
|
112
148
|
const newest = entries[entries.length - 1];
|
|
@@ -127,6 +163,7 @@ async function fetchObserveSessionEventsAsync(graphqlClient, appId, options) {
|
|
|
127
163
|
metadata,
|
|
128
164
|
hasMoreMetricEvents: metricsPageInfo.hasNextPage,
|
|
129
165
|
hasMoreLogEvents: logsPageInfo.hasNextPage,
|
|
166
|
+
hasMoreSpans: spansPageInfo.hasNextPage,
|
|
130
167
|
};
|
|
131
168
|
}
|
|
132
169
|
/**
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
+
import { AppObservePlatform, AppObserveSpan, AppObserveSpanKind, AppObserveSpanListOrderBy, AppObserveSpanStatusCode, PageInfo } from '../graphql/generated';
|
|
3
|
+
export interface FetchSpansOptions {
|
|
4
|
+
limit: number;
|
|
5
|
+
after?: string;
|
|
6
|
+
startTime: string;
|
|
7
|
+
endTime: string;
|
|
8
|
+
platforms?: AppObservePlatform[];
|
|
9
|
+
appVersion?: string;
|
|
10
|
+
buildNumber?: string;
|
|
11
|
+
updateId?: string;
|
|
12
|
+
environment?: string;
|
|
13
|
+
sessionId?: string;
|
|
14
|
+
names?: string[];
|
|
15
|
+
kinds?: AppObserveSpanKind[];
|
|
16
|
+
statusCodes?: AppObserveSpanStatusCode[];
|
|
17
|
+
hosts?: string[];
|
|
18
|
+
httpStatusCodes?: number[];
|
|
19
|
+
minDurationMs?: number;
|
|
20
|
+
rootOnly?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare const NEWEST_SPANS_FIRST: AppObserveSpanListOrderBy;
|
|
23
|
+
export interface FetchSpansResult {
|
|
24
|
+
spans: AppObserveSpan[];
|
|
25
|
+
pageInfo: PageInfo;
|
|
26
|
+
}
|
|
27
|
+
export declare function fetchObserveSpansAsync(graphqlClient: ExpoGraphqlClient, appId: string, options: FetchSpansOptions): Promise<FetchSpansResult>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NEWEST_SPANS_FIRST = void 0;
|
|
4
|
+
exports.fetchObserveSpansAsync = fetchObserveSpansAsync;
|
|
5
|
+
const generated_1 = require("../graphql/generated");
|
|
6
|
+
const ObserveQuery_1 = require("../graphql/queries/ObserveQuery");
|
|
7
|
+
exports.NEWEST_SPANS_FIRST = {
|
|
8
|
+
field: generated_1.AppObserveSpanListOrderByField.StartTimestamp,
|
|
9
|
+
direction: generated_1.AppObserveOrderDirection.Desc,
|
|
10
|
+
};
|
|
11
|
+
async function fetchObserveSpansAsync(graphqlClient, appId, options) {
|
|
12
|
+
const filter = {
|
|
13
|
+
startTime: options.startTime,
|
|
14
|
+
endTime: options.endTime,
|
|
15
|
+
...(options.platforms?.length && { platforms: options.platforms }),
|
|
16
|
+
...(options.appVersion && { appVersion: options.appVersion }),
|
|
17
|
+
...(options.buildNumber && { appBuildNumber: options.buildNumber }),
|
|
18
|
+
...(options.updateId && { appUpdateId: options.updateId }),
|
|
19
|
+
...(options.environment && { environment: options.environment }),
|
|
20
|
+
...(options.sessionId && { sessionId: options.sessionId }),
|
|
21
|
+
...(options.names?.length && { names: options.names }),
|
|
22
|
+
...(options.kinds?.length && { kinds: options.kinds }),
|
|
23
|
+
...(options.statusCodes?.length && { statusCodes: options.statusCodes }),
|
|
24
|
+
...(options.hosts?.length && { hosts: options.hosts }),
|
|
25
|
+
...(options.httpStatusCodes?.length && { httpStatusCodes: options.httpStatusCodes }),
|
|
26
|
+
...(options.minDurationMs != null && { minDurationMs: options.minDurationMs }),
|
|
27
|
+
...(options.rootOnly && { rootOnly: true }),
|
|
28
|
+
};
|
|
29
|
+
return await ObserveQuery_1.ObserveQuery.spanListAsync(graphqlClient, {
|
|
30
|
+
appId,
|
|
31
|
+
filter,
|
|
32
|
+
first: options.limit,
|
|
33
|
+
orderBy: exports.NEWEST_SPANS_FIRST,
|
|
34
|
+
...(options.after && { after: options.after }),
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -4,6 +4,7 @@ export interface BuildSessionEventsOptions {
|
|
|
4
4
|
metadata?: SessionMetadata | null;
|
|
5
5
|
hasMoreMetricEvents?: boolean;
|
|
6
6
|
hasMoreLogEvents?: boolean;
|
|
7
|
+
hasMoreSpans?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export declare function buildObserveSessionEventsTable(entries: SessionEventEntry[], options?: BuildSessionEventsOptions): string;
|
|
9
10
|
export interface ObserveSessionEventsJson {
|
|
@@ -12,8 +13,9 @@ export interface ObserveSessionEventsJson {
|
|
|
12
13
|
entries: SessionEventEntry[];
|
|
13
14
|
hasMoreMetricEvents: boolean;
|
|
14
15
|
hasMoreLogEvents: boolean;
|
|
16
|
+
hasMoreSpans: boolean;
|
|
15
17
|
}
|
|
16
|
-
export declare function buildObserveSessionEventsJson(entries: SessionEventEntry[], sessionId: string, metadata: SessionMetadata | null, hasMoreMetricEvents: boolean, hasMoreLogEvents: boolean): ObserveSessionEventsJson;
|
|
18
|
+
export declare function buildObserveSessionEventsJson(entries: SessionEventEntry[], sessionId: string, metadata: SessionMetadata | null, hasMoreMetricEvents: boolean, hasMoreLogEvents: boolean, hasMoreSpans: boolean): ObserveSessionEventsJson;
|
|
17
19
|
/**
|
|
18
20
|
* Compact session ID for display in candidate lists — long UUIDs are
|
|
19
21
|
* truncated to `<first-8>…<last-4>` so a row stays scannable.
|