damccorm commented on code in PR #34134:
URL: https://github.com/apache/beam/pull/34134#discussion_r1979638329


##########
sdks/java/extensions/google-cloud-platform-core/src/main/java/org/apache/beam/sdk/extensions/gcp/options/GcsOptions.java:
##########
@@ -182,6 +183,12 @@ public interface GcsOptions extends 
ApplicationNameOptions, GcpOptions, Pipeline
 
   void setGcsWriteCounterPrefix(String gcsReadCounterPrefix);
 
+  @Description("Get key-value pairs to be stored as custom information in GCS 
audit logs")
+  GcsCustomAuditEntries getGcsCustomAuditEntries();
+
+  @Description("Set key-value pairs to be stored as custom information in GCS 
audit logs")

Review Comment:
   Could you add information on how this can be passed in from the command line 
(and maybe an example like you have below 
`--gcsCustomAuditEntries={\"user\":\"test-user\", \"work\":\"test-work\", 
\"job\":\"test-job\", \"id\":\"1234\"}`



##########
sdks/java/extensions/google-cloud-platform-core/src/main/java/org/apache/beam/sdk/extensions/gcp/util/Transport.java:
##########
@@ -125,7 +126,17 @@ private static HttpRequestInitializer 
httpRequestInitializerFromOptions(GcsOptio
 
     // Set custom audit info in request headers
     String jobName = 
Optional.ofNullable(options.getJobName()).orElse("UNKNOWN");
-    
retryHttpRequestInitializer.setHttpHeaders(ImmutableMap.of("x-goog-custom-audit-job",
 jobName));
+
+    ImmutableMap.Builder<String, String> builder =
+        new ImmutableMap.Builder<String, 
String>().put("x-goog-custom-audit-job", jobName);

Review Comment:
   Nit: Should we make `CUSTOM_AUDIT_JOB_ENTRY_KEY` public so that it can be 
referenced from here?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to