Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.google.api.gax.rpc.UnavailableException;
import com.google.auth.Credentials;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.auth.oauth2.ServiceAccountCredentials;
import com.google.cloud.ByteArray;
import com.google.cloud.Date;
import com.google.cloud.NoCredentials;
Expand Down Expand Up @@ -888,7 +889,7 @@ private synchronized TraceServiceClient getTraceServiceClient() throws IOExcepti
credentials = NoCredentials.getInstance();
} else {
credentials =
GoogleCredentials.fromStream(
ServiceAccountCredentials.fromStream(
new ByteArrayInputStream(
FileUtils.readFileToByteArray(new File(WorkerProxy.serviceKeyFile))),
HTTP_TRANSPORT_FACTORY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.auth.Credentials;
import com.google.auth.http.HttpTransportFactory;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.auth.oauth2.ServiceAccountCredentials;
import com.google.cloud.opentelemetry.trace.TraceConfiguration;
import com.google.cloud.opentelemetry.trace.TraceExporter;
import com.google.cloud.spanner.ErrorCode;
Expand Down Expand Up @@ -87,7 +87,7 @@ public static OpenTelemetrySdk setupOpenTelemetrySdk() throws Exception {
// Read credentials from the serviceKeyFile.
HttpTransportFactory HTTP_TRANSPORT_FACTORY = NetHttpTransport::new;
Credentials credentials =
GoogleCredentials.fromStream(
ServiceAccountCredentials.fromStream(
new ByteArrayInputStream(FileUtils.readFileToByteArray(new File(serviceKeyFile))),
HTTP_TRANSPORT_FACTORY);

Expand Down