From c2e123da920f3f93766e983e729c724e4daa6324 Mon Sep 17 00:00:00 2001 From: Spencer Gilbert Date: Wed, 3 May 2023 16:00:47 -0400 Subject: [PATCH 1/2] fix(gcp_stackdriver_metrics sink): Call function to regenerate auth token --- src/sinks/gcp/stackdriver_metrics.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sinks/gcp/stackdriver_metrics.rs b/src/sinks/gcp/stackdriver_metrics.rs index 7f3ebbb397a05..11715b5f64b3e 100644 --- a/src/sinks/gcp/stackdriver_metrics.rs +++ b/src/sinks/gcp/stackdriver_metrics.rs @@ -114,6 +114,7 @@ impl SinkConfig for StackdriverConfig { auth, }; + auth.spawn_regenerate_token(); let sink = BatchedHttpSink::new( sink, MetricsBuffer::new(batch_settings.size), From c279778cd6a90204fd17f6afd0c6760b1bad4f67 Mon Sep 17 00:00:00 2001 From: Spencer Gilbert Date: Wed, 3 May 2023 16:33:57 -0400 Subject: [PATCH 2/2] +reorder --- src/sinks/gcp/stackdriver_metrics.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sinks/gcp/stackdriver_metrics.rs b/src/sinks/gcp/stackdriver_metrics.rs index 11715b5f64b3e..f6c66735ddb71 100644 --- a/src/sinks/gcp/stackdriver_metrics.rs +++ b/src/sinks/gcp/stackdriver_metrics.rs @@ -108,13 +108,13 @@ impl SinkConfig for StackdriverConfig { let client = HttpClient::new(tls_settings, cx.proxy())?; let batch_settings = self.batch.into_batch_settings()?; + auth.spawn_regenerate_token(); let sink = HttpEventSink { config: self.clone(), started, auth, }; - auth.spawn_regenerate_token(); let sink = BatchedHttpSink::new( sink, MetricsBuffer::new(batch_settings.size),