You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/src/main/asciidoc/trace.adoc
+7-8
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
== Spring Cloud Sleuth
2
2
3
3
https://cloud.spring.io/spring-cloud-sleuth/[Spring Cloud Sleuth] is an instrumentation framework for Spring Boot applications.
4
-
It captures trace informations and can forward traces to services like Zipkin for storage and analysis.
4
+
It captures trace information and can forward traces to services like Zipkin for storage and analysis.
5
5
6
6
Google Cloud Platform provides its own managed distributed tracing service called https://cloud.google.com/trace/[Stackdriver Trace].
7
7
Instead of running and maintaining your own Zipkin instance and storage, you can use Stackdriver Trace to store traces, view trace details, generate latency distributions graphs, and generate performance regression reports.
@@ -10,7 +10,6 @@ This Spring Cloud GCP starter can forward Spring Cloud Sleuth traces to Stackdri
10
10
11
11
Maven coordinates, using Spring Cloud GCP BOM:
12
12
13
-
14
13
[source,xml]
15
14
----
16
15
<dependency>
@@ -33,15 +32,15 @@ Navigate to the https://console.cloud.google.com/apis/api/cloudtrace.googleapis.
33
32
34
33
[NOTE]
35
34
====
36
-
If you are already using a Zipkin server capturing trace information from multiple platform/frameworks, you also use a https://cloud.google.com/trace/docs/zipkin[Stackdriver Zipkin proxy] to forward those traces to Stackdriver Trace without modifying existing applications.
35
+
If you are already using a Zipkin server capturing trace information from multiple platform/frameworks, you can also use a https://cloud.google.com/trace/docs/zipkin[Stackdriver Zipkin proxy] to forward those traces to Stackdriver Trace without modifying existing applications.
37
36
====
38
37
39
38
=== Tracing
40
39
41
40
Spring Cloud Sleuth uses the https://github.com/openzipkin/brave[Brave tracer] to generate traces.
42
41
This integration enables Brave to use the https://github.com/openzipkin/zipkin-gcp/tree/master/propagation-stackdriver[`StackdriverTracePropagation`] propagation.
43
42
44
-
A propagation is responsible for extracting trace context from an entity (e.g., an HTTP servlet request) and for injecting trace context into an entity.
43
+
A propagation is responsible for extracting trace context from an entity (e.g., an HTTP servlet request) and injecting trace context into an entity.
45
44
A canonical example of the propagation usage is a web server that receives an HTTP request, which triggers other HTTP requests from the server before returning an HTTP response to the original caller.
46
45
In the case of `StackdriverTracePropagation`, first it looks for trace context in the `x-cloud-trace-context` key (e.g., an HTTP request header).
47
46
The value of the `x-cloud-trace-context` key can be formatted in three different ways:
@@ -56,8 +55,7 @@ The value of the `x-cloud-trace-context` key can be formatted in three different
56
55
Since Stackdriver Trace doesn't support span joins, a new span ID is always generated, regardless of the one specified in `x-cloud-trace-context`.
57
56
58
57
`TRACE_TRUE` can either be `0` if the entity should be untraced, or `1` if it should be traced.
59
-
However, at the moment, if `TRACE_TRUE` is set to `1`, the entity isn't necessarily traced.
60
-
Currently, to make sure a request is traced, the Sleuth property `spring.sleuth.sampler.probability=1` should be used, to trace every entity.
58
+
This field forces the decision of whether or not to trace the request; if omitted then the decision is deferred to the sampler.
61
59
62
60
If a `x-cloud-trace-context` key isn't found, `StackdriverTracePropagation` falls back to tracing with the https://github.com/openzipkin/b3-propagation[X-B3 headers].
63
61
@@ -97,7 +95,9 @@ spring.sleuth.web.skipPattern=(^cleanup.*|.+favicon.*) # Ignore some URL paths.
97
95
Spring Cloud GCP Trace does override some Sleuth configurations:
98
96
99
97
- Always uses 128-bit Trace IDs. This is required by Stackdriver Trace.
100
-
- Does not use Span joins. Span joins will share the span ID between the client and server Spans. Stackdriver requires that every Span ID within a Trace to be unique, so Span joins are not supported.
98
+
- Does not use Span joins.
99
+
Span joins will share the span ID between the client and server Spans.
100
+
Stackdriver requires that every Span ID within a Trace to be unique, so Span joins are not supported.
101
101
- Uses `StackdriverHttpClientParser` and `StackdriverHttpServerParser` by default to populate Stackdriver related fields.
102
102
103
103
=== Integration with Logging
@@ -106,7 +106,6 @@ Integration with Stackdriver Logging is available through the link:logging.adoc[
106
106
If the Trace integration is used together with the Logging one, the request logs will be associated to the corresponding traces.
107
107
The trace logs can be viewed by going to the https://console.cloud.google.com/traces/traces[Google Cloud Console Trace List], selecting a trace and pressing the `Logs -> View` link in the `Details` section.
108
108
109
-
110
109
=== Sample
111
110
112
111
A https://github.com/spring-cloud/spring-cloud-gcp/tree/master/spring-cloud-gcp-samples/spring-cloud-gcp-trace-sample[sample application] and a https://codelabs.developers.google.com/codelabs/cloud-spring-cloud-gcp-trace/index.html[codelab] are available.
0 commit comments