From 40d54bfe2267cb5687a0c717fb966e63b61dab97 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Tue, 3 Mar 2020 18:46:54 +0000 Subject: [PATCH] Sync docs from master to gh-pages --- reference/html/index.html | 55 ++++++++++++++++++++++--- reference/html/spring-cloud-sleuth.html | 55 ++++++++++++++++++++++--- 2 files changed, 98 insertions(+), 12 deletions(-) diff --git a/reference/html/index.html b/reference/html/index.html index 895d81716..1ebec55ae 100644 --- a/reference/html/index.html +++ b/reference/html/index.html @@ -2529,13 +2529,55 @@ public void getAnnotationForArgumentToString(@SpanTag("test") Long param) {

12.2. HTTP

+
+

12.2.1. Data Policy

-

If a customization of client / server parsing of the HTTP related spans is -required, just register a bean of type brave.http.HttpClientParser or -brave.http.HttpServerParser. If client /server sampling is required, just -register a bean of type brave.sampler.SamplerFunction<HttpRequest> and name -the bean sleuthHttpClientSampler for client sampler and -sleuthHttpServerSampler for server sampler.

+

The default span data policy for HTTP requests is described in Brave: +github.com/openzipkin/brave/tree/master/instrumentation/http#span-data-policy

+
+
+

To add different data to the span, you need to register a bean of type +brave.http.HttpRequestParser or brave.http.HttpResponseParser based on when +the data is collected.

+
+
+

The bean names correspond to the request or response side, and whether it is +a client or server. For example, sleuthHttpClientRequestParser changes what +is collected before a client request is sent to the server.

+
+
+

For your convenience @HttpClientRequestParser, @HttpClientResponseParser +and corresponding server annotations can be used to inject the proper beans +or to reference the bean names via their static String NAME fields.

+
+
+

Here’s an example adding the HTTP url in addition to defaults:

+
+
+
+
@Configuration
+class Config {
+  @Bean(name = { HttpClientRequestParser.NAME, HttpServerRequestParser.NAME })
+  HttpRequestParser sleuthHttpServerRequestParser() {
+      return (req, context, span) -> {
+          HttpRequestParser.DEFAULT.parse(req, context, span);
+          String url = req.url();
+          if (url != null) {
+              span.tag("http.url", url);
+          }
+      };
+  }
+}
+
+
+
+
+

12.2.2. Sampling

+
+

If client /server sampling is required, just register a bean of type +brave.sampler.SamplerFunction<HttpRequest> and name the bean +sleuthHttpClientSampler for client sampler and sleuthHttpServerSampler +for server sampler.

For your convenience the @HttpClientSampler and @HttpServerSampler @@ -2571,6 +2613,7 @@ class Config {

+

12.3. TracingFilter

diff --git a/reference/html/spring-cloud-sleuth.html b/reference/html/spring-cloud-sleuth.html index 895d81716..1ebec55ae 100644 --- a/reference/html/spring-cloud-sleuth.html +++ b/reference/html/spring-cloud-sleuth.html @@ -2529,13 +2529,55 @@ public void getAnnotationForArgumentToString(@SpanTag("test") Long param) {

12.2. HTTP

+
+

12.2.1. Data Policy

-

If a customization of client / server parsing of the HTTP related spans is -required, just register a bean of type brave.http.HttpClientParser or -brave.http.HttpServerParser. If client /server sampling is required, just -register a bean of type brave.sampler.SamplerFunction<HttpRequest> and name -the bean sleuthHttpClientSampler for client sampler and -sleuthHttpServerSampler for server sampler.

+

The default span data policy for HTTP requests is described in Brave: +github.com/openzipkin/brave/tree/master/instrumentation/http#span-data-policy

+
+
+

To add different data to the span, you need to register a bean of type +brave.http.HttpRequestParser or brave.http.HttpResponseParser based on when +the data is collected.

+
+
+

The bean names correspond to the request or response side, and whether it is +a client or server. For example, sleuthHttpClientRequestParser changes what +is collected before a client request is sent to the server.

+
+
+

For your convenience @HttpClientRequestParser, @HttpClientResponseParser +and corresponding server annotations can be used to inject the proper beans +or to reference the bean names via their static String NAME fields.

+
+
+

Here’s an example adding the HTTP url in addition to defaults:

+
+
+
+
@Configuration
+class Config {
+  @Bean(name = { HttpClientRequestParser.NAME, HttpServerRequestParser.NAME })
+  HttpRequestParser sleuthHttpServerRequestParser() {
+      return (req, context, span) -> {
+          HttpRequestParser.DEFAULT.parse(req, context, span);
+          String url = req.url();
+          if (url != null) {
+              span.tag("http.url", url);
+          }
+      };
+  }
+}
+
+
+
+
+

12.2.2. Sampling

+
+

If client /server sampling is required, just register a bean of type +brave.sampler.SamplerFunction<HttpRequest> and name the bean +sleuthHttpClientSampler for client sampler and sleuthHttpServerSampler +for server sampler.

For your convenience the @HttpClientSampler and @HttpServerSampler @@ -2571,6 +2613,7 @@ class Config {

+

12.3. TracingFilter