google-cloud-trace overview (2.8.0)

com.google.cloud.trace.v1

The interfaces provided are listed below, along with usage samples.

TraceServiceClient

Service Description: This file describes an API for collecting and viewing traces and spans within a trace. A Trace is a collection of spans corresponding to a single operation or set of operations for an application. A span is an individual timed event which forms a node of the trace tree. Spans for a single trace may span multiple services.

Sample for TraceServiceClient:

// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_librarytry(TraceServiceClienttraceServiceClient=TraceServiceClient.create()){StringprojectId="projectId-894832108";StringtraceId="traceId-1067401920";Traceresponse=traceServiceClient.getTrace(projectId,traceId);}

com.google.cloud.trace.v1.stub

com.google.cloud.trace.v2

The interfaces provided are listed below, along with usage samples.

TraceServiceClient

Service Description: This file describes an API for collecting and viewing traces and spans within a trace. A Trace is a collection of spans corresponding to a single operation or set of operations for an application. A span is an individual timed event which forms a node of the trace tree. A single trace may contain span(s) from multiple services.

Sample for TraceServiceClient:

// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_librarytry(TraceServiceClienttraceServiceClient=TraceServiceClient.create()){ProjectNamename=ProjectName.of("[PROJECT]");List<Span>spans=newArrayList<>();traceServiceClient.batchWriteSpans(name,spans);}

com.google.cloud.trace.v2.stub

com.google.devtools.cloudtrace.v1

com.google.devtools.cloudtrace.v2

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-11-19 UTC.