nodejs-bigtable icon indicating copy to clipboard operation
nodejs-bigtable copied to clipboard

Bubble up 'metadata' event for mutate request

Open mutianf opened this issue 3 years ago • 4 comments

mutate request should emit 'metadata' event in the manual layer so applications can get useful metrics from response headers like gfe 'server-timing'

mutianf avatar Jan 20 '22 21:01 mutianf

I looked at what I get back from an error on the following test when using mutate instead of insert:

https://github.com/googleapis/nodejs-bigtable/blob/main/test/errors.ts#L105

It appears that the error includes metadata:

err.metadata = {"grpc-server-stats-bin":[{"type":"Buffer","data":[0,0,116,....,0]}]}

Do you mean metadata should be available when data is sent back as well?

danieljbruce avatar Sep 23 '22 15:09 danieljbruce

Clarification: the bug is not talking about the metadata in the error. It is talking about the metadata grpc response which indeed includes headers like 'server-timing'.

danieljbruce avatar Sep 23 '22 19:09 danieljbruce

https://github.com/googleapis/nodejs-bigtable/pull/1178 is a possible fix.

danieljbruce avatar Sep 23 '22 21:09 danieljbruce

https://github.com/googleapis/nodejs-bigtable/pull/1180 contains the changes that include making metadata available to the user, but it seems like we are satisfied with providing it on the returned stream.

danieljbruce avatar Sep 27 '22 21:09 danieljbruce

https://github.com/googleapis/nodejs-bigtable/pull/1178 merged. Let me know if any more changes are needed.

danieljbruce avatar Jan 27 '23 20:01 danieljbruce