Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit 210eec0

Browse files
authored
Merge branch 'main' into 359913994-views-change-2
2 parents 2d69216 + 71f4d78 commit 210eec0

36 files changed

Lines changed: 2823 additions & 1080 deletions

CHANGELOG.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,55 @@
44

55
[1]: https://www.npmjs.com/package/@google-cloud/bigtable?activeTab=versions
66

7+
## [6.1.0](https://github.com/googleapis/nodejs-bigtable/compare/v6.0.0...v6.1.0) (2025-05-30)
8+
9+
10+
### Features
11+
12+
* Add full support for Universe Domain ([#1604](https://github.com/googleapis/nodejs-bigtable/issues/1604)) ([4562e23](https://github.com/googleapis/nodejs-bigtable/commit/4562e2329e734c0c9d9f00cfa83aa2be13e9a7fe))
13+
14+
## [6.0.0](https://github.com/googleapis/nodejs-bigtable/compare/v5.1.2...v6.0.0) (2025-04-22)
15+
16+
17+
### ⚠ BREAKING CHANGES
18+
19+
* migrate to Node 18 ([#1582](https://github.com/googleapis/nodejs-bigtable/issues/1582))
20+
21+
### Features
22+
23+
* Add fields and the BackupType proto for Hot Backups ([#1439](https://github.com/googleapis/nodejs-bigtable/issues/1439)) ([433a8e3](https://github.com/googleapis/nodejs-bigtable/commit/433a8e347b21dbdba5b810141ecedbcc0daa9177))
24+
* Add MergeToCell to Mutation APIs ([433a8e3](https://github.com/googleapis/nodejs-bigtable/commit/433a8e347b21dbdba5b810141ecedbcc0daa9177))
25+
* Add min, max, hll aggregators and more types ([433a8e3](https://github.com/googleapis/nodejs-bigtable/commit/433a8e347b21dbdba5b810141ecedbcc0daa9177))
26+
* Add plumbing PR for client side metrics to support the open telemetry instruments ([#1569](https://github.com/googleapis/nodejs-bigtable/issues/1569)) ([c37a451](https://github.com/googleapis/nodejs-bigtable/commit/c37a451c52ff5639fc9f5e76c88e93ba549fe6c9))
27+
* Add the MetricsCollector for client side metrics ([#1566](https://github.com/googleapis/nodejs-bigtable/issues/1566)) ([d475ef2](https://github.com/googleapis/nodejs-bigtable/commit/d475ef2131ab1d18d70b2666d9f3405ad8a21449))
28+
* Add the plumbing for application blocking latencies client side metrics ([#1575](https://github.com/googleapis/nodejs-bigtable/issues/1575)) ([967f440](https://github.com/googleapis/nodejs-bigtable/commit/967f440fbcdc29040dddfae561b03f3c3462b671))
29+
* Bigtable authorized views requests on the Data plane ([#1509](https://github.com/googleapis/nodejs-bigtable/issues/1509)) ([da373b5](https://github.com/googleapis/nodejs-bigtable/commit/da373b5dcc51b459527c0797ac237c073364ca36))
30+
* Move the metrics handler fixture ([#1570](https://github.com/googleapis/nodejs-bigtable/issues/1570)) ([c97ebcc](https://github.com/googleapis/nodejs-bigtable/commit/c97ebcc6b9b8c36e0f39b79dd3ab75aaef6c52c5))
31+
* Publish ProtoRows Message ([433a8e3](https://github.com/googleapis/nodejs-bigtable/commit/433a8e347b21dbdba5b810141ecedbcc0daa9177))
32+
* Publish the Cloud Bigtable ExecuteQuery API ([433a8e3](https://github.com/googleapis/nodejs-bigtable/commit/433a8e347b21dbdba5b810141ecedbcc0daa9177))
33+
* Update Go Bigtable import path ([433a8e3](https://github.com/googleapis/nodejs-bigtable/commit/433a8e347b21dbdba5b810141ecedbcc0daa9177))
34+
* Update Go Datastore import path ([433a8e3](https://github.com/googleapis/nodejs-bigtable/commit/433a8e347b21dbdba5b810141ecedbcc0daa9177))
35+
36+
37+
### Bug Fixes
38+
39+
* Address assertion error in TestReadRows_Retry_LastScannedRow conformance test ([#1521](https://github.com/googleapis/nodejs-bigtable/issues/1521)) ([0552638](https://github.com/googleapis/nodejs-bigtable/commit/0552638ca4c820dadcd66633d1f555ab3e5b1937))
40+
* Check and mutate generic header conformance test ([#1551](https://github.com/googleapis/nodejs-bigtable/issues/1551)) ([7f1099a](https://github.com/googleapis/nodejs-bigtable/commit/7f1099afbd5af1639b843285a9ce6358f067e50e))
41+
* Conformance test sample rowkeys generic deadline ([#1562](https://github.com/googleapis/nodejs-bigtable/issues/1562)) ([2fdf98f](https://github.com/googleapis/nodejs-bigtable/commit/2fdf98f9398761046f41bd58e00258f0d4963a3d))
42+
* Fix plumbing errors for client side metrics collection ([#1583](https://github.com/googleapis/nodejs-bigtable/issues/1583)) ([574c2f4](https://github.com/googleapis/nodejs-bigtable/commit/574c2f473e88174c05889e0294b2d25de2ad11dd))
43+
* Fix TestReadRows_Generic_CloseClient conformance test by passing grpc status codes for closed client errors ([#1524](https://github.com/googleapis/nodejs-bigtable/issues/1524)) ([8524174](https://github.com/googleapis/nodejs-bigtable/commit/8524174d9214c4391e9f1c06458c206acd685dc2))
44+
* Paused scan test is now fixed ([#1539](https://github.com/googleapis/nodejs-bigtable/issues/1539)) ([d009a8f](https://github.com/googleapis/nodejs-bigtable/commit/d009a8f9bb86c2efa192e98e565cd7b305700ff9))
45+
* Sample rowkey generic header conformance test ([#1550](https://github.com/googleapis/nodejs-bigtable/issues/1550)) ([6ef7671](https://github.com/googleapis/nodejs-bigtable/commit/6ef76713dc8823cfb2131a60f3a09174d42b655c))
46+
* TestMutateRow_Generic_Headers ([#1540](https://github.com/googleapis/nodejs-bigtable/issues/1540)) ([f6176c1](https://github.com/googleapis/nodejs-bigtable/commit/f6176c110f832dbacc14ac60fa1870e69aa139ce))
47+
* Update owlbot.py to exculde sync repo ([#1549](https://github.com/googleapis/nodejs-bigtable/issues/1549)) ([f1ad565](https://github.com/googleapis/nodejs-bigtable/commit/f1ad565b321b0d45baed5c3304b4a9990c4b9c41))
48+
* Update sync-repo-settings.yaml to make owl bot optional ([#1547](https://github.com/googleapis/nodejs-bigtable/issues/1547)) ([d745412](https://github.com/googleapis/nodejs-bigtable/commit/d745412dd43965d5d8ac7f83c823314043bc0fca))
49+
* Use the universe domain if it is provided by the user ([#1563](https://github.com/googleapis/nodejs-bigtable/issues/1563)) ([d26ecb8](https://github.com/googleapis/nodejs-bigtable/commit/d26ecb8d2260b434d2f37abf28b92e50db25c45d))
50+
51+
52+
### Miscellaneous Chores
53+
54+
* Migrate to Node 18 ([#1582](https://github.com/googleapis/nodejs-bigtable/issues/1582)) ([e50b67d](https://github.com/googleapis/nodejs-bigtable/commit/e50b67da62f9640c10a32bd9e0ff067fc522a7b0))
55+
756
## [5.1.2](https://github.com/googleapis/nodejs-bigtable/compare/v5.1.1...v5.1.2) (2024-07-22)
857

958

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@google-cloud/bigtable",
3-
"version": "5.1.2",
3+
"version": "6.1.0",
44
"description": "Cloud Bigtable Client Library for Node.js",
55
"keywords": [
66
"bigtable",

protos/protos.d.ts

Lines changed: 0 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protos/protos.js

Lines changed: 7 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"node": ">=18"
1515
},
1616
"dependencies": {
17-
"@google-cloud/bigtable": "^5.1.2",
17+
"@google-cloud/bigtable": "^6.1.0",
1818
"uuid": "^9.0.0",
1919
"yargs": "^16.0.0"
2020
},

src/client-side-metrics/client-side-metrics-attributes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export enum StreamingState {
2525
* metrics, allowing for differentiation of performance by method.
2626
*/
2727
export enum MethodName {
28+
READ_ROW = 'Bigtable.ReadRow',
2829
READ_ROWS = 'Bigtable.ReadRows',
2930
MUTATE_ROW = 'Bigtable.MutateRow',
3031
CHECK_AND_MUTATE_ROW = 'Bigtable.CheckAndMutateRow',

src/client-side-metrics/exporter.ts

Lines changed: 26 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ import {
1919
Histogram,
2020
ResourceMetrics,
2121
} from '@opentelemetry/sdk-metrics';
22-
import {grpc, ServiceError} from 'google-gax';
22+
import {ClientOptions, ServiceError} from 'google-gax';
2323
import {MetricServiceClient} from '@google-cloud/monitoring';
2424
import {google} from '@google-cloud/monitoring/build/protos/protos';
2525
import ICreateTimeSeriesRequest = google.monitoring.v3.ICreateTimeSeriesRequest;
26-
import {RetryOptions} from 'google-gax';
2726

2827
export interface ExportResult {
2928
code: number;
@@ -119,7 +118,7 @@ function getIntegerPoints(dataPoint: DataPoint<number>) {
119118
* getResource gets the resource object which is used for building the timeseries
120119
* object that will be sent to Google Cloud Monitoring dashboard
121120
*
122-
* @param {string} metricName The backend name of the metric that we want to record
121+
* @param {string} projectId The name of the project
123122
* @param {DataPoint} dataPoint The datapoint containing the data we wish to
124123
* send to the Google Cloud Monitoring dashboard
125124
*/
@@ -160,15 +159,16 @@ function getMetric(
160159
) {
161160
const streaming = dataPoint.attributes.streaming;
162161
const app_profile = dataPoint.attributes.app_profile;
162+
const status = dataPoint.attributes.status;
163163
return {
164164
type: metricName,
165165
labels: Object.assign(
166166
{
167167
method: dataPoint.attributes.method,
168168
client_uid: dataPoint.attributes.client_uid,
169-
status: dataPoint.attributes.status,
170169
client_name: dataPoint.attributes.client_name,
171170
},
171+
status ? {status} : null,
172172
streaming ? {streaming} : null,
173173
app_profile ? {app_profile} : null,
174174
),
@@ -183,6 +183,7 @@ function getMetric(
183183
* metric attributes, data points, and aggregation information, into an object
184184
* that conforms to the expected request format of the Cloud Monitoring API.
185185
*
186+
* @param projectId
186187
* @param {ResourceMetrics} exportArgs - The OpenTelemetry metrics data to be converted. This
187188
* object contains resource attributes, scope information, and a list of
188189
* metrics with their associated data points.
@@ -210,14 +211,10 @@ function getMetric(
210211
*
211212
*
212213
*/
213-
export function metricsToRequest(exportArgs: ResourceMetrics) {
214-
type WithSyncAttributes = {_syncAttributes: {[index: string]: string}};
215-
const resourcesWithSyncAttributes =
216-
exportArgs.resource as unknown as WithSyncAttributes;
217-
const projectId =
218-
resourcesWithSyncAttributes._syncAttributes[
219-
'monitored_resource.project_id'
220-
];
214+
export function metricsToRequest(
215+
projectId: string,
216+
exportArgs: ResourceMetrics,
217+
) {
221218
const timeSeriesArray = [];
222219
for (const scopeMetrics of exportArgs.scopeMetrics) {
223220
for (const scopeMetric of scopeMetrics.metrics) {
@@ -296,49 +293,33 @@ export function metricsToRequest(exportArgs: ResourceMetrics) {
296293
* @beta
297294
*/
298295
export class CloudMonitoringExporter extends MetricExporter {
299-
private monitoringClient = new MetricServiceClient();
296+
private client: MetricServiceClient;
300297

301-
export(
298+
constructor(options: ClientOptions) {
299+
super();
300+
if (options && options.apiEndpoint) {
301+
// We want the MetricServiceClient to always hit its default endpoint.
302+
delete options.apiEndpoint;
303+
}
304+
this.client = new MetricServiceClient(options);
305+
}
306+
307+
async export(
302308
metrics: ResourceMetrics,
303309
resultCallback: (result: ExportResult) => void,
304-
): void {
310+
): Promise<void> {
305311
(async () => {
306312
try {
307-
const request = metricsToRequest(metrics);
308-
// In order to manage the "One or more points were written more
309-
// frequently than the maximum sampling period configured for the
310-
// metric." error we should have the metric service client retry a few
311-
// times to ensure the metrics do get written.
312-
//
313-
// We use all the usual retry codes plus INVALID_ARGUMENT (code 3)
314-
// because INVALID ARGUMENT (code 3) corresponds to the maximum
315-
// sampling error.
316-
const retry = new RetryOptions(
317-
[
318-
grpc.status.INVALID_ARGUMENT,
319-
grpc.status.DEADLINE_EXCEEDED,
320-
grpc.status.RESOURCE_EXHAUSTED,
321-
grpc.status.ABORTED,
322-
grpc.status.UNAVAILABLE,
323-
],
324-
{
325-
initialRetryDelayMillis: 5000,
326-
retryDelayMultiplier: 2,
327-
maxRetryDelayMillis: 50000,
328-
},
329-
);
330-
await this.monitoringClient.createTimeSeries(
313+
const projectId = await this.client.getProjectId();
314+
const request = metricsToRequest(projectId, metrics);
315+
await this.client.createServiceTimeSeries(
331316
request as ICreateTimeSeriesRequest,
332-
{
333-
retry,
334-
},
335317
);
336318
// The resultCallback typically accepts a value equal to {code: x}
337319
// for some value x along with other info. When the code is equal to 0
338320
// then the operation completed successfully. When the code is not equal
339-
// to 0 then the operation failed. Open telemetry logs errors to the
340-
// console when the resultCallback passes in non-zero code values and
341-
// logs nothing when the code is 0.
321+
// to 0 then the operation failed. The resultCallback will not log
322+
// anything to the console whether the error code was 0 or not.
342323
resultCallback({code: 0});
343324
} catch (error) {
344325
resultCallback(error as ServiceError);

0 commit comments

Comments
 (0)