From f65f72b961e83602ba9e8ae58882df2f8bdd1e86 Mon Sep 17 00:00:00 2001 From: Vikas Kedia Date: Fri, 1 Dec 2017 16:25:52 -0800 Subject: [PATCH 1/8] Add tracing --- spanner/cloud-client/pom.xml | 23 ++++++++++++++++++- .../com/example/spanner/QuickstartSample.java | 8 +++++-- .../com/example/spanner/SpannerSample.java | 23 +++++++++++++++++++ 3 files changed, 51 insertions(+), 3 deletions(-) diff --git a/spanner/cloud-client/pom.xml b/spanner/cloud-client/pom.xml index 9a7bc82d9c8..b57ff3661f3 100644 --- a/spanner/cloud-client/pom.xml +++ b/spanner/cloud-client/pom.xml @@ -52,7 +52,7 @@ limitations under the License. com.google.cloud google-cloud-spanner - 0.26.0-beta + 0.30.1-beta-SNAPSHOT com.google.guava @@ -67,6 +67,27 @@ limitations under the License. 20.0 + + io.opencensus + opencensus-impl + 0.6.0 + + + io.opencensus + opencensus-contrib-zpages + 0.6.0 + + + io.opencensus + opencensus-exporter-trace-logging + 0.6.0 + + + io.opencensus + opencensus-exporter-trace-stackdriver + 0.9.0 + + junit diff --git a/spanner/cloud-client/src/main/java/com/example/spanner/QuickstartSample.java b/spanner/cloud-client/src/main/java/com/example/spanner/QuickstartSample.java index a05c847e3ed..4c8f7dd1362 100644 --- a/spanner/cloud-client/src/main/java/com/example/spanner/QuickstartSample.java +++ b/spanner/cloud-client/src/main/java/com/example/spanner/QuickstartSample.java @@ -24,6 +24,7 @@ import com.google.cloud.spanner.Spanner; import com.google.cloud.spanner.SpannerOptions; import com.google.cloud.spanner.Statement; +import java.util.*; /** * A quick start code for Cloud Spanner. It demonstrates how to setup the Cloud Spanner client and @@ -37,7 +38,10 @@ public static void main(String... args) throws Exception { return; } // Instantiates a client - SpannerOptions options = SpannerOptions.newBuilder().build(); + Map labels = new HashMap<>(); + labels.put("dev", "env"); + labels.put("machine", "mac"); + SpannerOptions options = SpannerOptions.newBuilder().setSessionLabels(labels).build(); Spanner spanner = options.getService(); // Name of your instance & database. @@ -57,7 +61,7 @@ public static void main(String... args) throws Exception { } } finally { // Closes the client which will free up the resources used - spanner.close(); + //spanner.close(); } } } diff --git a/spanner/cloud-client/src/main/java/com/example/spanner/SpannerSample.java b/spanner/cloud-client/src/main/java/com/example/spanner/SpannerSample.java index 43a516f4bfc..642bbe846a4 100644 --- a/spanner/cloud-client/src/main/java/com/example/spanner/SpannerSample.java +++ b/spanner/cloud-client/src/main/java/com/example/spanner/SpannerSample.java @@ -18,6 +18,7 @@ import static com.google.cloud.spanner.TransactionRunner.TransactionCallable; +import com.google.auth.oauth2.GoogleCredentials; import com.google.cloud.spanner.Database; import com.google.cloud.spanner.DatabaseAdminClient; import com.google.cloud.spanner.DatabaseClient; @@ -35,6 +36,12 @@ import com.google.cloud.spanner.TimestampBound; import com.google.cloud.spanner.TransactionContext; import com.google.spanner.admin.database.v1.CreateDatabaseMetadata; +import io.opencensus.contrib.zpages.ZPageHandlers; +import io.opencensus.trace.*; +import io.opencensus.trace.config.*; +import io.opencensus.trace.samplers.*; +import io.opencensus.exporter.trace.stackdriver.*; +import io.opencensus.exporter.trace.logging.*; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -484,12 +491,28 @@ static void printUsageAndExit() { " SpannerExample write my-instance example-db"); System.exit(1); } + private static void doWork() { + Tracer tracer = Tracing.getTracer(); + Span rootSpan = tracer.spanBuilderWithExplicitParent("MyRootSpan", null).setSampler(Samplers.alwaysSample()).startSpan(); + rootSpan.addAnnotation("Annotation to the root Span before child is created."); + Span childSpan = tracer.spanBuilderWithExplicitParent("MyChildSpan", rootSpan).startSpan(); + childSpan.addAnnotation("Annotation to the child Span"); + childSpan.end(); + rootSpan.addAnnotation("Annotation to the root Span after child is ended."); + rootSpan.end(); + } public static void main(String[] args) throws Exception { if (args.length != 3) { printUsageAndExit(); } + Tracing.getTraceConfig().updateActiveTraceParams(TraceParams.DEFAULT.toBuilder().setSampler(Samplers.alwaysSample()).build()); + Tracing.getExportComponent().getSampledSpanStore().registerSpanNamesForCollection(Arrays.asList("MyRootSpan", "MyChildSpan")); + LoggingExporter.register(); + ZPageHandlers.startHttpServerAndRegisterAll(8080); + StackdriverExporter.createAndRegister(); // [START init_client] + doWork(); SpannerOptions options = SpannerOptions.newBuilder().build(); Spanner spanner = options.getService(); try { From d576ca0a5b6cc89ac9f8891472151bf0d1e20514 Mon Sep 17 00:00:00 2001 From: Vikas Kedia Date: Fri, 1 Dec 2017 16:30:44 -0800 Subject: [PATCH 2/8] Fixes --- .../com/example/spanner/SpannerSample.java | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/spanner/cloud-client/src/main/java/com/example/spanner/SpannerSample.java b/spanner/cloud-client/src/main/java/com/example/spanner/SpannerSample.java index 642bbe846a4..2fe14f02396 100644 --- a/spanner/cloud-client/src/main/java/com/example/spanner/SpannerSample.java +++ b/spanner/cloud-client/src/main/java/com/example/spanner/SpannerSample.java @@ -36,6 +36,8 @@ import com.google.cloud.spanner.TimestampBound; import com.google.cloud.spanner.TransactionContext; import com.google.spanner.admin.database.v1.CreateDatabaseMetadata; + +import io.opencensus.common.Scope; import io.opencensus.contrib.zpages.ZPageHandlers; import io.opencensus.trace.*; import io.opencensus.trace.config.*; @@ -491,28 +493,15 @@ static void printUsageAndExit() { " SpannerExample write my-instance example-db"); System.exit(1); } - private static void doWork() { - Tracer tracer = Tracing.getTracer(); - Span rootSpan = tracer.spanBuilderWithExplicitParent("MyRootSpan", null).setSampler(Samplers.alwaysSample()).startSpan(); - rootSpan.addAnnotation("Annotation to the root Span before child is created."); - Span childSpan = tracer.spanBuilderWithExplicitParent("MyChildSpan", rootSpan).startSpan(); - childSpan.addAnnotation("Annotation to the child Span"); - childSpan.end(); - rootSpan.addAnnotation("Annotation to the root Span after child is ended."); - rootSpan.end(); - } public static void main(String[] args) throws Exception { if (args.length != 3) { printUsageAndExit(); } Tracing.getTraceConfig().updateActiveTraceParams(TraceParams.DEFAULT.toBuilder().setSampler(Samplers.alwaysSample()).build()); - Tracing.getExportComponent().getSampledSpanStore().registerSpanNamesForCollection(Arrays.asList("MyRootSpan", "MyChildSpan")); - LoggingExporter.register(); ZPageHandlers.startHttpServerAndRegisterAll(8080); StackdriverExporter.createAndRegister(); // [START init_client] - doWork(); SpannerOptions options = SpannerOptions.newBuilder().build(); Spanner spanner = options.getService(); try { @@ -531,7 +520,12 @@ public static void main(String[] args) throws Exception { DatabaseClient dbClient = spanner.getDatabaseClient(db); DatabaseAdminClient dbAdminClient = spanner.getDatabaseAdminClient(); // [END init_client] - run(dbClient, dbAdminClient, command, db); + try (Scope ss = Tracing.getTracer() + .spanBuilderWithExplicitParent("CloudSpannerSample", null) + .setSampler(Samplers.alwaysSample()) + .startScopedSpan()) { + run(dbClient, dbAdminClient, command, db); + } } finally { spanner.close(); } From d7e95200e3b8e6cbaee5795dbecedeb5d0a12aa0 Mon Sep 17 00:00:00 2001 From: Vikas Kedia Date: Fri, 12 Jan 2018 16:05:39 -0800 Subject: [PATCH 3/8] tracing --- .../src/main/java/com/example/spanner/SpannerSample.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spanner/cloud-client/src/main/java/com/example/spanner/SpannerSample.java b/spanner/cloud-client/src/main/java/com/example/spanner/SpannerSample.java index 2fe14f02396..a5555ac01cd 100644 --- a/spanner/cloud-client/src/main/java/com/example/spanner/SpannerSample.java +++ b/spanner/cloud-client/src/main/java/com/example/spanner/SpannerSample.java @@ -498,10 +498,10 @@ public static void main(String[] args) throws Exception { if (args.length != 3) { printUsageAndExit(); } - Tracing.getTraceConfig().updateActiveTraceParams(TraceParams.DEFAULT.toBuilder().setSampler(Samplers.alwaysSample()).build()); ZPageHandlers.startHttpServerAndRegisterAll(8080); StackdriverExporter.createAndRegister(); // [START init_client] + Tracing.getExportComponent().getSampledSpanStore().registerSpanNamesForCollection(Arrays.asList("CloudSpannerSample")); SpannerOptions options = SpannerOptions.newBuilder().build(); Spanner spanner = options.getService(); try { From 4d755abc18d3fe719ff27a621d4a6133e4efff8a Mon Sep 17 00:00:00 2001 From: Vikas Kedia Date: Mon, 22 Jan 2018 13:58:40 -0800 Subject: [PATCH 4/8] Add tracing sample --- spanner/cloud-client/pom.xml | 23 ++++--- .../com/example/spanner/TracingSample.java | 60 +++++++++++++++++++ 2 files changed, 76 insertions(+), 7 deletions(-) create mode 100644 spanner/cloud-client/src/main/java/com/example/spanner/TracingSample.java diff --git a/spanner/cloud-client/pom.xml b/spanner/cloud-client/pom.xml index bb46b8ec079..856934b18cb 100644 --- a/spanner/cloud-client/pom.xml +++ b/spanner/cloud-client/pom.xml @@ -52,11 +52,16 @@ limitations under the License. com.google.cloud google-cloud-spanner - 0.32.0-beta + 0.33.0-beta - com.google.guava + + com.google.guava guava-jdk5 + + io.opencensus + opencensus-api + @@ -65,26 +70,30 @@ limitations under the License. guava 20.0 - + + io.opencensus + opencensus-api + 0.11.0 + io.opencensus opencensus-impl - 0.6.0 + 0.11.0 io.opencensus opencensus-contrib-zpages - 0.6.0 + 0.11.0 io.opencensus opencensus-exporter-trace-logging - 0.6.0 + 0.11.0 io.opencensus opencensus-exporter-trace-stackdriver - 0.9.0 + 0.11.0 diff --git a/spanner/cloud-client/src/main/java/com/example/spanner/TracingSample.java b/spanner/cloud-client/src/main/java/com/example/spanner/TracingSample.java new file mode 100644 index 00000000000..4eabf559e5e --- /dev/null +++ b/spanner/cloud-client/src/main/java/com/example/spanner/TracingSample.java @@ -0,0 +1,60 @@ +package com.example.spanner; + +import java.util.Arrays; + +import com.google.cloud.spanner.DatabaseClient; +import com.google.cloud.spanner.DatabaseId; +import com.google.cloud.spanner.ResultSet; +import com.google.cloud.spanner.Spanner; +import com.google.cloud.spanner.SpannerOptions; +import com.google.cloud.spanner.Statement; + +import io.opencensus.common.Scope; +import io.opencensus.contrib.zpages.ZPageHandlers; +import io.opencensus.exporter.trace.stackdriver.StackdriverExporter; +import io.opencensus.trace.Tracing; +import io.opencensus.trace.samplers.Samplers; + +public class TracingSample { + + public static void main(String[] args) throws Exception { + if (args.length != 2) { + System.err.println("Usage: TracingSample "); + return; + } + SpannerOptions options = SpannerOptions.newBuilder().build(); + Spanner spanner = options.getService(); + + // Installs a handler for /tracez page. + ZPageHandlers.startHttpServerAndRegisterAll(8080); + // Installs an exporter for stack driver. + StackdriverExporter.createAndRegister(); + Tracing.getExportComponent().getSampledSpanStore().registerSpanNamesForCollection(Arrays.asList("CloudSpannerSample")); + + // Name of your instance & database. + String instanceId = args[0]; + String databaseId = args[1]; + try { + // Creates a database client + DatabaseClient dbClient = spanner.getDatabaseClient(DatabaseId.of( + options.getProjectId(), instanceId, databaseId)); + // Queries the database + try (Scope ss = Tracing.getTracer() + .spanBuilderWithExplicitParent("CloudSpannerSample", null) + .setSampler(Samplers.alwaysSample()) + .startScopedSpan()) { + ResultSet resultSet = dbClient.singleUse().executeQuery(Statement.of("SELECT 1")); + + System.out.println("\n\nResults:"); + // Prints the results + while (resultSet.next()) { + System.out.printf("%d\n\n", resultSet.getLong(0)); + } + } + } finally { + // Closes the client which will free up the resources used + spanner.close(); + } + } + +} From 2f866251c8237896c6829fc0a4c385d8f418b1db Mon Sep 17 00:00:00 2001 From: Vikas Kedia Date: Mon, 22 Jan 2018 16:41:57 -0800 Subject: [PATCH 5/8] Revert Quickstart --- .../main/java/com/example/spanner/QuickstartSample.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/spanner/cloud-client/src/main/java/com/example/spanner/QuickstartSample.java b/spanner/cloud-client/src/main/java/com/example/spanner/QuickstartSample.java index 4c8f7dd1362..a05c847e3ed 100644 --- a/spanner/cloud-client/src/main/java/com/example/spanner/QuickstartSample.java +++ b/spanner/cloud-client/src/main/java/com/example/spanner/QuickstartSample.java @@ -24,7 +24,6 @@ import com.google.cloud.spanner.Spanner; import com.google.cloud.spanner.SpannerOptions; import com.google.cloud.spanner.Statement; -import java.util.*; /** * A quick start code for Cloud Spanner. It demonstrates how to setup the Cloud Spanner client and @@ -38,10 +37,7 @@ public static void main(String... args) throws Exception { return; } // Instantiates a client - Map labels = new HashMap<>(); - labels.put("dev", "env"); - labels.put("machine", "mac"); - SpannerOptions options = SpannerOptions.newBuilder().setSessionLabels(labels).build(); + SpannerOptions options = SpannerOptions.newBuilder().build(); Spanner spanner = options.getService(); // Name of your instance & database. @@ -61,7 +57,7 @@ public static void main(String... args) throws Exception { } } finally { // Closes the client which will free up the resources used - //spanner.close(); + spanner.close(); } } } From 74050b67169f832b0fa651c0bb0a3218b4f8a161 Mon Sep 17 00:00:00 2001 From: Vikas Kedia Date: Mon, 22 Jan 2018 16:42:12 -0800 Subject: [PATCH 6/8] Revert Spanner sample --- .../com/example/spanner/SpannerSample.java | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/spanner/cloud-client/src/main/java/com/example/spanner/SpannerSample.java b/spanner/cloud-client/src/main/java/com/example/spanner/SpannerSample.java index a5555ac01cd..43a516f4bfc 100644 --- a/spanner/cloud-client/src/main/java/com/example/spanner/SpannerSample.java +++ b/spanner/cloud-client/src/main/java/com/example/spanner/SpannerSample.java @@ -18,7 +18,6 @@ import static com.google.cloud.spanner.TransactionRunner.TransactionCallable; -import com.google.auth.oauth2.GoogleCredentials; import com.google.cloud.spanner.Database; import com.google.cloud.spanner.DatabaseAdminClient; import com.google.cloud.spanner.DatabaseClient; @@ -36,14 +35,6 @@ import com.google.cloud.spanner.TimestampBound; import com.google.cloud.spanner.TransactionContext; import com.google.spanner.admin.database.v1.CreateDatabaseMetadata; - -import io.opencensus.common.Scope; -import io.opencensus.contrib.zpages.ZPageHandlers; -import io.opencensus.trace.*; -import io.opencensus.trace.config.*; -import io.opencensus.trace.samplers.*; -import io.opencensus.exporter.trace.stackdriver.*; -import io.opencensus.exporter.trace.logging.*; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -498,10 +489,7 @@ public static void main(String[] args) throws Exception { if (args.length != 3) { printUsageAndExit(); } - ZPageHandlers.startHttpServerAndRegisterAll(8080); - StackdriverExporter.createAndRegister(); // [START init_client] - Tracing.getExportComponent().getSampledSpanStore().registerSpanNamesForCollection(Arrays.asList("CloudSpannerSample")); SpannerOptions options = SpannerOptions.newBuilder().build(); Spanner spanner = options.getService(); try { @@ -520,12 +508,7 @@ public static void main(String[] args) throws Exception { DatabaseClient dbClient = spanner.getDatabaseClient(db); DatabaseAdminClient dbAdminClient = spanner.getDatabaseAdminClient(); // [END init_client] - try (Scope ss = Tracing.getTracer() - .spanBuilderWithExplicitParent("CloudSpannerSample", null) - .setSampler(Samplers.alwaysSample()) - .startScopedSpan()) { - run(dbClient, dbAdminClient, command, db); - } + run(dbClient, dbAdminClient, command, db); } finally { spanner.close(); } From 66353520b3c328b045c0d46c01903458557ff56a Mon Sep 17 00:00:00 2001 From: Vikas Kedia Date: Tue, 23 Jan 2018 09:37:36 -0800 Subject: [PATCH 7/8] Address review comments --- spanner/cloud-client/README.md | 6 ++++++ spanner/cloud-client/pom.xml | 21 ++++++++++++------- .../com/example/spanner/TracingSample.java | 14 ++++++++++--- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/spanner/cloud-client/README.md b/spanner/cloud-client/README.md index b028fff17cb..70fd0ee62b2 100644 --- a/spanner/cloud-client/README.md +++ b/spanner/cloud-client/README.md @@ -31,5 +31,11 @@ You can then run a given `ClassName` via: ### Running the tutorial mvn exec:java -Dexec.mainClass=com.example.spanner.SpannerSample -Dexec.args=" my-instance my-database" +## Tracing sample +TracingSample.java demonstrates how to export traces generated by client library to StackDriver and to /tracez page. + +### Running the tracing sample + mvn exec:java -Dexec.mainClass=com.example.spanner.TracingSample -Dexec.args="my-instance my-database" + ## Test mvn verify -Dspanner.test.instance= -Dspanner.sample.database= -Dspanner.quickstart.database= diff --git a/spanner/cloud-client/pom.xml b/spanner/cloud-client/pom.xml index 856934b18cb..f12b08dfaae 100644 --- a/spanner/cloud-client/pom.xml +++ b/spanner/cloud-client/pom.xml @@ -46,6 +46,7 @@ limitations under the License. 1.8 1.8 UTF-8 + 0.11.0 @@ -73,27 +74,33 @@ limitations under the License. io.opencensus opencensus-api - 0.11.0 + ${opencensus.version} io.opencensus opencensus-impl - 0.11.0 + ${opencensus.version} + runtime io.opencensus opencensus-contrib-zpages - 0.11.0 + ${opencensus.version} io.opencensus - opencensus-exporter-trace-logging - 0.11.0 + opencensus-exporter-trace-stackdriver + ${opencensus.version} io.opencensus - opencensus-exporter-trace-stackdriver - 0.11.0 + opencensus-exporter-stats-stackdriver + ${opencensus.version} + + + io.opencensus + opencensus-contrib-grpc-metrics + ${opencensus.version} diff --git a/spanner/cloud-client/src/main/java/com/example/spanner/TracingSample.java b/spanner/cloud-client/src/main/java/com/example/spanner/TracingSample.java index 4eabf559e5e..92a762ca57e 100644 --- a/spanner/cloud-client/src/main/java/com/example/spanner/TracingSample.java +++ b/spanner/cloud-client/src/main/java/com/example/spanner/TracingSample.java @@ -10,12 +10,16 @@ import com.google.cloud.spanner.Statement; import io.opencensus.common.Scope; +import io.opencensus.contrib.grpc.metrics.RpcViews; import io.opencensus.contrib.zpages.ZPageHandlers; +import io.opencensus.exporter.stats.stackdriver.StackdriverStatsExporter; import io.opencensus.exporter.trace.stackdriver.StackdriverExporter; import io.opencensus.trace.Tracing; import io.opencensus.trace.samplers.Samplers; public class TracingSample { + + private static final String SAMPLE_SPAN = "CloudSpannerSample"; public static void main(String[] args) throws Exception { if (args.length != 2) { @@ -27,10 +31,14 @@ public static void main(String[] args) throws Exception { // Installs a handler for /tracez page. ZPageHandlers.startHttpServerAndRegisterAll(8080); - // Installs an exporter for stack driver. + // Installs an exporter for stack driver traces. StackdriverExporter.createAndRegister(); - Tracing.getExportComponent().getSampledSpanStore().registerSpanNamesForCollection(Arrays.asList("CloudSpannerSample")); + Tracing.getExportComponent().getSampledSpanStore().registerSpanNamesForCollection(Arrays.asList(SAMPLE_SPAN)); + // Installs an exporter for stack driver stats. + StackdriverStatsExporter.createAndRegister(); + RpcViews.registerAllCumulativeViews(); + // Name of your instance & database. String instanceId = args[0]; String databaseId = args[1]; @@ -40,7 +48,7 @@ public static void main(String[] args) throws Exception { options.getProjectId(), instanceId, databaseId)); // Queries the database try (Scope ss = Tracing.getTracer() - .spanBuilderWithExplicitParent("CloudSpannerSample", null) + .spanBuilderWithExplicitParent(SAMPLE_SPAN, null) .setSampler(Samplers.alwaysSample()) .startScopedSpan()) { ResultSet resultSet = dbClient.singleUse().executeQuery(Statement.of("SELECT 1")); From 29568bac870a7e8a8898e052d586a19ac03adb28 Mon Sep 17 00:00:00 2001 From: Vikas Kedia Date: Tue, 23 Jan 2018 12:29:57 -0800 Subject: [PATCH 8/8] Fix style violations --- .../com/example/spanner/TracingSample.java | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/spanner/cloud-client/src/main/java/com/example/spanner/TracingSample.java b/spanner/cloud-client/src/main/java/com/example/spanner/TracingSample.java index 92a762ca57e..4dfd5a1cb15 100644 --- a/spanner/cloud-client/src/main/java/com/example/spanner/TracingSample.java +++ b/spanner/cloud-client/src/main/java/com/example/spanner/TracingSample.java @@ -1,6 +1,20 @@ -package com.example.spanner; +/* + * Copyright 2018 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ -import java.util.Arrays; +package com.example.spanner; import com.google.cloud.spanner.DatabaseClient; import com.google.cloud.spanner.DatabaseId; @@ -17,11 +31,16 @@ import io.opencensus.trace.Tracing; import io.opencensus.trace.samplers.Samplers; +import java.util.Arrays; + +/** + * This sample demonstrates how to enable opencensus tracing and stats in cloud spanner client. + */ public class TracingSample { private static final String SAMPLE_SPAN = "CloudSpannerSample"; - public static void main(String[] args) throws Exception { + public static void main(String[] args) throws Exception { if (args.length != 2) { System.err.println("Usage: TracingSample "); return; @@ -33,7 +52,8 @@ public static void main(String[] args) throws Exception { ZPageHandlers.startHttpServerAndRegisterAll(8080); // Installs an exporter for stack driver traces. StackdriverExporter.createAndRegister(); - Tracing.getExportComponent().getSampledSpanStore().registerSpanNamesForCollection(Arrays.asList(SAMPLE_SPAN)); + Tracing.getExportComponent().getSampledSpanStore().registerSpanNamesForCollection( + Arrays.asList(SAMPLE_SPAN)); // Installs an exporter for stack driver stats. StackdriverStatsExporter.createAndRegister();