From dabc7ccd12329ca7b6c8b4dfd6a39b762e1c5e9d Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Wed, 16 Jan 2019 17:34:24 +1100 Subject: [PATCH] Issue #243 use API to discover projectId Signed-off-by: Greg Wilkins --- .../com/google/cloud/runtimes/jetty9/RequestContextScope.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jetty9-base/src/main/java/com/google/cloud/runtimes/jetty9/RequestContextScope.java b/jetty9-base/src/main/java/com/google/cloud/runtimes/jetty9/RequestContextScope.java index 63d9b542..c84a1c44 100644 --- a/jetty9-base/src/main/java/com/google/cloud/runtimes/jetty9/RequestContextScope.java +++ b/jetty9-base/src/main/java/com/google/cloud/runtimes/jetty9/RequestContextScope.java @@ -16,6 +16,7 @@ package com.google.cloud.runtimes.jetty9; +import com.google.cloud.ServiceOptions; import com.google.cloud.logging.TraceLoggingEnhancer; import org.eclipse.jetty.server.Request; @@ -40,7 +41,7 @@ public class RequestContextScope implements ContextHandler.ContextScopeListener private static final String X_CLOUD_TRACE = "x-cloud-trace-context"; private static final ThreadLocal contextDepth = new ThreadLocal<>(); - private final String projectId = System.getProperty("app.deploy.project", "unknown"); + private final String projectId = ServiceOptions.getDefaultProjectId(); @Override public void enterScope(Context context, Request request, Object reason) {