LoggingServiceV2Client loses automatic WriteLogEntries batching after the logging-api split

オープン
#9,658 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
1〜2日
初心者へのやさしさ
54/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
google-cloud, node.js, typescript
領域
api, backend

調査の方向性

Start by reading the logging-api onboarding change in PR #8863 and the package split in PR #8929, then inspect the LoggingServiceV2Client generation configuration and historical logging_gapic.yaml linked in the issue. Confirm where bundling defaults and the WriteLogEntries batching descriptor are configured. Done means compatible separate writes are coalesced into one transport request in v12, with a regression test covering that behavior.

索引モデルが issue の本文から書いたものです。

説明

Please make sure you have searched for information in the following guides.
Library Name

@google-cloud/logging — comparing 11.2.1 and 12.0.0

A screenshot that you have tested with "Try this API".

Not applicable: this issue concerns client-side request batching in the generated Node.js SDK. API Explorer sends requests directly and cannot exercise the SDK's google-gax batching scheduler.

The linked reproduction uses mocked transport calls and exercises the actual generated client wrappers and google-gax scheduler. It requires no credentials or Google Cloud project and makes no real Google Cloud API calls.

No API Explorer test was performed.

Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.

https://github.com/jacekerd/google-logging-batching-repro

A step-by-step description of how to reproduce the issue, based on the linked reproduction.

Requirements: Node.js 22 or newer and npm.

  1. Clone the reproduction:

    git clone https://github.com/jacekerd/google-logging-batching-repro.git
    cd google-logging-batching-repro
    
  2. Install the two locked dependency trees:

    npm ci --prefix versions/v11 --ignore-scripts --no-audit --no-fund
    npm ci --prefix versions/v12 --ignore-scripts --no-audit --no-fund
    
  3. Inspect batching metadata and exercise compatible writes:

    npm run check:v11
    npm run check:v12
    npm run behavior
    npm test
    
  4. Run the assertion that v12 should preserve v11 batching behavior:

    npm run test:expect-v11
    

Observed results:

  • v11.2.1 has descriptors.batching.writeLogEntries; two compatible writes produce one mocked transport invocation containing both entries.
  • v12.0.0 has an empty descriptors.batching object; the same writes produce two separate mocked transport invocations.
  • npm test passes five tests documenting these observations.
  • npm run test:expect-v11 intentionally exits 1, with one failed parity assertion.

The reproduction uses real generated wrappers and google-gax scheduling, with the transport stubbed. No credentials or real Cloud API requests are required.

A clear and concise description of what the bug is, and what you expected to happen.

Automatic WriteLogEntries batching differs between @google-cloud/[email protected] and @google-cloud/[email protected].

In 11.2.1, LoggingServiceV2Client initializes descriptors.batching.writeLogEntries and combines compatible calls into one transport request.

In 12.0.0, LoggingServiceV2Client is re-exported from @google-cloud/[email protected]. That generated implementation has an empty batching descriptor object and lacks the corresponding bundling defaults and batching descriptor selection.

Expected: compatible WriteLogEntries calls retain automatic batching.

Actual: two compatible calls produce two transport requests instead of one.

Explicit higher-level log.write([entry1, entry2]) remains supported. The issue concerns automatic coalescing across separate GAPIC calls.

These versions establish the behavioral difference; they do not identify the first affected intermediate release.

A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **

@google-cloud/[email protected] automatically combines compatible WriteLogEntries calls. I expected this behavior to remain available after upgrading to 12.0.0.

The historical Node.js generation target explicitly supplied google/logging/v2/logging_gapic.yaml, which defines batching for WriteLogEntries. Investigation indicates that the logging-api onboarding omitted nodejs.bundle_config from librarian.yaml, causing the generated client to lose its batching descriptor, bundling defaults, and batching descriptor selection.

The reproduction demonstrates one mocked transport invocation for two compatible writes in v11, versus two invocations in v12. Restoring the missing configuration in memory restores batching with v12's existing google-gax runtime.

Relevant references:

I'd expect the automatic GAPIC batching to be preserved across this migration.

主要言語
TypeScript
スター
3.2k
フォーク
732
平均マージ
2日 11時間
マージ済み PR(30日)
99

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

googleapis/google-cloud-node のほかの issue

googleapis/google-cloud-node の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。