@salesforce/lds-instrumentation 1.128.0 → 1.129.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/dist/ldsInstrumentation.js +101 -79
- package/dist/types/metric-keys.d.ts +12 -0
- package/package.json +1 -1
|
@@ -16,86 +16,86 @@ import { getInstrumentation } from 'o11y/client';
|
|
|
16
16
|
import { adapterUnfulfilledErrorSchema } from 'o11y_schema/sf_lds';
|
|
17
17
|
import { ADAPTER_UNFULFILLED_ERROR, instrument } from 'force/ldsBindings';
|
|
18
18
|
|
|
19
|
-
var SnapshotState;
|
|
20
|
-
(function (SnapshotState) {
|
|
21
|
-
SnapshotState["Fulfilled"] = "Fulfilled";
|
|
22
|
-
SnapshotState["Unfulfilled"] = "Unfulfilled";
|
|
23
|
-
SnapshotState["Error"] = "Error";
|
|
24
|
-
SnapshotState["Pending"] = "Pending";
|
|
25
|
-
SnapshotState["Stale"] = "Stale";
|
|
19
|
+
var SnapshotState;
|
|
20
|
+
(function (SnapshotState) {
|
|
21
|
+
SnapshotState["Fulfilled"] = "Fulfilled";
|
|
22
|
+
SnapshotState["Unfulfilled"] = "Unfulfilled";
|
|
23
|
+
SnapshotState["Error"] = "Error";
|
|
24
|
+
SnapshotState["Pending"] = "Pending";
|
|
25
|
+
SnapshotState["Stale"] = "Stale";
|
|
26
26
|
})(SnapshotState || (SnapshotState = {}));
|
|
27
27
|
|
|
28
|
-
Promise.resolve();
|
|
28
|
+
Promise.resolve();
|
|
29
29
|
|
|
30
|
-
var StoreErrorStatus;
|
|
31
|
-
(function (StoreErrorStatus) {
|
|
32
|
-
StoreErrorStatus[StoreErrorStatus["RESOURCE_NOT_FOUND"] = 404] = "RESOURCE_NOT_FOUND";
|
|
33
|
-
})(StoreErrorStatus || (StoreErrorStatus = {}));
|
|
34
|
-
var StoreRecordType;
|
|
35
|
-
(function (StoreRecordType) {
|
|
36
|
-
StoreRecordType["Error"] = "error";
|
|
37
|
-
})(StoreRecordType || (StoreRecordType = {}));
|
|
38
|
-
var StoreLinkStateValues$1;
|
|
39
|
-
(function (StoreLinkStateValues) {
|
|
40
|
-
StoreLinkStateValues[StoreLinkStateValues["NotPresent"] = 0] = "NotPresent";
|
|
41
|
-
StoreLinkStateValues[StoreLinkStateValues["RefNotPresent"] = 1] = "RefNotPresent";
|
|
42
|
-
StoreLinkStateValues[StoreLinkStateValues["RefPresent"] = 2] = "RefPresent";
|
|
43
|
-
StoreLinkStateValues[StoreLinkStateValues["Null"] = 3] = "Null";
|
|
44
|
-
StoreLinkStateValues[StoreLinkStateValues["Missing"] = 4] = "Missing";
|
|
45
|
-
StoreLinkStateValues[StoreLinkStateValues["Pending"] = 5] = "Pending";
|
|
46
|
-
})(StoreLinkStateValues$1 || (StoreLinkStateValues$1 = {}));
|
|
47
|
-
var StoreResolveResultState;
|
|
48
|
-
(function (StoreResolveResultState) {
|
|
49
|
-
StoreResolveResultState[StoreResolveResultState["Found"] = 0] = "Found";
|
|
50
|
-
StoreResolveResultState[StoreResolveResultState["Error"] = 1] = "Error";
|
|
51
|
-
StoreResolveResultState[StoreResolveResultState["Null"] = 2] = "Null";
|
|
52
|
-
StoreResolveResultState[StoreResolveResultState["NotPresent"] = 3] = "NotPresent";
|
|
53
|
-
StoreResolveResultState[StoreResolveResultState["Stale"] = 4] = "Stale";
|
|
30
|
+
var StoreErrorStatus;
|
|
31
|
+
(function (StoreErrorStatus) {
|
|
32
|
+
StoreErrorStatus[StoreErrorStatus["RESOURCE_NOT_FOUND"] = 404] = "RESOURCE_NOT_FOUND";
|
|
33
|
+
})(StoreErrorStatus || (StoreErrorStatus = {}));
|
|
34
|
+
var StoreRecordType;
|
|
35
|
+
(function (StoreRecordType) {
|
|
36
|
+
StoreRecordType["Error"] = "error";
|
|
37
|
+
})(StoreRecordType || (StoreRecordType = {}));
|
|
38
|
+
var StoreLinkStateValues$1;
|
|
39
|
+
(function (StoreLinkStateValues) {
|
|
40
|
+
StoreLinkStateValues[StoreLinkStateValues["NotPresent"] = 0] = "NotPresent";
|
|
41
|
+
StoreLinkStateValues[StoreLinkStateValues["RefNotPresent"] = 1] = "RefNotPresent";
|
|
42
|
+
StoreLinkStateValues[StoreLinkStateValues["RefPresent"] = 2] = "RefPresent";
|
|
43
|
+
StoreLinkStateValues[StoreLinkStateValues["Null"] = 3] = "Null";
|
|
44
|
+
StoreLinkStateValues[StoreLinkStateValues["Missing"] = 4] = "Missing";
|
|
45
|
+
StoreLinkStateValues[StoreLinkStateValues["Pending"] = 5] = "Pending";
|
|
46
|
+
})(StoreLinkStateValues$1 || (StoreLinkStateValues$1 = {}));
|
|
47
|
+
var StoreResolveResultState;
|
|
48
|
+
(function (StoreResolveResultState) {
|
|
49
|
+
StoreResolveResultState[StoreResolveResultState["Found"] = 0] = "Found";
|
|
50
|
+
StoreResolveResultState[StoreResolveResultState["Error"] = 1] = "Error";
|
|
51
|
+
StoreResolveResultState[StoreResolveResultState["Null"] = 2] = "Null";
|
|
52
|
+
StoreResolveResultState[StoreResolveResultState["NotPresent"] = 3] = "NotPresent";
|
|
53
|
+
StoreResolveResultState[StoreResolveResultState["Stale"] = 4] = "Stale";
|
|
54
54
|
})(StoreResolveResultState || (StoreResolveResultState = {}));
|
|
55
|
-
var HttpStatusCode;
|
|
56
|
-
(function (HttpStatusCode) {
|
|
57
|
-
HttpStatusCode[HttpStatusCode["Ok"] = 200] = "Ok";
|
|
58
|
-
HttpStatusCode[HttpStatusCode["Created"] = 201] = "Created";
|
|
59
|
-
HttpStatusCode[HttpStatusCode["NoContent"] = 204] = "NoContent";
|
|
60
|
-
HttpStatusCode[HttpStatusCode["NotModified"] = 304] = "NotModified";
|
|
61
|
-
HttpStatusCode[HttpStatusCode["BadRequest"] = 400] = "BadRequest";
|
|
62
|
-
HttpStatusCode[HttpStatusCode["Unauthorized"] = 401] = "Unauthorized";
|
|
63
|
-
HttpStatusCode[HttpStatusCode["Forbidden"] = 403] = "Forbidden";
|
|
64
|
-
HttpStatusCode[HttpStatusCode["NotFound"] = 404] = "NotFound";
|
|
65
|
-
HttpStatusCode[HttpStatusCode["ServerError"] = 500] = "ServerError";
|
|
66
|
-
HttpStatusCode[HttpStatusCode["GatewayTimeout"] = 504] = "GatewayTimeout";
|
|
67
|
-
})(HttpStatusCode || (HttpStatusCode = {}));
|
|
68
|
-
var GraphNodeType;
|
|
69
|
-
(function (GraphNodeType) {
|
|
70
|
-
GraphNodeType["Link"] = "Link";
|
|
71
|
-
GraphNodeType["Node"] = "Node";
|
|
72
|
-
GraphNodeType["Error"] = "Error";
|
|
73
|
-
GraphNodeType["Locked"] = "Locked";
|
|
74
|
-
})(GraphNodeType || (GraphNodeType = {}));
|
|
55
|
+
var HttpStatusCode;
|
|
56
|
+
(function (HttpStatusCode) {
|
|
57
|
+
HttpStatusCode[HttpStatusCode["Ok"] = 200] = "Ok";
|
|
58
|
+
HttpStatusCode[HttpStatusCode["Created"] = 201] = "Created";
|
|
59
|
+
HttpStatusCode[HttpStatusCode["NoContent"] = 204] = "NoContent";
|
|
60
|
+
HttpStatusCode[HttpStatusCode["NotModified"] = 304] = "NotModified";
|
|
61
|
+
HttpStatusCode[HttpStatusCode["BadRequest"] = 400] = "BadRequest";
|
|
62
|
+
HttpStatusCode[HttpStatusCode["Unauthorized"] = 401] = "Unauthorized";
|
|
63
|
+
HttpStatusCode[HttpStatusCode["Forbidden"] = 403] = "Forbidden";
|
|
64
|
+
HttpStatusCode[HttpStatusCode["NotFound"] = 404] = "NotFound";
|
|
65
|
+
HttpStatusCode[HttpStatusCode["ServerError"] = 500] = "ServerError";
|
|
66
|
+
HttpStatusCode[HttpStatusCode["GatewayTimeout"] = 504] = "GatewayTimeout";
|
|
67
|
+
})(HttpStatusCode || (HttpStatusCode = {}));
|
|
68
|
+
var GraphNodeType;
|
|
69
|
+
(function (GraphNodeType) {
|
|
70
|
+
GraphNodeType["Link"] = "Link";
|
|
71
|
+
GraphNodeType["Node"] = "Node";
|
|
72
|
+
GraphNodeType["Error"] = "Error";
|
|
73
|
+
GraphNodeType["Locked"] = "Locked";
|
|
74
|
+
})(GraphNodeType || (GraphNodeType = {}));
|
|
75
75
|
|
|
76
|
-
var StoreLinkStateValues;
|
|
77
|
-
(function (StoreLinkStateValues) {
|
|
78
|
-
StoreLinkStateValues[StoreLinkStateValues["NotPresent"] = 0] = "NotPresent";
|
|
79
|
-
StoreLinkStateValues[StoreLinkStateValues["RefNotPresent"] = 1] = "RefNotPresent";
|
|
80
|
-
StoreLinkStateValues[StoreLinkStateValues["RefPresent"] = 2] = "RefPresent";
|
|
81
|
-
StoreLinkStateValues[StoreLinkStateValues["Null"] = 3] = "Null";
|
|
82
|
-
StoreLinkStateValues[StoreLinkStateValues["Missing"] = 4] = "Missing";
|
|
83
|
-
StoreLinkStateValues[StoreLinkStateValues["Pending"] = 5] = "Pending";
|
|
84
|
-
})(StoreLinkStateValues || (StoreLinkStateValues = {}));
|
|
85
|
-
var FragmentReadResultState;
|
|
86
|
-
(function (FragmentReadResultState) {
|
|
87
|
-
FragmentReadResultState[FragmentReadResultState["Missing"] = 0] = "Missing";
|
|
88
|
-
FragmentReadResultState[FragmentReadResultState["Success"] = 1] = "Success";
|
|
89
|
-
FragmentReadResultState[FragmentReadResultState["Error"] = 2] = "Error";
|
|
90
|
-
})(FragmentReadResultState || (FragmentReadResultState = {}));
|
|
91
|
-
({
|
|
92
|
-
state: FragmentReadResultState.Missing,
|
|
93
|
-
});
|
|
94
|
-
// engine version: 0.138.
|
|
76
|
+
var StoreLinkStateValues;
|
|
77
|
+
(function (StoreLinkStateValues) {
|
|
78
|
+
StoreLinkStateValues[StoreLinkStateValues["NotPresent"] = 0] = "NotPresent";
|
|
79
|
+
StoreLinkStateValues[StoreLinkStateValues["RefNotPresent"] = 1] = "RefNotPresent";
|
|
80
|
+
StoreLinkStateValues[StoreLinkStateValues["RefPresent"] = 2] = "RefPresent";
|
|
81
|
+
StoreLinkStateValues[StoreLinkStateValues["Null"] = 3] = "Null";
|
|
82
|
+
StoreLinkStateValues[StoreLinkStateValues["Missing"] = 4] = "Missing";
|
|
83
|
+
StoreLinkStateValues[StoreLinkStateValues["Pending"] = 5] = "Pending";
|
|
84
|
+
})(StoreLinkStateValues || (StoreLinkStateValues = {}));
|
|
85
|
+
var FragmentReadResultState;
|
|
86
|
+
(function (FragmentReadResultState) {
|
|
87
|
+
FragmentReadResultState[FragmentReadResultState["Missing"] = 0] = "Missing";
|
|
88
|
+
FragmentReadResultState[FragmentReadResultState["Success"] = 1] = "Success";
|
|
89
|
+
FragmentReadResultState[FragmentReadResultState["Error"] = 2] = "Error";
|
|
90
|
+
})(FragmentReadResultState || (FragmentReadResultState = {}));
|
|
91
|
+
({
|
|
92
|
+
state: FragmentReadResultState.Missing,
|
|
93
|
+
});
|
|
94
|
+
// engine version: 0.138.3-dee50acf
|
|
95
95
|
|
|
96
|
-
const DurableEnvironmentEventDiscriminator = 'durable';
|
|
97
|
-
function isDurableEnvironmentEvent(event) {
|
|
98
|
-
return (event.type === 'environment' && event.environment === DurableEnvironmentEventDiscriminator);
|
|
96
|
+
const DurableEnvironmentEventDiscriminator = 'durable';
|
|
97
|
+
function isDurableEnvironmentEvent(event) {
|
|
98
|
+
return (event.type === 'environment' && event.environment === DurableEnvironmentEventDiscriminator);
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
/**
|
|
@@ -592,6 +592,18 @@ const GRAPHQL_QUERY_SYNTAX_ERROR_COUNT = 'graphql-query-syntax-error-count';
|
|
|
592
592
|
* Counter to track miscellaneous errors in query
|
|
593
593
|
*/
|
|
594
594
|
const GRAPHQL_QUERY_OTHER_ERROR_COUNT = 'graphql-query-other-error-count';
|
|
595
|
+
/**
|
|
596
|
+
* W-12025795
|
|
597
|
+
* GraphQL metric
|
|
598
|
+
* Counter to track usage of legacy adapter
|
|
599
|
+
*/
|
|
600
|
+
const GRAPHQL_LEGACY_ADAPTER_USAGE_COUNT = 'graphql-legacy-adapter-usage-count';
|
|
601
|
+
/**
|
|
602
|
+
* W-12025795
|
|
603
|
+
* GraphQL metric
|
|
604
|
+
* Counter to track errors in usage of legacy adapter
|
|
605
|
+
*/
|
|
606
|
+
const GRAPHQL_LEGACY_ADAPTER_ERRORS_IN_RESPONSE_COUNT = 'graphql-legacy-adapter-errors-in-response-count';
|
|
595
607
|
|
|
596
608
|
var metricKeys = /*#__PURE__*/Object.freeze({
|
|
597
609
|
__proto__: null,
|
|
@@ -639,7 +651,9 @@ var metricKeys = /*#__PURE__*/Object.freeze({
|
|
|
639
651
|
STORE_GRAPHQL_SIZE_COUNT: STORE_GRAPHQL_SIZE_COUNT,
|
|
640
652
|
GRAPHQL_QUERY_VALIDATION_ERROR_COUNT: GRAPHQL_QUERY_VALIDATION_ERROR_COUNT,
|
|
641
653
|
GRAPHQL_QUERY_SYNTAX_ERROR_COUNT: GRAPHQL_QUERY_SYNTAX_ERROR_COUNT,
|
|
642
|
-
GRAPHQL_QUERY_OTHER_ERROR_COUNT: GRAPHQL_QUERY_OTHER_ERROR_COUNT
|
|
654
|
+
GRAPHQL_QUERY_OTHER_ERROR_COUNT: GRAPHQL_QUERY_OTHER_ERROR_COUNT,
|
|
655
|
+
GRAPHQL_LEGACY_ADAPTER_USAGE_COUNT: GRAPHQL_LEGACY_ADAPTER_USAGE_COUNT,
|
|
656
|
+
GRAPHQL_LEGACY_ADAPTER_ERRORS_IN_RESPONSE_COUNT: GRAPHQL_LEGACY_ADAPTER_ERRORS_IN_RESPONSE_COUNT
|
|
643
657
|
});
|
|
644
658
|
|
|
645
659
|
/**
|
|
@@ -1058,7 +1072,7 @@ function instrumentAdapter(adapter, metadata, adapterInstrumentationOptions) {
|
|
|
1058
1072
|
* Any graphql get adapter specific instrumentation that we need to log
|
|
1059
1073
|
* @param snapshot from either in-memory or built after a network hit
|
|
1060
1074
|
*/
|
|
1061
|
-
function logGraphqlMetrics(snapshot) {
|
|
1075
|
+
function logGraphqlMetrics(snapshot, config) {
|
|
1062
1076
|
// We have both data and error in the returned response
|
|
1063
1077
|
const { data: snapshotData } = snapshot;
|
|
1064
1078
|
if (snapshotData &&
|
|
@@ -1068,6 +1082,14 @@ function logGraphqlMetrics(snapshot) {
|
|
|
1068
1082
|
snapshotData.errors.length > 0) {
|
|
1069
1083
|
ldsInstrumentation.incrementCounter(GET_GRAPHQL_RESPONSE_MIXED);
|
|
1070
1084
|
}
|
|
1085
|
+
if (config && 'useUiApiAdapter' in config && config.useUiApiAdapter === false) {
|
|
1086
|
+
// using legacy adapter
|
|
1087
|
+
ldsInstrumentation.incrementCounter(GRAPHQL_LEGACY_ADAPTER_USAGE_COUNT);
|
|
1088
|
+
if (snapshotData && snapshotData.errors && snapshotData.errors.length > 0) {
|
|
1089
|
+
// track errors in legacy adapter responses
|
|
1090
|
+
ldsInstrumentation.incrementCounter(GRAPHQL_LEGACY_ADAPTER_ERRORS_IN_RESPONSE_COUNT);
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1071
1093
|
if (snapshotData.errors && snapshotData.errors.length > 0) {
|
|
1072
1094
|
// W-12293528 GraphQL metrics
|
|
1073
1095
|
// log counts of returned errors
|
|
@@ -1269,11 +1291,11 @@ function instrumentGraphqlAdapter(instrumentedAdapter) {
|
|
|
1269
1291
|
}
|
|
1270
1292
|
if (isPromise(result)) {
|
|
1271
1293
|
result.then((_snapshot) => {
|
|
1272
|
-
logGraphqlMetrics(_snapshot);
|
|
1294
|
+
logGraphqlMetrics(_snapshot, config);
|
|
1273
1295
|
});
|
|
1274
1296
|
}
|
|
1275
1297
|
else {
|
|
1276
|
-
logGraphqlMetrics(result);
|
|
1298
|
+
logGraphqlMetrics(result, config);
|
|
1277
1299
|
}
|
|
1278
1300
|
return result;
|
|
1279
1301
|
};
|
|
@@ -1406,4 +1428,4 @@ function setStoreEventObservers(store) {
|
|
|
1406
1428
|
const instrumentation = new Instrumentation();
|
|
1407
1429
|
|
|
1408
1430
|
export { Instrumentation, LRUCache, metricKeys as METRIC_KEYS, handleIngestedNewData, handleOnDataOutOfTtlDurationUpdate, incrementCounterMetric, incrementGetRecordNormalInvokeCount, incrementGetRecordNotifyChangeAllowCount, incrementGetRecordNotifyChangeDropCount, incrementNotifyRecordUpdateAvailableAllowCount, incrementNotifyRecordUpdateAvailableDropCount, instrumentAdapter, instrumentLuvio, instrumentMethods, instrumentStoreMethods, instrumentation, setInstrumentationHooks, setLdsAdaptersUiapiInstrumentation, setLdsNetworkAdapterInstrumentation, setStoreEventObservers, setupInstrumentation, updatePercentileHistogramMetric };
|
|
1409
|
-
// version: 1.
|
|
1431
|
+
// version: 1.129.0-caa83ed0e
|
|
@@ -189,3 +189,15 @@ export declare const GRAPHQL_QUERY_SYNTAX_ERROR_COUNT = "graphql-query-syntax-er
|
|
|
189
189
|
* Counter to track miscellaneous errors in query
|
|
190
190
|
*/
|
|
191
191
|
export declare const GRAPHQL_QUERY_OTHER_ERROR_COUNT = "graphql-query-other-error-count";
|
|
192
|
+
/**
|
|
193
|
+
* W-12025795
|
|
194
|
+
* GraphQL metric
|
|
195
|
+
* Counter to track usage of legacy adapter
|
|
196
|
+
*/
|
|
197
|
+
export declare const GRAPHQL_LEGACY_ADAPTER_USAGE_COUNT = "graphql-legacy-adapter-usage-count";
|
|
198
|
+
/**
|
|
199
|
+
* W-12025795
|
|
200
|
+
* GraphQL metric
|
|
201
|
+
* Counter to track errors in usage of legacy adapter
|
|
202
|
+
*/
|
|
203
|
+
export declare const GRAPHQL_LEGACY_ADAPTER_ERRORS_IN_RESPONSE_COUNT = "graphql-legacy-adapter-errors-in-response-count";
|
package/package.json
CHANGED