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.