@google-cloud/spanner 8.13.0 → 9.1.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 +1 -16
- package/build/src/batch-transaction.js +15 -12
- package/build/src/codec.d.ts +18 -30
- package/build/src/codec.js +197 -79
- package/build/src/common.d.ts +14 -0
- package/build/src/common.js +28 -3
- package/build/src/database.d.ts +31 -41
- package/build/src/database.js +147 -315
- package/build/src/helper.d.ts +12 -0
- package/build/src/helper.js +44 -0
- package/build/src/index.d.ts +24 -8
- package/build/src/index.js +303 -147
- package/build/src/instance.d.ts +15 -2
- package/build/src/instance.js +11 -2
- package/build/src/instrument.d.ts +12 -1
- package/build/src/instrument.js +13 -0
- package/build/src/metrics/constants.d.ts +13 -6
- package/build/src/metrics/constants.js +24 -14
- package/build/src/metrics/external-types.d.ts +14 -0
- package/build/src/metrics/interceptor.js +39 -44
- package/build/src/metrics/metrics-tracer-factory.d.ts +25 -14
- package/build/src/metrics/metrics-tracer-factory.js +119 -78
- package/build/src/metrics/metrics-tracer.d.ts +19 -6
- package/build/src/metrics/metrics-tracer.js +147 -55
- package/build/src/metrics/spanner-metrics-exporter.js +4 -0
- package/build/src/metrics/transform.d.ts +3 -4
- package/build/src/metrics/transform.js +16 -10
- package/build/src/multiplexed-session.d.ts +26 -2
- package/build/src/multiplexed-session.js +39 -11
- package/build/src/partial-result-stream.d.ts +26 -33
- package/build/src/partial-result-stream.js +263 -283
- package/build/src/request-stream-coordinator.d.ts +88 -0
- package/build/src/request-stream-coordinator.js +229 -0
- package/build/src/request_id_header.d.ts +6 -4
- package/build/src/request_id_header.js +24 -24
- package/build/src/session-factory.d.ts +62 -60
- package/build/src/session-factory.js +46 -86
- package/build/src/session-pool.d.ts +97 -227
- package/build/src/session-pool.js +74 -547
- package/build/src/session.js +1 -1
- package/build/src/transaction-runner.js +1 -12
- package/build/src/transaction.d.ts +21 -5
- package/build/src/transaction.js +107 -136
- package/package.json +28 -37
|
@@ -18,9 +18,8 @@ const crypto = require("crypto");
|
|
|
18
18
|
const os = require("os");
|
|
19
19
|
const process = require("process");
|
|
20
20
|
const sdk_metrics_1 = require("@opentelemetry/sdk-metrics");
|
|
21
|
-
const api_1 = require("@opentelemetry/api");
|
|
22
21
|
const resources_1 = require("@opentelemetry/resources");
|
|
23
|
-
const
|
|
22
|
+
const resource_detector_gcp_1 = require("@opentelemetry/resource-detector-gcp");
|
|
24
23
|
const Constants = require("./constants");
|
|
25
24
|
const metrics_tracer_1 = require("./metrics-tracer");
|
|
26
25
|
const version = require('../../../package.json').version;
|
|
@@ -52,10 +51,10 @@ class MetricsTracerFactory {
|
|
|
52
51
|
_clientName;
|
|
53
52
|
_clientUid;
|
|
54
53
|
_location = 'global';
|
|
54
|
+
_locationPromise = null;
|
|
55
|
+
_metricReaders = [];
|
|
55
56
|
_projectId;
|
|
56
|
-
|
|
57
|
-
_currentOperationLastUpdatedMs = new Map();
|
|
58
|
-
_intervalTracerCleanup;
|
|
57
|
+
_attributesCache = new Map();
|
|
59
58
|
static enabled = true;
|
|
60
59
|
/**
|
|
61
60
|
* Private constructor to enforce singleton pattern.
|
|
@@ -67,21 +66,22 @@ class MetricsTracerFactory {
|
|
|
67
66
|
this._projectId = projectId;
|
|
68
67
|
this._clientUid = MetricsTracerFactory._generateClientUId();
|
|
69
68
|
this._clientName = `${Constants.SPANNER_METER_NAME}/${version}`;
|
|
70
|
-
// Only perform async call to retrieve location
|
|
69
|
+
// Only perform async call to retrieve location if metrics are enabled.
|
|
71
70
|
if (MetricsTracerFactory.enabled) {
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
this._locationPromise = MetricsTracerFactory._detectClientLocation()
|
|
72
|
+
.then(location => {
|
|
74
73
|
this._location = location.length > 0 ? location : 'global';
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
return this._location;
|
|
75
|
+
})
|
|
76
|
+
.catch(error => {
|
|
77
|
+
console.warn('Unable to detect location.', error);
|
|
78
|
+
return this._location;
|
|
79
|
+
})
|
|
80
|
+
.finally(() => {
|
|
81
|
+
this._locationPromise = null;
|
|
77
82
|
});
|
|
78
83
|
}
|
|
79
84
|
this._clientHash = MetricsTracerFactory._generateClientHash(this._clientUid);
|
|
80
|
-
// Start the Tracer cleanup task at an interval
|
|
81
|
-
this._intervalTracerCleanup = api_1.context.with(api_1.ROOT_CONTEXT, () => setInterval(this._cleanMetricsTracers.bind(this), Constants.TRACER_CLEANUP_INTERVAL_MS));
|
|
82
|
-
// unref the interval to prevent it from blocking app termination
|
|
83
|
-
// in the event loop
|
|
84
|
-
this._intervalTracerCleanup.unref();
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
87
87
|
* Returns the singleton instance of MetricsTracerFactory.
|
|
@@ -96,30 +96,52 @@ class MetricsTracerFactory {
|
|
|
96
96
|
}
|
|
97
97
|
// Create a singleton instance, enabling/disabling metrics can only be done on the initial call
|
|
98
98
|
if (MetricsTracerFactory._instance === null) {
|
|
99
|
-
MetricsTracerFactory._instance = new MetricsTracerFactory(projectId);
|
|
99
|
+
MetricsTracerFactory._instance = new MetricsTracerFactory(projectId || '');
|
|
100
|
+
}
|
|
101
|
+
else if (projectId && !MetricsTracerFactory._instance._projectId) {
|
|
102
|
+
MetricsTracerFactory._instance._projectId = projectId;
|
|
100
103
|
}
|
|
101
104
|
return MetricsTracerFactory._instance;
|
|
102
105
|
}
|
|
103
106
|
/**
|
|
104
107
|
* Returns the MeterProvider, creating it and metric instruments if not already initialized.
|
|
105
108
|
* Client-wide attributes that are known at this time are cached to be provided to all MetricsTracers.
|
|
109
|
+
*
|
|
110
|
+
* If called again with readers when the existing MeterProvider has none, the provider is
|
|
111
|
+
* recreated with those readers. If readers are already attached, additional readers are ignored.
|
|
112
|
+
*
|
|
106
113
|
* @param readers Optional array of MetricReader instances to attach to the MeterProvider.
|
|
107
114
|
* @returns The OTEL MeterProvider instance.
|
|
108
115
|
*/
|
|
109
116
|
getMeterProvider(readers = []) {
|
|
117
|
+
if (this._meterProvider !== null && readers.length > 0) {
|
|
118
|
+
if (this._metricReaders.length === 0) {
|
|
119
|
+
const staleMeterProvider = this._meterProvider;
|
|
120
|
+
this._meterProvider = null;
|
|
121
|
+
staleMeterProvider.shutdown().catch(error => {
|
|
122
|
+
console.warn('Unable to shut down the previous MeterProvider.', error);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
console.warn('MeterProvider is already initialized with metric readers. The ' +
|
|
127
|
+
'additional readers passed to getMeterProvider() are ignored.');
|
|
128
|
+
}
|
|
129
|
+
}
|
|
110
130
|
if (this._meterProvider === null) {
|
|
111
|
-
const resource =
|
|
131
|
+
const resource = (0, resources_1.resourceFromAttributes)({
|
|
112
132
|
[Constants.MONITORED_RES_LABEL_KEY_PROJECT]: this._projectId,
|
|
113
133
|
[Constants.MONITORED_RES_LABEL_KEY_CLIENT_HASH]: this._clientHash,
|
|
114
|
-
[Constants.MONITORED_RES_LABEL_KEY_LOCATION]: this._location,
|
|
134
|
+
[Constants.MONITORED_RES_LABEL_KEY_LOCATION]: this._locationPromise ?? this._location,
|
|
115
135
|
[Constants.MONITORED_RES_LABEL_KEY_INSTANCE]: 'unknown',
|
|
116
136
|
[Constants.MONITORED_RES_LABEL_KEY_INSTANCE_CONFIG]: 'unknown',
|
|
117
137
|
});
|
|
138
|
+
void resource.waitForAsyncAttributes?.();
|
|
118
139
|
this._meterProvider = new sdk_metrics_1.MeterProvider({
|
|
119
140
|
resource: resource,
|
|
120
141
|
readers: readers,
|
|
121
142
|
views: Constants.METRIC_VIEWS,
|
|
122
143
|
});
|
|
144
|
+
this._metricReaders = readers;
|
|
123
145
|
this._createMetricInstruments();
|
|
124
146
|
}
|
|
125
147
|
return this._meterProvider;
|
|
@@ -128,7 +150,6 @@ class MetricsTracerFactory {
|
|
|
128
150
|
* Resets the singleton instance of the MetricsTracerFactory.
|
|
129
151
|
*/
|
|
130
152
|
static async resetInstance() {
|
|
131
|
-
clearInterval(MetricsTracerFactory._instance?._intervalTracerCleanup);
|
|
132
153
|
await MetricsTracerFactory._instance?.resetMeterProvider();
|
|
133
154
|
MetricsTracerFactory._instance = null;
|
|
134
155
|
}
|
|
@@ -140,8 +161,8 @@ class MetricsTracerFactory {
|
|
|
140
161
|
await this._meterProvider.shutdown();
|
|
141
162
|
}
|
|
142
163
|
this._meterProvider = null;
|
|
143
|
-
this.
|
|
144
|
-
this.
|
|
164
|
+
this._metricReaders = [];
|
|
165
|
+
this._attributesCache = new Map();
|
|
145
166
|
}
|
|
146
167
|
/**
|
|
147
168
|
* Returns the attempt latency histogram instrument.
|
|
@@ -191,6 +212,18 @@ class MetricsTracerFactory {
|
|
|
191
212
|
get clientName() {
|
|
192
213
|
return this._clientName;
|
|
193
214
|
}
|
|
215
|
+
/**
|
|
216
|
+
* Returns the detected client location.
|
|
217
|
+
*/
|
|
218
|
+
get location() {
|
|
219
|
+
return this._location;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Returns true if the MeterProvider is initialized with at least one MetricReader.
|
|
223
|
+
*/
|
|
224
|
+
hasMetricReaders() {
|
|
225
|
+
return this._metricReaders.length > 0;
|
|
226
|
+
}
|
|
194
227
|
/**
|
|
195
228
|
* Creates a new MetricsTracer for a given resource name and method, and stores it for later retrieval.
|
|
196
229
|
* Returns null if metrics are disabled.
|
|
@@ -202,15 +235,14 @@ class MetricsTracerFactory {
|
|
|
202
235
|
if (!MetricsTracerFactory.enabled) {
|
|
203
236
|
return null;
|
|
204
237
|
}
|
|
205
|
-
const operationRequest = this._extractOperationRequest(requestId);
|
|
206
|
-
if (this._currentOperationTracers.has(operationRequest)) {
|
|
207
|
-
return this._currentOperationTracers.get(operationRequest);
|
|
208
|
-
}
|
|
209
238
|
const { instance, database } = this.getInstanceAttributes(formattedName);
|
|
210
|
-
const
|
|
211
|
-
this.
|
|
212
|
-
|
|
213
|
-
|
|
239
|
+
const cacheKey = `${instance}/${database}/${method}`;
|
|
240
|
+
let attributesCache = this._attributesCache.get(cacheKey);
|
|
241
|
+
if (!attributesCache) {
|
|
242
|
+
attributesCache = new Map();
|
|
243
|
+
this._attributesCache.set(cacheKey, attributesCache);
|
|
244
|
+
}
|
|
245
|
+
return new metrics_tracer_1.MetricsTracer(this._instrumentAttemptCounter, this._instrumentAttemptLatency, this._instrumentOperationCounter, this._instrumentOperationLatency, this._instrumentGfeConnectivityErrorCount, this._instrumentGfeLatency, this._instrumentAfeConnectivityErrorCount, this._instrumentAfeLatency, MetricsTracerFactory.enabled, database, instance, this._projectId, method, requestId, attributesCache);
|
|
214
246
|
}
|
|
215
247
|
/**
|
|
216
248
|
* Takes a formatted name and parses the project, instance, and database.
|
|
@@ -225,54 +257,71 @@ class MetricsTracerFactory {
|
|
|
225
257
|
database: Constants.UNKNOWN_ATTRIBUTE,
|
|
226
258
|
};
|
|
227
259
|
}
|
|
228
|
-
const
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
260
|
+
const parts = formattedName.split('/');
|
|
261
|
+
const startIndex = parts[0] === '' ? 1 : 0;
|
|
262
|
+
if (parts.length < startIndex + 4 ||
|
|
263
|
+
parts[startIndex] !== 'projects' ||
|
|
264
|
+
parts[startIndex + 2] !== 'instances' ||
|
|
265
|
+
!parts[startIndex + 1] ||
|
|
266
|
+
!parts[startIndex + 3]) {
|
|
267
|
+
return {
|
|
268
|
+
project: Constants.UNKNOWN_ATTRIBUTE,
|
|
269
|
+
instance: Constants.UNKNOWN_ATTRIBUTE,
|
|
270
|
+
database: Constants.UNKNOWN_ATTRIBUTE,
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
const project = parts[startIndex + 1];
|
|
274
|
+
const instance = parts[startIndex + 3];
|
|
275
|
+
let database = Constants.UNKNOWN_ATTRIBUTE;
|
|
276
|
+
if (parts.length >= startIndex + 6 &&
|
|
277
|
+
parts[startIndex + 4] === 'databases' &&
|
|
278
|
+
parts[startIndex + 5]) {
|
|
279
|
+
database = parts[startIndex + 5];
|
|
280
|
+
}
|
|
233
281
|
return { project: project, instance: instance, database: database };
|
|
234
282
|
}
|
|
235
283
|
/**
|
|
236
284
|
* Retrieves the current MetricsTracer for a given request id.
|
|
237
|
-
*
|
|
238
|
-
* Does not implicitly create MetricsTracers as that should be done
|
|
239
|
-
* explicitly using the createMetricsTracer function.
|
|
240
|
-
* request id is expected to be as set in the gRPC metadata.
|
|
285
|
+
* @deprecated MetricsTracer is carried directly on the call context.
|
|
241
286
|
* @param requestId The request id of the gRPC call set under 'x-goog-spanner-request-id'.
|
|
242
|
-
* @returns
|
|
287
|
+
* @returns null.
|
|
243
288
|
*/
|
|
289
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
244
290
|
getCurrentTracer(requestId) {
|
|
245
|
-
|
|
246
|
-
if (!this._currentOperationTracers.has(operationRequest)) {
|
|
247
|
-
// Attempting to retrieve tracer that doesn't exist.
|
|
248
|
-
return null;
|
|
249
|
-
}
|
|
250
|
-
this._currentOperationLastUpdatedMs.set(operationRequest, Date.now());
|
|
251
|
-
return this._currentOperationTracers.get(operationRequest) ?? null;
|
|
291
|
+
return null;
|
|
252
292
|
}
|
|
253
293
|
/**
|
|
254
294
|
* Removes the MetricsTracer associated with the given request id.
|
|
295
|
+
* @deprecated MetricsTracer is carried directly on the call context.
|
|
255
296
|
* @param requestId The request id of the gRPC call set under 'x-goog-spanner-request-id'.
|
|
256
297
|
*/
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
this._currentOperationTracers.delete(operationRequest);
|
|
263
|
-
this._currentOperationLastUpdatedMs.delete(operationRequest);
|
|
264
|
-
}
|
|
298
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
299
|
+
clearCurrentTracer(requestId) { }
|
|
300
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
265
301
|
_extractOperationRequest(requestId) {
|
|
266
|
-
if (!requestId) {
|
|
302
|
+
if (!requestId || typeof requestId !== 'string') {
|
|
267
303
|
return '';
|
|
268
304
|
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
305
|
+
let dotCount = 0;
|
|
306
|
+
let fifthDotIndex = -1;
|
|
307
|
+
for (let index = 0; index < requestId.length; index++) {
|
|
308
|
+
if (requestId.charCodeAt(index) === 46 /* '.' */) {
|
|
309
|
+
dotCount++;
|
|
310
|
+
if (dotCount === 5) {
|
|
311
|
+
fifthDotIndex = index;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
if (dotCount !== 5 || fifthDotIndex === requestId.length - 1) {
|
|
272
316
|
return '';
|
|
273
317
|
}
|
|
274
|
-
|
|
275
|
-
|
|
318
|
+
for (let index = fifthDotIndex + 1; index < requestId.length; index++) {
|
|
319
|
+
const code = requestId.charCodeAt(index);
|
|
320
|
+
if (code < 48 || code > 57) {
|
|
321
|
+
return '';
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return requestId.slice(0, fifthDotIndex);
|
|
276
325
|
}
|
|
277
326
|
/**
|
|
278
327
|
* Creates and initializes all metric instruments (counters and histograms) for the MeterProvider.
|
|
@@ -350,20 +399,23 @@ class MetricsTracerFactory {
|
|
|
350
399
|
return shiftedValue.toString(16).padStart(6, '0');
|
|
351
400
|
}
|
|
352
401
|
/**
|
|
353
|
-
* Gets the location (region) of the client,
|
|
354
|
-
* Uses
|
|
355
|
-
*
|
|
402
|
+
* Gets the location (region or zone) of the client, or defaults to "global".
|
|
403
|
+
* Uses the GCP resource detector to detect the location from the environment.
|
|
404
|
+
* Checks `cloud.region` first and falls back to `cloud.availability_zone`
|
|
405
|
+
* for zonal GKE clusters where `cloud.region` is not set.
|
|
406
|
+
* @returns The detected location string, or "global" if not found.
|
|
356
407
|
*/
|
|
357
408
|
static async _detectClientLocation() {
|
|
358
409
|
const defaultRegion = 'global';
|
|
359
410
|
try {
|
|
360
411
|
const resource = await (0, resources_1.detectResources)({
|
|
361
|
-
detectors: [
|
|
412
|
+
detectors: [resource_detector_gcp_1.gcpDetector],
|
|
362
413
|
});
|
|
363
414
|
await resource?.waitForAsyncAttributes?.();
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
|
|
415
|
+
const location = resource.attributes[Constants.ATTR_CLOUD_REGION] ??
|
|
416
|
+
resource.attributes[Constants.ATTR_CLOUD_AVAILABILITY_ZONE];
|
|
417
|
+
if (typeof location === 'string' && location) {
|
|
418
|
+
return location;
|
|
367
419
|
}
|
|
368
420
|
}
|
|
369
421
|
catch (err) {
|
|
@@ -371,17 +423,6 @@ class MetricsTracerFactory {
|
|
|
371
423
|
}
|
|
372
424
|
return defaultRegion;
|
|
373
425
|
}
|
|
374
|
-
_cleanMetricsTracers() {
|
|
375
|
-
if (this._currentOperationLastUpdatedMs.size === 0) {
|
|
376
|
-
return;
|
|
377
|
-
}
|
|
378
|
-
for (const [operationTracer, lastUpdated,] of this._currentOperationLastUpdatedMs.entries()) {
|
|
379
|
-
if (Date.now() - lastUpdated >= Constants.TRACER_CLEANUP_THRESHOLD_MS) {
|
|
380
|
-
this._currentOperationTracers.delete(operationTracer);
|
|
381
|
-
this._currentOperationLastUpdatedMs.delete(operationTracer);
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
426
|
}
|
|
386
427
|
exports.MetricsTracerFactory = MetricsTracerFactory;
|
|
387
428
|
//# sourceMappingURL=metrics-tracer-factory.js.map
|
|
@@ -81,7 +81,7 @@ export declare class MetricsTracer {
|
|
|
81
81
|
private _instance;
|
|
82
82
|
private _projectId;
|
|
83
83
|
private _methodName;
|
|
84
|
-
private _request
|
|
84
|
+
private _request?;
|
|
85
85
|
/**
|
|
86
86
|
* The current MetricOperationTracer instance tracking the ongoing operation.
|
|
87
87
|
*/
|
|
@@ -90,6 +90,11 @@ export declare class MetricsTracer {
|
|
|
90
90
|
* Stores client and resource attributes for labeling metrics.
|
|
91
91
|
*/
|
|
92
92
|
private _clientAttributes;
|
|
93
|
+
/**
|
|
94
|
+
* Cached OTel attribute objects keyed by status name, avoiding repeated
|
|
95
|
+
* object allocations on every metric recording call.
|
|
96
|
+
*/
|
|
97
|
+
private _attributesByStatus;
|
|
93
98
|
gfeLatency: number | null;
|
|
94
99
|
afeLatency: number | null;
|
|
95
100
|
/**
|
|
@@ -105,7 +110,7 @@ export declare class MetricsTracer {
|
|
|
105
110
|
* @param _instrumentAfeLatency Histogram for AFE latency metrics.
|
|
106
111
|
* @param enabled Whether metrics recording is enabled.
|
|
107
112
|
*/
|
|
108
|
-
constructor(_instrumentAttemptCounter: Counter | null, _instrumentAttemptLatency: Histogram | null, _instrumentOperationCounter: Counter | null, _instrumentOperationLatency: Histogram | null, _instrumentGfeConnectivityErrorCount: Counter | null, _instrumentGfeLatency: Histogram | null, _instrumentAfeConnectivityErrorCount: Counter | null, _instrumentAfeLatency: Histogram | null, enabled: boolean, _database: string, _instance: string, _projectId: string, _methodName: string, _request
|
|
113
|
+
constructor(_instrumentAttemptCounter: Counter | null, _instrumentAttemptLatency: Histogram | null, _instrumentOperationCounter: Counter | null, _instrumentOperationLatency: Histogram | null, _instrumentGfeConnectivityErrorCount: Counter | null, _instrumentGfeLatency: Histogram | null, _instrumentAfeConnectivityErrorCount: Counter | null, _instrumentAfeLatency: Histogram | null, enabled: boolean, _database: string, _instance: string, _projectId: string, _methodName: string, _request?: string | undefined, attributesCache?: Map<string, Record<string, string>>);
|
|
109
114
|
/**
|
|
110
115
|
* Returns the difference in milliseconds between two times.
|
|
111
116
|
* @param start The start time.
|
|
@@ -172,8 +177,16 @@ export declare class MetricsTracer {
|
|
|
172
177
|
*/
|
|
173
178
|
extractAfeLatency(header: string): number | null;
|
|
174
179
|
/**
|
|
175
|
-
*
|
|
176
|
-
*
|
|
180
|
+
* Returns a cached set of OTEL attributes for the given status, avoiding
|
|
181
|
+
* repeated object cloning on every metric record/add call.
|
|
182
|
+
*
|
|
183
|
+
* @param status Optional status code (as numeric Status enum or status name string).
|
|
184
|
+
* @returns The cached attributes object.
|
|
185
|
+
*/
|
|
186
|
+
private _getAttributesForStatus;
|
|
187
|
+
/**
|
|
188
|
+
* Records the GFE latency for this attempt.
|
|
189
|
+
* @param statusCode The gRPC status code of the attempt.
|
|
177
190
|
*/
|
|
178
191
|
recordGfeLatency(statusCode: Status): void;
|
|
179
192
|
/**
|
|
@@ -185,8 +198,8 @@ export declare class MetricsTracer {
|
|
|
185
198
|
*/
|
|
186
199
|
recordAfeConnectivityErrorCount(statusCode: Status): void;
|
|
187
200
|
/**
|
|
188
|
-
* Records the
|
|
189
|
-
* @param
|
|
201
|
+
* Records the AFE latency for this attempt.
|
|
202
|
+
* @param statusCode The gRPC status code of the attempt.
|
|
190
203
|
*/
|
|
191
204
|
recordAfeLatency(statusCode: Status): void;
|
|
192
205
|
/**
|