From fcfd604b15faa74ba869e6adf16db2fa160a0d1d Mon Sep 17 00:00:00 2001 From: Josh Radcliff Date: Mon, 19 Oct 2026 15:49:31 -0400 Subject: [PATCH] feat(samples): set max gRPC metadata size to 16MB in ingestion samples Configures IngestionServiceClient with a 16MB maximum metadata size to accommodate responses with large error details, and adds the `create_client` region tag. Change-Id: I6e732f934276c180cd142833b42358db997f2fed --- samples/audiences/ingest_audience_members.ts | 9 ++++++++- samples/events/ingest_events.ts | 7 ++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/samples/audiences/ingest_audience_members.ts b/samples/audiences/ingest_audience_members.ts index b81cd76..cf0f49d 100644 --- a/samples/audiences/ingest_audience_members.ts +++ b/samples/audiences/ingest_audience_members.ts @@ -289,7 +289,14 @@ async function main() { }); } - const client = new IngestionServiceClient(); + // [START create_client] + // Creates a client for the ingestion service. Increases the maximum metadata + // size to 16MB to prevent RESOURCE_EXHAUSTED errors when responses contain + // large error details. + const client = new IngestionServiceClient({ + 'grpc.max_metadata_size': 16 * 1024 * 1024, + }); + // [END create_client] let requestCount = 0; // Batches requests to send up to the maximum number of audience members per request. diff --git a/samples/events/ingest_events.ts b/samples/events/ingest_events.ts index 159e254..7a721f1 100644 --- a/samples/events/ingest_events.ts +++ b/samples/events/ingest_events.ts @@ -264,7 +264,12 @@ async function main() { }); } - const client = new IngestionServiceClient(); + // Creates a client for the ingestion service. Increases the maximum metadata + // size to 16MB to prevent RESOURCE_EXHAUSTED errors when responses contain + // large error details. + const client = new IngestionServiceClient({ + 'grpc.max_metadata_size': 16 * 1024 * 1024, + }); let requestCount = 0; // Batches requests to send up to the maximum number of events per request.